R8(1) R8(1) NAME r8 - control a R. L. Drake R8 Communications Receiver via an RS232C serial port SYNOPSIS r8 [-d device] [-i infilename] [-o outfilename] [-l lockfilename] [-v] DESCRIPTION R8 is for controlling an R. L. Drake R8 Communications Receiver via an RS232C serial port. The default port is /dev/ttyS0 at a fixed 9600 baud rate. The default semaphore lock file is /var/lock/LCK..ttyS0, which has an fcntl(2) advisory lock applied, also. The serial port is con- trolled through termios(3), and is restored to original values on exit. If the input is stdin, and a tty, (as opposed to a file, pipe, named pipe, or redirection,) the terminal attributes are changed to through termios(3) to non-cannonical, one character at a time, which is restored to original values on exit. The serial port child read pro- cess is created by fork(2) from the parent write process, and both pro- cesses respond to SIGINT = ^C and SIGTERM signals. R. L. Drake R8 RS232C command interface, (from the Drake R8 Communica- tions Receiver Owner's Manual, DOM-385112990B-5-1991, page 20): R8 COMMAND: RS232 COMMAND: R8 RESPONSE AGC set AF, LF AS, LF AO LF ANT select A1, LF A2, LF AC LF Noise blanker set BW, LF BN, LF BF LF Step change ST (scrolls) LF Set frequency F xxxxxxx CR LF if OK, CR if not Syncro det. set SO, LF SF LF RF select G+, LF G-, LF G0 LF Notch set NO, LF NF LF Mode select M6 (AM,) LF M5 (FM,) LF M4 (CW,) LF M3 (RTTY,) LF M2 (LSB,) LF M1 (USB) LF VFO select VA, LF VB LF Bandwidth select W0 (0.5,) LF W1 (1.8,) LF W2 (2.3,) LF W4 (4.0,) LF W6 (6.0) LF Memory mode C LF Memory channel select Cx (x = 0 to 99) CR LF if OK, CR if not Program Memory channel PRx (x = 0 to 99) CR LF if OK, CR if not Power on/off PO, LF PF LF Timer relay on/off TO, LF TF LF Identify receiver ID R8 CR LF Tune up (freq. or scan) U None Tune down (" " ") D None Scan select Sx (x = 1-3, 4-5) LF Scan start/stop SC (toggle) LF Report frequency RF xxx.xxxxx mHz CR LF Report frequency, RFR xxx.xxxxx mHz CR LF repeat every 5 seconds Report mode RM xxxxx CR LF Report mode, RMR xxxxx CR LF repeat every 5 seconds Report mem channel RC xx CR LF Report mem channel, RCR xx CR LF repeat every 5 seconds Report all RA nn aaaa dd.ddddd mHz Report all, RAR nn aaaa dd.ddddd mHz repeat every 5 seconds Report stop RS LF Note: The Linux minicom(1) communications program can also be used to control the R8: 1) Ctrl-A, Z for help screen 2) P for comm parameters 3) EMRUW, 9600, even parity, 7E1, 7 data bits, 1 stop bit 4) Ctrl-A, Z for help screen 5) E for echo There is no echo from the Drake R8, and commands must be in upper case. The command set, and returns, used in this program is identical to the command set outlined in R. L. Drake R8 RS232C command interface, (from the Drake R8 Communications Receiver Owner's Manual, DOM-385112990B-5-1991, page 20,) except that 'H' was added to print a help screen, 'Q' and 'X' were added to exit the program. As an additional expediency, the following frequency translation occurs, (if the first character of a command word is a number): 0010000-0099999 -> F0010000-F0099999 0100000-0999999 -> F0100000-F0999999 1000000-3000000 -> F1000000-F3000000 400000-999999 -> F0400000-F0999999 First character of a word a number? First character a 0, 1, 2, or, 3? Add a leading 'F' character and output the character First character a 4, 5, 6, 7, 8, or, 9? Add a leading 'F', follwed by a '0', and output the character OPTIONS -d device Device name, (/dev/ttyS0). -i infilename Input filename, (stdin). -l lockfilename Lock file name, (/var/lock/LCK..ttyS0). -o outfilename Output filename, (stdout). -v Print the program's version information WARNINGS The termios(3) and open(2) settings tested only on Linux 2.4. The semaphore locking mechanism uses fcntl(2), and may not be compatible with other serial programs. SEE ALSO r8(1) DIAGNOSTICS Error messages for incompatible arguments, inaccessible files, and opening and closing files. AUTHORS ---------------------------------------------------------------------- A license is hereby granted to reproduce this software source code and to create executable versions from this source code for personal, non-commercial use. The copyright notice included with the software must be maintained in all copies produced. THIS PROGRAM IS PROVIDED "AS IS". THE AUTHOR PROVIDES NO WARRANTIES WHATSOEVER, EXPRESSED OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, TITLE, OR FITNESS FOR ANY PARTICULAR PURPOSE. THE AUTHOR DOES NOT WARRANT THAT USE OF THIS PROGRAM DOES NOT INFRINGE THE INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY IN ANY COUNTRY. Copyright (c) 1994-2006, John Conover, All Rights Reserved. Comments and/or bug reports should be addressed to: john@email.johncon.com (John Conover) ---------------------------------------------------------------------- June 18, 2006 R8(1)