2.9  Learning guide:  Hamlib  - rigctl   rigctld

Hamlib is supplied ready installed on the micro SD card.

Hamlib is 12 years old but is still steadily improving and evolving.
This is particularly so for new radios where there may be bugs in the system.

I developed piWebCAT on the FTdx101D, IC700 and then FT920.
Then I discovered Hamlib. The Hamlib FTdx101D interface was very new and full of bugs.

I needed it to work properly for piWebCAT.
Michael Black, W9MDB was doing much of the development ... and he needed it work properly.

So we worked together for while over the internet to fix all the problems.

I downloaded his latest Hamlib code many times.

Section 14.5 describes how to do this:  14.5  Installing / updating Hamlib on the SD card

You need the Hamlib code for your radio.  

My configurations show 3060 for the IC7000 and 1040 for the FTdx101D).
Go to the RPi terminal window and enter rigctl -l (lower case L).
This will list all the radios and their codes.  Make a note of your radio's Hamlib code.

Hamlib rigctl and rigctld  - documentation   -commands


Download this from the following URL and print it for easy reference.


You will see references to rigctl and rigctld.

A detailed explanation of using Hamlib with piWebCAT is given in sections 8  
See  section 8.1  Hamlib - introduction   and 8.2 onwards


The connections to the radio via the rigctl API (Application Programming Interface)
rigctl translates its generic CAT commands into the corresponding commands for the selected radio.
eg: For a rig DNR (Digital Noise Reduction) level of 7

 Yaesu FTdx101D   DNR range 1 to 15        CAT  = RL007;   
 Icom IC7000         DNR range 0 to 15   CAT = 0xFE 0xFE 0x70 0xE0 0x1A 0x05 0x01 0x14 0x07 0xFD 

rigctl:   \set_level NR VFOA  0.5  (--vfo mode)   or     \set_level NR 0.5  (non --vfo mode)

 (range is  0.000 - 1.000)   translates to DNR = 7:  

The use of --vfo mode is discuused in the following section

rigctl commands can be tested in the RPi terminal window

You activate this at the command prompt by:  rigctl -m 1040 -s 38400 -r /dev/ttyUSB0 --vfo

  • 1040 is the Hamlib radio code  (FTdx101D in this case)
  • 38400 is the baud rate as set on the radio
  • /dev/ttyUSB0 is the connection for USB ( or /dev/ttyAMA0 for serial connection)
  • --vfo enables VFO mode  which I have used in the three piWebCAT configurations.

You can then enter rigctl commands as documented in the manual.
All the commands have a long and a short form. The long form must be prefixed by \ .

Try the activation command with your radio and baudrate.

Then enter:  \set_freq VFOA 3730000   to set a frequency  (short form is F VFOA 3730000 )


rigctld is the rigctld interface to which piWebCAT connects.
It provides a socket to which server PHP code can connect and send the rigctl commands.
You don't have to deal with it. You just set up the correct codes in the configuration database.

VFOA / VFOB  or  Main / Sub   Transceivers-H-A, B and C - modern Yaesu rigs.

A progression of three developing learning configurations is supplied for dual vfo / dual receiver transceivers

which are supported by Hamlib   --vfo mode.

They are Transceiver-H-A,  Transceiver-H-B and Transceiver-H-C.

These three learning configurations in --vfo mode are supplied with VFOs specified as  VFOA and VFOB.

They were developed using my FTdx1010D.

The FTdx101D (and some other modern Yaesu rigs) use Main / SUB rather than VFOA / VFOB.

In the FTdx101D,  only the \set_vfo and \get_vfo commands were found to be critical in this respect.

Because of this, the VFOA and VFOB parameters for the these commands in the buttonshl table
were temporarily replaced with Main and Sub.

They have been changed back to VFOA / VFOB before issuing the SD card

If you want to use these three Hamlib configurations with a modern Yaesu rig, then please use
MySQL Front to run the supplied SQL script: VFOA_VFOB_to_Main_Sub_Hamlib.sql.

The script operates on tables:   buttonshl, catcodeshl, slidershl and meterhl.

You need to edit the script (eg: with Notepad) to change the rig name.

You would need to run the script on each of Transceiver-H-A, Transceiver-H-B and Transceiver-H-C
 (editing the name for each one of these).

See section 3.14  MySQL commands and scripts   Section 3.15 Useful MySQL scripts