3.2  piWebCAT  - configuration systems.


Development

piWebCAT was first developed on a FTdx101D which used ascii text based CAT commands.
This ASCII system is applicable to those radios with text based CAT commands.

Support was then added for Icom CI-V  ( CIV ) and for the earlier Yaesu radios which have a

5 byte command system  ( YAESU5 ).
These systems allow the user to build a configuration data set using the radio's CAT manual.
Not all available radios are supported.


I then discovered Hamlib, which had been under gradual development for 10 years.

Hamlib translates a common set of commands into CAT commands for your selected radio.

There are 250 supported radios in the Hamlib database. Each is simply selected by number.

eg: If FTdx101D (#10400) is selected, then \set_freq Main 3744000  will translate to FA003744000;


I initially developed Hamlib support using my IC7000.

Then I added the FTdx101D. My database radio list now has FTdx101D and FTdx101D-H (Hamlib).

The FTdx101D had just been added (mid 2020) in Hamlib version 4.0. I think that it had been done
from the CAT manual. It had a lot of bugs.
Much of the development had been done by Michael Black, W9MDB.
There was mutual benefit. I developed a fully working FTdx101d-H configuration and at the same time
provided an    FTdx101D testbed to help correct all the issues in the Hamlib FTdx101D API.

piWebCAT's existing structure provided an excellent real world CAT development environment.


Hamlib's commands are text -based and so the development was a modification of the already
fully developed ASCII system. It was developed after the other systems and so is presented here
after the other systems.

References are made to the ASCII system. Some familiarity with the ASCII system is useful.


So we now have four configuration options:  ASCII, CIV, YAESU5 and HAMLIB.



ASCII character based system


piWebCAT was first developed using my Yaesu FTdx101D radio.


This uses character based commands which can be freely typed in to the editor fields as text.


eg:  RL012;   = set noise reduction level 0 (VFO A) to 12.


This command system is easy to understand and configure.


CIV  - Icom CI-V


I then developed a configuration interface for Icom CI-V CAT control using my Icom IC7000.

CI-V is based on hexadecimal and binary coded decimal (BCD) commands.

It required a dedicated configuration interface.
The same system is used in modern Icom radios but with different codes.

I have not applied it to a modern Icom radio - because I do not currently have access to one.
The intention is than the user can use and modify my IC7000 configuration.



YAESU5  -  earlier Yaesu radios ( FT847, F818, FT1000MP, FT920)

These radios use a 5 byte command format which is hexadecimal and binary coded decimal.

All outgoing commands are five bytes in length.

Data is returned from the radio in a variety of formats, with lengths from 1 to 28 bytes.


I support these radios using my existing text based configuration system:

The outgoing commands are specified in 10 characters of readable text which is converted

in the RPi web server to five data bytes for transmission to the radio.


Returned data is parsed using an answermask such as:    #28:21:01:07:xx

This means: receive 28 bytes, At byte 21 read 01 byte and mask it with hex07 (= bits 0,1,and 2)


This is how you have to read operating mode data for VFO B on a Yaesu FT920 transceiver.

Complex .. yes .. but I have tried to make a readable and easy to interpret user configuration interface.

I initially had this working with my Yaesu FT847, which has a very limited command set.

I then purchased a second hand FT920 which supports many more commands.

( ..or should I say that it did so when I had replaced the fried MAX232CWE  RS232 interface chip!!.)


The Yaesu5 system is presented as as add-on to the ASCII system .... which you need to look at first.


HAMLIB  - control API for radios and rotators

Hamlib translates a common set of commands into CAT commands for your selected radio.

There are 250 supported radios in the Hamlib database. Each is simply selected by number.


The latest Hamlib update is published on https://github.com/Hamlib/Hamlib.

The source code is downloaded to your RPi for initial install or update.
Compilation and installation are straightforward and detailed in this document.
With ongoing development, particularly with new radios, updates can frequently be on a daily basis.

Hamlib is installed on the downloaded RPi SD card image.


piWebCAT uses rigctl and rigctld.


rigctl is a command line facility that can be used to issue single CAT commands from the RPi terminal.

To open the connection to the rig, the typical syntax is:


  $   rigctl -m 1040   -s 38400 -r /dev/ttyAMA0 --vfo       


1040 is the Hamlib id of FTdx101D. 38400 is the baudrate.     --vfo is to set dual VO mode

/dev/ttyAMA0 is piWebCAT's configured serial port   (or use /dev/ttyUSB0  for a USB conection)

The response is:    Rig command:


You can then enter rigctl commands, eg  \set_level Main NR 0.4
These will be translated to FTdx101D commands and sent to the rig.

This is a very useful way of testing Hamlib commands before configuring them into piWebCAT.


rigctld is used by piWebCAT


It is started by piWebCAT at startup and provides a serial TCP socket on   localhost:4532.

piWebCAT's PHP webserver code then sends rigctld commands to this socket.


Unsupported commands:  Not all of a radio's hundreds of less frequently used CAT commands are supported.
To deal with this, rigctl has a \send_cmd_rx command whereby you can send the radio's actual CAT command.


eg:   For FTdx101D   For full/semi-breakin switching, I use  \send_cmd_rx EX020111#; 0
                                                                                                             (# = 1 for full, 0 for semi)