Net control
From hamlib
(→C/C++ API application support) |
(→C/C++ API application support) |
||
| (5 intermediate revisions not shown) | |||
| Line 8: | Line 8: | ||
The latest additions to the Hamlib network control family are the [http://en.wikipedia.org/wiki/Transmission_Control_Protocol TCP] based '''rigctld''' and '''rotctld''' daemons. The command set used by these daemons are simple text commands sent as ASCII strings. The commands are shared with the '''rigctl''' and '''rotctl''' test programs (with a couple of additions specific to the daemons). These daemons offer the latest in flexibility for applications using Hamlib. | The latest additions to the Hamlib network control family are the [http://en.wikipedia.org/wiki/Transmission_Control_Protocol TCP] based '''rigctld''' and '''rotctld''' daemons. The command set used by these daemons are simple text commands sent as ASCII strings. The commands are shared with the '''rigctl''' and '''rotctl''' test programs (with a couple of additions specific to the daemons). These daemons offer the latest in flexibility for applications using Hamlib. | ||
| + | |||
| + | For complete documentation of the command line options and control commands for the daemons, see the [https://sourceforge.net/apps/mediawiki/hamlib/index.php?title=Documentation Hamlib Utilities section] of the documentation page. The files are PDFs for ease of viewing and printing. | ||
As with the RPC based daemons, the TCP daemons allow connections from multiple applications simultaneously. For example, here at N0NB I am using Fldigi and CQRlog with '''rigctld'''. | As with the RPC based daemons, the TCP daemons allow connections from multiple applications simultaneously. For example, here at N0NB I am using Fldigi and CQRlog with '''rigctld'''. | ||
| Line 17: | Line 19: | ||
For an application user, setup is easily done by these steps: | For an application user, setup is easily done by these steps: | ||
| - | * Start rigctld/rotctld | + | * Start rigctld/rotctld (e.g. 'rigctld -m 229 -r /dev/ttyUSB0 &' Selects rig model K3, using the first USB to serial adapter on the system, and then backgrounding the rigctld process. Baud rate and stop bits use the K3 backend defaults of 38400 and 1, repesctively.) |
* Configure the application to use '''Net rigctl''' or '''NET rotctl''' | * Configure the application to use '''Net rigctl''' or '''NET rotctl''' | ||
* Enter the hostname:port as the Device | * Enter the hostname:port as the Device | ||
| Line 26: | Line 28: | ||
Fldigi: | Fldigi: | ||
| - | [[File:Fldigi- | + | [[File:Fldigi-hamlib-prefs.png]] |
CQRlog: | CQRlog: | ||
Current revision as of 13:24, 4 October 2011
Contents |
Network rig control with Hamlib
While Hamlib has been primarily used by C and C++ programs, the ability to control a device via a network connection is an integral part of Hamlib. There are two means of network control, via RPC and via TCP sockets.
TCP
The latest additions to the Hamlib network control family are the TCP based rigctld and rotctld daemons. The command set used by these daemons are simple text commands sent as ASCII strings. The commands are shared with the rigctl and rotctl test programs (with a couple of additions specific to the daemons). These daemons offer the latest in flexibility for applications using Hamlib.
For complete documentation of the command line options and control commands for the daemons, see the Hamlib Utilities section of the documentation page. The files are PDFs for ease of viewing and printing.
As with the RPC based daemons, the TCP daemons allow connections from multiple applications simultaneously. For example, here at N0NB I am using Fldigi and CQRlog with rigctld.
C/C++ API application support
With the addition of the ctld daemons, applications coded to the Hamlib C/C++ API are not prevented from accessing the ctld daemons. Incorporated into the list of rig and rotor backends are NET rigctl and NET rotctl, rig/rot model 2 respectively.
For an application user, setup is easily done by these steps:
- Start rigctld/rotctld (e.g. 'rigctld -m 229 -r /dev/ttyUSB0 &' Selects rig model K3, using the first USB to serial adapter on the system, and then backgrounding the rigctld process. Baud rate and stop bits use the K3 backend defaults of 38400 and 1, repesctively.)
- Configure the application to use Net rigctl or NET rotctl
- Enter the hostname:port as the Device
- Baud rate and stop bits are set when starting rigctld--they have no effect when set from the application
Some screenshots will help explain the syntax.
Fldigi:
CQRlog:
Setting the preferences in CQRlog for a K3 using the library interface as Radio 1 and rigctld configuration (also started to control a K3) as Radio 2. Rig model 2 is a special model that allows a program using Hamlib to communicate with a rigctld process. In this case Hamlib handles the network socket protocol on behalf of the application.
CQRlog's TRX Control window showing both library and rigctld configurations.
N.B. Some experimentation of timing parameters (if available) may be necessary to allow multiple programs to share the ctld daemon. For example, with default values Fldigi will poll very aggressively. Setting the Write delay field to some value will slow its polling. While the screen shot above was taken when I was experimenting with 75 mS, higher values may show improvement.
RPC (deprecated)
The RPC method is the older of the Hamlib network daemons and has been used to share a single device between multiple applications. The daemon for radio control is rpc.rigd and the daemon for rotor control is rpc.rotd. This allows the rpc.* daemon to be running on a computer that is attached to the device and the user app(s) with another instance of Hamlib to be on the same or another network attached computer.
rpc.rigd/rpc.rotd usage notes
- Use rig model 1901 for rpc.rigd
- Use rotor model 101 for rpc.rotd



