Section: Radio Control Program (1)
Updated: March 12, 2013Index
rigctl - control radio transceivers and receivers
Control radio transceivers and receivers.rigctl
from the command line as well as ininteractive mode if none are provided on the command line.
Keep in mind that Hamlib is BETA level software.While a lot of backend libraries lack complete rig support, the basic functionsare usually well supported. The API may change without publicized notice,while an advancement of the major version (e.g. 1.x to 3.x) indicates sucha change.
Please report bugs and provide feedback at the e-mail address given in theREPORTING BUGS section. Patches and code enhancements are also welcome.
This program follows the usual GNU command line syntax, with longoptions starting with two dashes ('-').
Here is a summary of the supported options:
- -m, --model=id
- Select radio model number. See model list (use 'rigctl -l').
NB: rigctl (or third party software) will use rig model 2for NET rigctl (rigctld).
- -r, --rig-file=device
- Use device as the file name of the port the radio is connected.Often a serial port, but could be a USB to serial adapter. Typically/dev/ttyS0, /dev/ttyS1, /dev/ttyUSB0, etc. on Linux or COM1, COM2, etc.on Win32.
- -p, --ptt-file=device
- Use device as the file name of the Push-To-Talk device using adevice file as described above.
- -d, --dcd-file=device
- Use device as the file name of the Data Carrier Detect device using adevice file as described above.
- -P, --ptt-type=type
- Use type of Push-To-Talk device.Supported types are RIG, DTR, RTS, PARALLEL, NONE, overriding PTT typedefined in the rig's backend.
Some side effects of this command are that when type is set to DTR, readPTT state comes from Hamlib frontend, not read from the radio. When setto NONE, PTT state cannot be read or set even if rig backend supportsreading/setting PTT status from the rig.
- -D, --dcd-type=type
- Use type of Data Carrier Detect device.Supported types are RIG, DSR, CTS, CD, PARALLEL, NONE.
- -s, --serial-speed=baud
- Set serial speed to baud rate. Uses maximum serial speed from rigbackend capabilities as the default.
- -c, --civaddr=id
- Use id as the CI-V address to communicate with the rig. Only useful forIcom rigs.
NB: the id is in decimal notation, unless prefixed by0x, in which case it is hexadecimal.
- -t, --send-cmd-term=char
- Change the termination char for text protocol when using thesend_cmd command. The default value is <CR> (0x0d). Non ASCII printablecharacters can be specified as an ASCII number, in hexadecimal format,prepended with 0x. You may pass an empty string for no termination char. Thestring '-1' tells rigctl to switch to binary protocol. See the send_cmdcommand for further explanation.
For example, to specify a command terminator for Kenwood style text commandspass "-t ';'" to rigctl. See EXAMPLES below.
- -L, --show-conf
- List all config parameters for the radio defined with -m above.
- -C, --set-conf=parm=val[,parm=val]*
- Set config parameter. e.g. stop_bits=2
Use -L option for a list.
- -l, --list
- List all model numbers defined in Hamlib and exit. As of 18.104.22.168the list is sorted by model number.
N.B. In Linux the list can be scrolled back using Shift-PageUp/Shift-PageDown, or using the scrollbars of a virtual terminal in X orthe cmd window in Windows. The output can be piped to 'more' or 'less',e.g. 'rigctl -l | more'.
- -u, --dump-caps
- Dump capabilities for the radio defined with -m above and exit.
- -o, --vfo
- Set vfo mode, requiring an extra VFO argument in front of each appropriatecommand. Otherwise, 'currVFO' is assumed when this option is not set.
- -i, --read-history
- Read previously saved command and argument history from a file(default '~/.rigctl_history') for the current session. Available whenrigctl is built with Readline support (see READLINE below).
N.B. To read a history file stored in another directory, set theRIGCTL_HIST_DIR environment variable, e.g. 'RIGCTL_HIST_DIR=~/tmp rigctl -i'.When RIGCTL_HIST_DIR is not set, the value of HOME is used.
- -I, --save-history
- Write current session and previous session(s), if -i option is given, command andargument history to a file (default '~/.rigctl_history') at the end of the currentsession. Complete commands with arguments are saved as a single line to berecalled and used or edited. Available when rigctl is built with Readlinesupport (see READLINE below).
N.B. To write a history file in another directory, set the RIGCTL_HIST_DIRenvironment variable, e.g. 'RIGCTL_HIST_DIR=~/tmp rigctl -I'. When RIGCTL_HIST_DIRis not set, the value of HOME is used.
- -v, --verbose
- Set verbose mode, cumulative (see DIAGNOSTICS below).
- -h, --help
- Show summary of these options and exit.
- -V, --version
- Show version of rigctl and exit.
N.B. Some options may not be implemented by a given backend and willreturn an error. This is most likely to occur with the --set-confand --show-conf options.
Please note that the backend for the radio to be controlled,or the radio itself may not support some commands. In that case,the operation will fail with a Hamlib error code.
Commands can be entered either as a single char, or as a long command name.Basically, the commands do not take a dash in front of them on the commandline, as the options do. They may be typed in when in interactive modeor provided as argument(s) in command line interface mode. In interactivemode commands and their arguments may be entered on a single line:
Rig command: M LSB 2400
Since most of the Hamlib operations have a set and a getmethod, an upper case letter will be used for set method whereas thecorresponding lower case letter refers to the get method. Each operationalso has a long name; in interactive mode, prepend a backslash to enter a longcommand name.
Example: Use '\dump_caps' to see what this radio and backend support.
Please note that the backend for the radio to be controlled, or the radioitself may not support some commands. In that case, the operation will failwith a Hamlib error message.
As an alternative to the READLINE command history features a specialcommand of a single dash ('-') may be used to read commands fromstandard input. Commands must be separated by whitespace similar tothe commands given on the command line. Comments may be added usingthe '#' character, all text up until the end of the current lineincluding the '#' character is ignored.
$ cat <<.EOF. >cmds.txt
> # File of commands
> v f m # query rig
> V VFOB F 14200000 M CW 500 # set rig
> v f m # query rig
$ rigctl -m1 - <cmds.txt
M CW 500
Here is a summary of the supported commands (In the case of "set" commands thequoted string is replaced by the value in the description. In the case of "get"commands the quoted string is the key name of the value returned.):
- Q|q, exit rigctl
- Exit rigctl in interactive mode.
When rigctl is controlling the rig directly, will close the rig backend andport. When rigctl is connected to rigctld (rig model 2), the TCP/IP connectionto rigctld is closed and rigctld remains running, available for another TCP/IPnetwork connection.
- F, set_freq 'Frequency'
- Set 'Frequency', in Hz.
- f, get_freq
- Get 'Frequency', in Hz.
- M, set_mode 'Mode' 'Passband'
- Set 'Mode': USB, LSB, CW, CWR, RTTY, RTTYR, AM, FM, WFM, AMS,PKTLSB, PKTUSB, PKTFM, ECSSUSB, ECSSLSB, FAX, SAM, SAL, SAH, DSB.
Set 'Passband' in Hz, or '0' for the Hamlib backend default.
N.B. Passing a '?' (query) as the first argument instead of 'Mode'will return a space separated list of radio backend supported Modes. Usethis to determine the supported Modes of a given radio backend.
- m, get_mode
- Get 'Mode' 'Passband'.
Returns Mode as a string from set_mode aboveand Passband in Hz.
- V, set_vfo 'VFO'
- Set 'VFO': VFOA, VFOB, VFOC, currVFO, VFO, MEM, Main, Sub, TX, RX.
In VFO mode only a single VFO parameter is required.
- v, get_vfo
- Get current 'VFO'.
Returns VFO as a string from set_vfo above.
- J, set_rit 'RIT'
- Set 'RIT', in Hz, can be + or -.
A value of '0' resets RIT and *should* turn RIT off. If not, file a bugreport against the Hamlib backend.
N.B This functionality is under transition and in the future willneed to be activated with the set_func command.
- j, get_rit
- Get 'RIT', in Hz.
- Z, set_xit 'XIT'
- Set 'XIT', in Hz can be + or -.
A value of '0' resets XIT and *should* turn XIT off. If not, file a bugreport against the Hamlib backend.
N.B This functionality is under transition and in the future willneed to be activated with the set_func command.
- z, get_xit
- Get 'XIT', in Hz.
- T, set_ptt 'PTT'
- Set 'PTT', 0 (RX), 1 (TX), 2 (TX mic), 3 (TX data).
- t, get_ptt
- Get 'PTT' status.
- 0x8b, get_dcd
- Get 'DCD' (squelch) status, 0 (Closed) or 1 (Open)
- R, set_rptr_shift 'Rptr Shift'
- Set 'Rptr Shift': "+", "-" or something else for none.
- r, get_rptr_shift
- Get 'Rptr Shift'. Returns "+", "-" or "None".
- O, set_rptr_offs 'Rptr Offset'
- Set 'Rptr Offset', in Hz.
- o, get_rptr_offs
- Get 'Rptr Offset', in Hz.
- C, set_ctcss_tone 'CTCSS Tone'
- Set 'CTCSS Tone', in tenths of Hz.
- c, get_ctcss_tone
- Get 'CTCSS Tone', in tenths of Hz.
- D, set_dcs_code 'DCS Code'
- Set 'DCS Code'.
- d, get_dcs_code
- Get 'DCS Code'.
- 0x90, set_ctcss_sql 'CTCSS Sql'
- Set 'CTCSS Sql' tone, in tenths of Hz.
- 0x91, get_ctcss_sql
- Get 'CTCSS Sql' tone, in tenths of Hz.
- 0x92, set_dcs_sql 'DCS Sql'
- Set 'DCS Sql' code.
- 0x93, get_dcs_sql
- Get 'DCS Sql' code.
- I, set_split_freq 'Tx Frequency'
- Set 'TX Frequency', in Hz.
- i, get_split_freq
- Get 'TX Frequency', in Hz.
- X, set_split_mode 'TX Mode' 'TX Passband'
- Set 'TX Mode': AM, FM, CW, CWR, USB, LSB, RTTY, RTTYR, WFM, AMS,PKTLSB, PKTUSB, PKTFM, ECSSUSB, ECSSLSB, FAX, SAM, SAL, SAH, DSB.
The 'TX Passband' is the exact passband in Hz, or '0' for the Hamlibbackend default.
N.B. Passing a '?' (query) as the first argument instead of 'TX Mode'will return a space separated list of radio backend supported TX Modes. Usethis to determine the supported TX Modes of a given radio backend.
- x, get_split_mode
- Get 'TX Mode' and 'TX Passband'.
Returns TX mode as a string from set_split_mode above and TX passband inHz.
- S, set_split_vfo 'Split' 'TX VFO'
- Set 'Split' mode, '0' or '1', and 'TX VFO' from set_vfo above.
- s, get_split_vfo
- Get 'Split' mode, '0' or '1', and 'TX VFO'.
- N, set_ts 'Tuning Step'
- Set 'Tuning Step', in Hz.
- n, get_ts
- Get 'Tuning Step', in Hz.
- U, set_func 'Func' 'Func Status'
- Set 'Func' 'Func Status'.
Func is one of: FAGC, NB, COMP, VOX, TONE, TSQL,SBKIN, FBKIN, ANF, NR, AIP, APF, MON, MN, RF, ARO, LOCK, MUTE, VSC, REV, SQL,ABM, BC, MBC, RIT, AFC, SATMODE, SCOPE, RESUME, TBURST, TUNER, XIT.
Func Status argument is a non null value for "activate", "de-activate"otherwise, much as TRUE/FALSE definitions in C language (true is non-zero andfalse is zero).
N.B. Passing a '?' (query) as the first argument instead of 'Func' willreturn a space separated list of radio backend supported Set functions. Usethis to determine the supported functions of a given radio backend.
- u, get_func 'Func'
- Get 'Func Status'.
Returns 'Func Status' as a non null value for the 'Func' passed.
N.B. Passing a '?' (query) as the first argument instead of 'Func' willreturn a space separated list of radio backend supported Get functions. Usethis to determine the supported functions of a given radio backend.
- L, set_level 'Level' 'Level Value'
- Set 'Level' 'Level Value'.
Level is one of: PREAMP, ATT, VOX, AF, RF, SQL, IF, APF, NR, PBT_IN, PBT_OUT,CWPITCH, RFPOWER, MICGAIN, KEYSPD, NOTCHF, COMP, AGC (0:OFF, 1:SUPERFAST,2:FAST, 3:SLOW, 4:USER, 5:MEDIUM, 6:AUTO), BKINDL, BAL, METER, VOXGAIN,ANTIVOX, SLOPE_LOW, SLOPE_HIGH, RAWSTR, SWR, ALC, STRENGTH.
The Level Value can be a float or an integer.
N.B. Passing a '?' (query) as the first argument instead of 'Level' willreturn a space separated list of radio backend supported Set levels. Usethis to determine the supported levels of a given radio backend.
- l, get_level 'Level'
- Get 'Level Value'.
Returns 'Level Value' as a float or integer for the 'Level' passed.
N.B. Passing a '?' (query) as the first argument instead of 'Level' willreturn a space separated list of radio backend supported Get levels. Usethis to determine the supported levels of a given radio backend.
- P, set_parm 'Parm' 'Parm Value'
- Set 'Parm' 'Parm Value'
Parm is one of: ANN, APO, BACKLIGHT, BEEP, TIME, BAT, KEYLIGHT.
N.B. Passing a '?' (query) as the first argument instead of 'Parm' willreturn a space separated list of radio backend supported Set parameters. Usethis to determine the supported parameters of a given radio backend.
- p, get_parm 'Parm'
- Get 'Parm Value'.
Returns 'Parm Value' as a float or integer for the 'Parm' passed.
N.B. Passing a '?' (query) as the first argument instead of 'Parm' willreturn a space separated list of radio backend supported Get parameters. Usethis to determine the supported parameters of a given radio backend.
- B, set_bank 'Bank'
- Set 'Bank'. Sets the current memory bank number.
- E, set_mem 'Memory#'
- Set 'Memory#' channel number.
- e, get_mem
- Get 'Memory#' channel number.
- G, vfo_op 'Mem/VFO Op'
- Perform 'Mem/VFO Op'.
Mem VFO operation is one of: CPY, XCHG, FROM_VFO, TO_VFO, MCL, UP, DOWN,BAND_UP, BAND_DOWN, LEFT, RIGHT, TUNE, TOGGLE.
N.B. Passing a '?' (query) as the first argument instead of 'Mem/VFO Op'will return a space separated list of radio backend supported Set Mem/VFO Ops.Use this to determine the supported Mem/VFO Ops of a given radio backend.
- g, scan 'Scan Fct' 'Scan Channel'
- Perform 'Scan Fct' 'Scan Channel'.
Scan function/channel is one of: STOP, MEM, SLCT, PRIO, PROG, DELTA, VFO, PLT.
N.B. Passing a '?' (query) as the first argument instead of 'Scan Fct'will return a space separated list of radio backend supported Scan Functions.Use this to determine the supported Scan Functions of a given radio backend.
- H, set_channel 'Channel'
- Set memory 'Channel' data. Not implemented yet.
- h, get_channel
- Get memory 'Channel' data. Not implemented yet.
- A, set_trn 'Transceive'
- Set 'Transceive' mode (reporting event): OFF, RIG, POLL.
N.B. Passing a '?' (query) as the first argument instead of 'Transceive'will return a space separated list of radio backend supported Scan Transceivemodes. Use this to determine the supported Transceive modes of a given radiobackend.
- a, get_trn
- Get 'Transceive' mode (reporting event) as in set_trn above.
- Y, set_ant 'Antenna'
- Set 'Antenna' number (0, 1, 2, ..).
- y, get_ant
- Get 'Antenna' number (0, 1, 2, ..).
- *, reset 'Reset'
- Perform rig 'Reset'.
0 = None, 1 = Software reset, 2 = VFO reset, 4 = Memory Clear reset, 8 = Masterreset. Since these values are defined as a bitmask in rig.h, it should bepossible to AND these values together to do multiple resets at once, if thebackend supports it or supports a reset action via rig control at all.
- b, send_morse 'Morse'
- Send 'Morse' symbols.
- 0x87, set_powerstat 'Power Status'
- Set power On/Off/Standby 'Power Status'.
0 = Power Off, 1 = Power On, 2 = Power Standby. Defined as a bitmask in rig.h.
- 0x88, get_powerstat
- Get power On/Off/Standby 'Power Status' as in set_powerstat above.
- 0x89, send_dtmf 'Digits'
- Set DTMF 'Digits'.
- 0x8a, recv_dtmf
- Get DTMF 'Digits'.
- _, get_info
- Get misc information about the rig (no VFO in 'VFO mode' or value is passed).
- 1, dump_caps
- Not a real rig remote command, it just dumps capabilities, i.e. what thebackend knows about this model, and what it can do.
TODO: Ensure this is in a consistent format so it can be read into a hash,dictionary, etc. Bug reports requested.
N.B.: This command will produce many lines of output so be very carefulif using a fixed length array! For example, running this command against theDummy backend results in over 5kB of text output.
VFO parameter not used in 'VFO mode'.
- 2, power2mW 'Power [0.0..1.0]' 'Frequency' 'Mode'
- Returns 'Power mW'
Converts a Power value in a range of 0.0 ... 1.0 to the real transmitpower in milli-Watts (integer). The frequency and mode also need tobe provided as output power may vary according to these values.
VFO parameter not used in 'VFO mode'.
- 4, mW2power 'Power mW' 'Frequency' 'Mode'
- Returns 'Power [0.0..1.0]'
Converts the real transmit power in milli-Watts (integer) to a Power value ina range of 0.0 ... 1.0. The frequency and mode also need tobe provided as output power may vary according to these values.
VFO parameter not used in 'VFO mode'.
- w, send_cmd 'Cmd'
- Send raw command string to rig. This is useful for testing and troubleshootingrig commands and responses when developing a backend.
For binary protocols enter values as \0xAA\0xBB. Expect a 'Reply' from therig which will likely be a binary block or an ASCII string depending on therig's protocol (see your radio's computer control documentation).
The command terminator, set by the send-cmd-term option above, willterminate each command string sent to the radio. This character should not bea part of the input string.
- pause 'Seconds'
- Pause for the given whole number of seconds before sending the next command.
for a Yaesu FT-920 using a USB to serial adapter on Linux ininteractive mode:
$ rigctl -m 114 -r /dev/ttyUSB1
Start rigctl for a Yaesu FT-920 using COM1 on Win32 while generatingTRACE output to stderr:
$ rigctl -m 114 -r COM1 -vvvvv
Start rigctl for a Yaesu FT-920 using a USB to serial adapter whilesetting baud rate and stop bits:
$ rigctl -m 114 -r /dev/ttyUSB1 -s 4800 -C stop_bits=2
Start rigctl for an Elecraft K3 using a USB to serial adapter whilespecifying a command terminator for the 'w' command:
$ rigctl -m 229 -r /dev/ttyUSB0 -t';'
Connect to a running rigctld with rig model 2 ("NET rigctl") on thelocal host and specifying the TCP port, setting frequency and mode:
$ rigctl -m 2 -r localhost:4532 F 7253500 M LSB 0
If Readline library development files are found at configure time, rigctl
will be conditonally built with Readline support for command and argument entry.Readline command key bindings are at their defaults as described in the Readlinemanual (http://cnswww.cns.cwru.edu/php/chet/readline/rluserman.html
sets the name 'rigctl' which can be used in ConditionalInit Constructs in the Readline Init File ('~/.inputrc' by default) for customkeybindings unique to rigctl
Command history is available with Readline support as described in the ReadlineHistory manual(http://cnswww.cns.cwru.edu/php/chet/readline/history.html#SEC1). Commandand argument strings are stored as single lines even when arguments are promptedfor input individually. Commands and arguments are not validated and are storedas typed with values separated by a single space.
Normally session history is not saved, however, use of either of the-i/--read-history or -I/--save-history options when startingrigctl will cause any previously saved history to be read in and/or thecurrent and any previous session history (assuming the -i and -I options aregiven together) will be written out when rigctl is closed. Each option ismutually exclusive, i.e. either may be given separately or in combination. Thisis useful to save a set of commands and then read them later but not write themodified history for a consistent set of test commands in interactive mode, forexample.
History is stored in '~/.rigctl_history' by default although the destinationdirectory may be changed by setting the RIGCTL_HIST_DIR environment variable.When RIGCTL_HIST_DIR is unset, the value of the HOME environment variable isused instead. Only the destination directory may be changed at this time.
If Readline support is not found at configure time the original internal commandhandler is used. Readline is not used for rigctl commands entered on thecommand line regardless if Readline support is built in or not.
N.B. Readline support is not included in the Windows 32 binary buildssupplied by the Hamlib Project. Running rigctl on the Windows 32 platformin the 'cmd' shell does give session command line history, however, it is notsaved to disk between sessions.
option allows different levels of diagnosticsto be output to stderr
and correspond to -v for BUG, -vv for ERR,-vvv for WARN, -vvvv for VERBOSE, or -vvvvv for TRACE.
A given verbose level is useful for providing needed debugging information tothe email address below. For example, TRACE output shows all of the valuessent to and received from the radio which is very useful for radio backendlibrary development and may be requested by the developers.
0 if all operations completed normally;
1 if there was an invalid command line option or argument;
2 if an error was returned by Hamlib
set_chan has no entry method as of yet, hence left unimplemented.
This almost empty section...
Report bugs to <hamlib-developerAATTlists.sourceforge.net>.
We are already aware of the bugs in the previous section :-)
Written by Stephane Fillod, Nate Bargmann, and the Hamlib Group
Copyright © 2000-2011 Stephane Fillod
Copyright © 2010-2013 Nate Bargmann
Copyright © 2000-2010 the Hamlib Group.
This is free software; see the source for copying conditions.There is NO warranty; not even for MERCHANTABILITYor FITNESS FOR A PARTICULAR PURPOSE.
- EXIT STATUS
- REPORTING BUGS
- SEE ALSO
This document was created byman2html,using the manual pages.