Rechercher une page de manuel
rigctld
Langue: en
Version: January 14, 2009 (debian - 07/07/09)
Section: 8 (Commandes administrateur)
Sommaire
NAME
rigctld - Hamlib rig control daemonSYNOPSIS
rigctld [OPTION]...DESCRIPTION
The rigctld program is an EXPERIMENTAL Hamlib rig daemon that handles TCP client requests. This allows multiple user programs to share one radio. Multiple radios can be controlled on different TCP ports. The syntax of the commands are the same as rigctl. It is hoped that rigctld will be especially useful for languages such as Perl, Python, and others.rigctld communicates to a client through a TCP socket using text commands shared with rigctl. The protocol is simple, commands are sent to rigctld on one line and rigctld responds to "get" commands with the requested values, one per line, when successful, otherwise, it responds with one line "RPTR x", where x is a negative number indicating the error code. Commands that do not return values respond with the line "RPTR x", where x is zero when successful, otherwise is a regative number indicating the error code. Each line is terminated with a newline '\n' character.
Keep in mind that Hamlib is BETA level software. While a lot of backend libraries lack complete rig support, the basic functions are usually well supported. The API may change without publicized notice, while an advancement of the minor version (e.g. 1.1.x to 1.2.x) indicates such a change.
Please report bugs and provide feedback at the e-mail address given in the REPORTING BUGS section. Patches and code enhancements are also welcome.
OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes ('-').Here is a summary of the supported options:
- -m, --model=id
- Select radio model number. See -l, "list" option below.
- -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.
- -p, --ptt-file=device
- Use device as the file name of the Push-To-Talk device using a device file as described above.
- -d, --dcd-file=device
- Use device as the file name of the Data Carrier Detect device using a device file as described above.
- -P, --ptt-type=type
- Use type of Push-To-Talk device. Supported types are RIG (CAT command), DTR, RTS, PARALLEL, NONE.
- -D, --dcd-type=type
- Use type of Data Carrier Detect device. Supported types are RIG (CAT command), DSR, CTS, CD, PARALLEL, NONE.
- -s, --serial-speed=baud
- Set serial speed to baud rate. Uses maximum serial speed from rig backend capabilities (set by -m above) as the default.
- -c, --civaddr=id
- Use id as the CI-V address to communicate with the rig. Only useful for Icom rigs.
NB: The id is in decimal notation, unless prefixed by 0x, in which case it is hexadecimal. - -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. --set-conf=stop_bits=2
Use -L option for a list. - -e, --end-marker
- Use END marker in rigctld protocol.
- -t, --port=number
- Use number as the TCP listening port. The default is 4532.
- -T, --listen-addr=IPADDR
- Use IPADDR as the listening IP address. The default is ANY.
- -l, --list
- List all model numbers defined in Hamlib and exit.
- -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 appropriate command. Otherwise, VFO_CURR is assumed when this option is not set.
- -v, --verbose
- Set verbose mode, cumulative (see DIAGNOSTICS below).
- -h, --help
- Show a summary of these options and exit.
- -V, --version
- Show the version of rigctld and exit.
N.B. Some options may not be implemented by a given backend and will return an error. This is most likely to occur with the --set-conf and --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
Commands can be sent over the TCP socket either as a single char, or as a long command name plus the value(s) on one '\n' terminated line. See PROTOCOL.Since most of the Hamlib operations have a set and a get method, an upper case letter will be used for set method whereas the corresponding lower case letter refers to the get method. Each operation also has a long name, prepend a backslash to send a long command name.
Example (Perl): `print $socket "\\dump_caps\n";' to see what the radio's backend can do.
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 message.
Here is a summary of the supported commands:
- F, set_freq
- Set frequency, in Hz.
- f, get_freq
- Get frequency, in Hz.
- M, set_mode
- Set mode/passband: AM, FM, CW, CWR, USB, LSB, RTTY, RTTYR, WFM, AMS, PKTLSB, PKTUSB, PKTFM, ECSSUSB, ECSSLSB, FAX, SAM, SAL, SAH, DSB.
The passband is the exact passband in Hz, or 0 for the default.
- m, get_mode
- Get mode/passband.
- V, set_vfo
- Set VFO: VFOA, VFOB, VFOC, currVFO, VFO, MEM, Main, Sub, TX, RX.
- v, get_vfo
- Get current VFO.
- J, set_rit
- Set RIT, in Hz.
- j, get_rit
- Get RIT, in Hz.
- Z, set_xit
- Set XIT, in Hz.
- z, get_xit
- Get XIT, in Hz.
- T, set_ptt
- Set PTT, 0 (RX) or 1 (TX).
- t, get_ptt
- Get PTT status.
- get_dcd
- Get DCD status.
- R, set_rptr_shift
- Set repeater shift: "+", "-" or something else for none.
- r, get_rptr_shift
- Get repeater shift.
- O, set_rptr_offs
- Set repeater offset, in Hz.
- o, get_rptr_offs
- Get repeater offset.
- C, set_ctcss_tone
- Set CTCSS tone, in tenth of Hz.
- c, get_ctcss_tone
- Get CTCSS tone, in tenth of Hz.
- D, set_dcs_code
- Set DCS code.
- d, get_dcs_code
- Get DCS code.
- set_ctcss_sql
- Set CTCSS squelch tone, in tenth of Hz.
- get_ctcss_sql
- Get CTCSS squelch tone, in tenth of Hz.
- set_dcs_sql
- Set DCS squelch code.
- get_dcs_sql
- Get DCS squelch code.
- I, set_split_freq
- Set TX frequency, in Hz.
- i, get_split_freq
- Get TX frequency.
- X, set_split_mode
- Set transmit mode/passband: AM, FM, CW, CWR, USB, LSB, RTTY, RTTYR, WFM, AMS, PKTLSB, PKTUSB, PKTFM, ECSSUSB, ECSSLSB, FAX, SAM, SAL, SAH, DSB.
The passband is the exact passband in Hz, or 0 for the default.
- x, get_split_mode
- Get transmit mode/passband.
- S, set_split_vfo
- Set split mode, 0 or 1, and transmit VFO.
- s, get_split_vfo
- Get split mode and transmit VFO.
- N, set_ts
- Set tuning step, in Hz.
- n, get_ts
- Get tuning step.
- U, set_func
- Set func/status: FAGC, NB, COMP, VOX, TONE, TSQL, SBKIN, FBKIN, ANF, NR, AIP, APF, MON, MN, RF, ARO, LOCK, MUTE, VSC, REV, SQL, ABM, BC, MBC, AFC, SATMODE, SCOPE, RESUME, TBURST, TUNER.
- u, get_func
- Get func status.
- L, set_level
- Set level/value: PREAMP, ATT, VOX, AF, RF, SQL, IF, APF, NR, PBT_IN, PBT_OUT, CWPITCH, RFPOWER, MICGAIN, KEYSPD, NOTCHF, COMP, AGC, BKINDL, BAL, METER, VOXGAIN, ANTIVOX. SLOPE_LOW, SLOPE_HIGH, RAWSTR, SQLSTAT, SWR, ALC, STRENGTH.
- l, get_level
- Get level value.
- P, set_parm
- Set parm/value: ANN, APO, BACKLIGHT, BEEP, TIME, BAT, KEYLIGHT.
- p, get_parm
- Get parm value.
- B, set_bank
- Set bank.
- E, set_mem
- Set memory channel number.
- e, get_mem
- Get memory channel number.
- G, vfo_op
- Perform VFO operation: CPY, XCHG, FROM_VFO, TO_VFO, MCL, UP, DOWN, BAND_UP, BAND_DOWN, LEFT, RIGHT, TUNE, TOGGLE.
- g, scan_op
- Perform scan operation/channel: STOP, MEM, SLCT, PRIO, PROG, DELTA, VFO, PLT.
- H, set_channel
- Set memory channel data. Not implemented yet.
- h, get_channel
- Get memory channel data.
- A, set_trn
- Set transceive mode (reporting event): OFF, RIG, POLL.
- a, get_trn
- Get transceive mode (reporting event).
- Y, set_ant
- Set antenna number (0, 1, 2, ..).
- y, get_ant
- Get antenna number (0, 1, 2, ..).
- *, reset
- Reset.
- b, send_morse
- Send morse symbols.
- 0x87, set_powerstat
- Set power status.
- 0x88, get_powerstat
- Get power status.
- 0x89, send_dtmf
- Set DTMF digits.
- 0x8a, recv_dtmf
- Get DTMF digits.
- _, get_info
- Get misc information about the rig.
- 1, dump_caps
- Not a real rig remote command, it just dumps capabilities, i.e. what the backend 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.
- 2, power2mW
- Converts a power value in a range of 0.0 ... 1.0 to the real transmit power in milli-Watts. The frequency and mode also need to be provided as output power may vary according to these values.
- w, send_cmd
- Send raw command string to rig.
For binary protocols enter values as \0xAA\0xBB
EXAMPLES
Start rigctld for a Yaesu FT-920 using an USB-to-serial adapter and backgrounding:$ rigctld -m 114 -r /dev/ttyUSB1 &
Start rigctld for a Yaesu FT-920 using a USB to serial adapter while setting baud rate and stop bits and backgrounding:
$ rigctld -m 114 -r /dev/ttyUSB1 -s 4800 -C stop_bits=2 &
Connect to the already running rigctld, and set current frequency to 14.266 MHz:
$ echo "\set_freq 14266000" | nc localhost 4532
PROTOCOL
The rigctld protocol is intentionally simple. Commands are entered on a single line with any needed values. In Perl, reliable results are obtained by terminating each command string with a newline character, '\n'.Example set (Perl code):
print $socket "F 14250000\n";
print $socket "\\set_mode LSB 2400\n"; # escape leading '\'
Responses from rigctld are text values and match the same tokens used in the set commands. Each value is returned on its own line. To signal the end of a response the "END\n" string is sent when the '-e' option is passed.
Example get (Perl code):
print $socket "f\n";
"14250000\n"
"END\n"
Most get functions return one to three values. A notable exception is the dump_caps function which returns many lines of key:value pairs. Future work will focus on making this output compatible with assignment to a hash, dictionary, or other key:value variable.
DIAGNOSTICS
The -v, --version option allows different levels of diagnostics to 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 to the email address below. For example, TRACE output shows all of the values sent to and received from the radio which is very useful for radio backend library development and may be requested by the developers.
SECURITY
No authentication whatsoever; DO NOT leave this TCP port open wide to the Internet. Please ask if stronger security is needed.BUGS
The daemon is not detaching and backgrounding itself.Much testing needs to be done.
REPORTING BUGS
Report bugs to <hamlib-developer@lists.sourceforge.net>.We are already aware of the bugs in the previous section :-)
AUTHORS
Written by Stephane Fillod and the Hamlib Group<http://www.hamlib.org>.
COPYRIGHT
Copyright © 2000-2009 Stephane Fillod and the Hamlib Group.This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
rigctl(1), hamlib(3)Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre