8.5 Hamlib - Using rigctl at the command line
In the above example, to start rigctl, I entered: rigctl -m 1040 -s 38400 -r /dev/ttyAMA0 --vfo
-m 1040 selects the FTdx101D
-s 38400 sets the baudrate
-r /dev/ttyAMA0 selects the RPi serial port connected to the radio's RS232 connector.
( For USB, I would have entered -r /dev/ttyUSB0 )
--vfo selects vfo mode (see --vfo option )
I then entered three commands:
- \set\freq Main 3664000 Sets the main VFO frequency
- \get_freq Main Read the main VFO frequency
- f Main Read the main VFO frequency (short command format)
These commands are rigctl commands. rigctl translates them into the radio's CAT commands.
Using rigctl in configuring a radio
rigctl at the command line allows:
- Testing of commands on the radio
- Examination of responses - eg: to check ranges of returned data.
- List of available command options for the radio
- Testing the use of \send_command_rx for commands not supported by Hamlib.
Checking ranges Example for FTdx101D
The CAT manual says that RF gain is sent and received as R G P1 P2 P2 P2 ;
where P1 = 0 / 1 for Main /Sub and P2 is 000 to 255
Using the Main receiver:
We set RF gain at minimum and send rigctl command \get_level Main RF This returns 0.000.
We set RF gain at maximum and send rigctl command \get_level Main RF This returns 1.000
So the range returned to piWebCAT is 0.000 to 1.000.
In the slidershl table, the min and max fields control the slider range.
We set min = 0.000 and max = 1.000.
piWebCAT will internally automatically scale these returned CAT levels to the working slider range of 0 - 400.
(All sliders have internal HTML range 0 - 400)
Conversely, on user slider action, the slider position 0 - 400 will be sent as 0.000 - 1.000
piWebCAT also displays a numeric value against the slider.
You have a choice. You can configure to display 0.00 - 1.00 0 - 100 0 - 255 or whatever you choose.
The mult, divide and and decpoint fields convert the CAT value (0.000 - 1.000) to the displayed value.
Setting mult = 255 and divide = 1 would display 0.000 - 1.000 as 0 - 255 (the actual rig CAT range)
Setting mult = 100 and divide = 1 and units = "%" would display 0 - 100%
rigctld at the command line
You can also test with rigctld at the command line,
eg, type: rigctld -m 1040 -s 38400 -r /dev/ttyAMA0 --vfo
Then open another terminal window on the RPi and use Telnet:
Enter: telnet 127.0.0.1 4532 This will connect telnet to the rigcrld socket on port 4532.