FRStack WebAPI Service

Version 3.1.30

This version of FRStack provides REST APIs for RADIO, SLICE, UDP, PGXL AMP, SPE AMP, SteppIR Control
See how Node-Red users are leveraging FRStackWebApis by visiting nodered-hamradio on groups.io


Table of Contents

Version History
Upgrade .NET RPi or Linux
Install .NET RPi or Linux
Install .NET OSX

Install NodeRed
Run NodeRed RPi
Run NodeRed Ubuntu
Install NodeRed Libs

Upgrade FRStack Web APIs RPi
Install FRStack Web APIs RPi
Install FRStack Web APIs OSX

FRStack Web APIs Commandline run
FRStack Web APIs Service
FRStack Web APIs Service second instance

FRStackWebApi Configuration

RPi3 / RPi4 GPIO

FRStackWebApi APIs



Download links

Raspberry PI Version
Raspberry PI 64bit Version
Linux Version
OSX Version


Version History

V3.1.31.60 (OSX, Linux, RPi)

V3.1.30.59 (OSX, Linux, RPi)

V3.1.27.57 (OSX, Linux, RPi)

V3.1.26.54 (OSX, Linux, RPi)

V3.1.25.53 (OSX, Linux, RPi)

V3.1.25.52 (OSX, Linux, RPi)

V3.1.24.50 (RPi only)

V3.1.23.48 (OSX, Linux, RPi)

V3.1.20.10

V3.1.19.9

V3.1.18.8

V3.1.16.7

V3.1.16.2

Upgrade to .NET Core 5.0 on RPi or Linux

If you are installing this service for the first time then advance to Install .NET Core 5.0

# remove the link to DotNet version 3
sudo rm /usr/bin/dotnet

# rename dotnet version 3 folder
sudo mv /opt/dotnet /opt/dotnet3

# now follow install instructions for **.NET Core 5.0**
# if you don't plan to use dotnet3 then you can remove the folder and files


Install .NET Core 5.0.5 on RPi or Linux

# You should be in your download folder: cd ~/Downloads/

wget <the dot net core download for your device>

# The following website has this info. https://dotnet.microsoft.com/download/dotnet/5.0

# Here is the current one for ARM32 devices
# https://download.visualstudio.microsoft.com/download/pr/254a9fbb-e834-470c-af08-294c274a349f/ee755caf0b8a801cf30dcdc0c9e4273d/aspnetcore-runtime-5.0.5-linux-arm.tar.gz

# Here is the current one for Linux x64 devices
# https://download.visualstudio.microsoft.com/download/pr/3acd1792-c80d-4336-8ffc-552776a1297c/08af3aa6f51d6e8670bb422b6bec5541/aspnetcore-runtime-5.0.5-linux-arm64.tar.gz
# https://download.visualstudio.microsoft.com/download/pr/827b12a8-8dea-43da-92a2-2d24c4936236/d2d61b3ed4b5ba3f682de3e04fc4d243/aspnetcore-runtime-5.0.5-linux-x64.tar.gz


# From the Downloads folder, execute the following commands:

sudo mkdir -p /opt/dotnet
# for 32bit
sudo tar -zxf aspnetcore-runtime-5.0.3-linux-arm.tar.gz -C /opt/dotnet
# for 64bit
sudo tar -zxf aspnetcore-runtime-5.0.3-linux-arm64.tar.gz -C /opt/dotnet
sudo ln -s /opt/dotnet/dotnet /usr/bin


Install .NET Core 5 on OSX

The FRStackWebApiOsx.ZIP file contains com.mkcmsoftware.FRStackWebApi.plist which goes in the /Library/LaunchDaemon folder. This file assumes you have installed .NET and FRStackWebApi in folder indicated below.

# site to get .NET install script for OSX (if not already installed)
https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script



# modify script file permissions to allow execution
chmod 755 dotnet-install.sh

# install command line to install .NET 5 runtime
./dotnet-install.sh --channel 5.0 --runtime aspnetcore



Install FRStackWebApi on OSX

# Expand FRStackWebApiOsx.ZIP in the /usr/local/frstack
sudo chown root /usr/local/frstack/*
sudo chmod 644 /usr/local/frstack/*

# load daemon
sudo launchctl load /Library/LaunchDaemons/com.mkcmsoftware.FRStackWebApi.plist

# manually start
sudo launchctl start com.mkcmsoftware.frstackwebapi   

# manually stop
sudo launchctl stop com.mkcmsoftware.frstackwebapi   

# force unload daemon
sudo launchctl unload /Library/LaunchDaemons/com.mkcmsoftware.FRStackWebApi.plist

# command to check on daemon process id and exit error code
sudo launchctl list | grep com.mkcm

# open console to view logs
open /System/Applications/Utilities/Console.app
# select log tab on lefthand menu
# look for frstack.log and frstack_err.log



Install Node Red on RPi or Linux (Ubuntu use here)

Your version of RPi Linux may already have Node-Red installed. Check before downloading another copy.

RPi See https://nodered.org/docs/getting-started/raspberrypi

# RPi
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

For Ubuntu V20 you can use the Ubuntu Software Application, search node-red then install.

Default address for Node Red is http://hostname:1880

Running Node Red on RPi

On pi to run node red in terminal use:

node-red

The following commands are provided to work with the service:

node-red-start - this starts the Node-RED service and displays its log output. Pressing Ctrl-C or closing the window does not stop the service; it keeps running in the background
node-red-stop - this stops the Node-RED service
node-red-restart - this stops and restarts the Node-RED service
node-red-log - this displays the log output of the service

If you want Node-RED to run when the Pi is turned on, or re-booted, you can enable the service to autostart by running the command:

sudo systemctl enable nodered.service

To disable the service, run the command:

sudo systemctl disable nodered.service

Running Node Red on Ubuntu

Node-Red is a running service after Snap installation on Ubuntu. If you install outside of snap then use RPi style of commands.

The following commands are provided to work with the service:

sudo snap start node-red - this starts the Node-RED service and displays its log output. Pressing Ctrl-C or closing the window does not stop the service; it keeps running in the background
sudo snap stop node-red - this stops the Node-RED service
sudo snap restart node-red - this stops and restarts the Node-RED service
sudo snap logs node-red - this displays the log output of the service

If you want Node-RED to run when the Pi is turned on, or re-booted, you can enable the service to autostart by running the command:

sudo snap enable node-red

To disable the service, run the command:

sudo snap disable node-red

Now install Node-Red UI library from Manage Palette menu

Upgrading FRStack WebAPI on RPi or Linux

If this is your first install of FRStackWebApi then proceed to Install FRStack WebAPI on RPi or Linux

sudo systemctl stop FRStackWebApi 
sudo mv /usr/local/frstack /usr/local/frstack_old

# now follow install instructions above
# Note: you do not have to perform the Install FRStackWebApi as service since that was already performed in the prior install

# Remember to merge your config changes into the new app.settings file

# now start the new version of the service
sudo systemctl start FRStackWebApi 

Install FRStack WebAPI on RPi or Linux

sudo mkdir -p /usr/local/frstack
cd /usr/local/frstack

# for RPi
sudo wget https://www.mkcmsoftware.com/download/FRStackWebApiRPi.zip
# for RPi 64
sudo wget https://www.mkcmsoftware.com/download/FRStackWebApiRPi64.zip
# for Linux x64
sudo wget https://www.mkcmsoftware.com/download/FRStackWebApiLinux.zip

sudo unzip FRStackWebApiRpi
# to update specific files from ZIP add the name of the file(s) after the ZIP filename
# for example: sudo unzip FRStackWebApiRpi.zip FRStackWebApi.dll frstackNodeRedV108.json

Run FRStack WebAPI from commandline on all OS

cd /usr/local/frstack
dotnet FRStackWebApi.dll --urls "http://*:5025"

Install FRStackWebApi as service on RPi

sudo cp FRStackWebApi.service /lib/systemd/system
sudo systemctl daemon-reload 
sudo systemctl enable FRStackWebApi

Note the FRStackWebApi.service contains the port the API will listen on 5025

[Unit]
Description=FRStack Web APIs
After=network.target
 
[Service]
Type=notify
WorkingDirectory=/usr/local/frstack
ExecStart=/usr/bin/dotnet FRStackWebApi.dll --urls "http://*:5025"
Restart=on-failure
 
[Install]
WantedBy=multi-user.target

Start FRStackWebApi service on RPi

sudo systemctl start FRStackWebApi 

View FRStackWebApi service status on RPi

systemctl status FRStackWebApi

Tail FRStackWebApi service log on RPi

journalctl --unit FRStackWebApi --follow

Stop FRStackWebApi service on RPi

sudo systemctl stop FRStackWebApi 
systemctl status FRStackWebApi 

Cleaning up FRStackWebApi service on RPi

Ensure service is stopped

sudo systemctl stop FRStackWebApi 

Disable the FRStackWebApi service on RPi

sudo systemctl disable FRStackWebApi 

Remove and reload SystemD

sudo rm FRStackWebApi.service /lib/systemd/system/FRStackWebApi.service 
sudo systemctl daemon-reload 

Verify SystemD is no longer aware of the FRStackWebApi service

Empty is what we want here

systemctl --type service |& grep FRStackWebApi

Install second instance of FRStackWebApi as service on RPi

sudo cp FRStackWebApi2.service /lib/systemd/system
sudo systemctl daemon-reload 
sudo systemctl enable FRStackWebApi2

Note the FRStackWebApi2.service contains the port the API will listen on 5026

[Unit]
Description=FRStack Web APIs 2
After=network.target
 
[Service]
Type=notify
WorkingDirectory=/usr/local/frstack2
ExecStart=/usr/bin/dotnet FRStackWebApi.dll --urls "http://*:5026"
Restart=on-failure
 
[Install]
WantedBy=multi-user.target

Note the pattern of additional instances can be continued by changing the suffix of 2 to 3 and so on. The install folder, .service filename, description, working directory and port number will be incremented. The commands are identical except for the suffix of your new instance number. For example FRStackWebApi becomes FRStackWebApi2.





Sample Node Red Script

frstackNodeRedV108.json





FRStackWebApi Configuration

The appSettings.json file contains the startup configuration for the service.

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
      }
    },
  "AllowedHosts": "*",

  "SvcConfig": {
    "AutoConnect": "true",
    "initRadioName": null, // optionally configure the default radio name here to autoconnect to
    "initClientName": null, // optionally configure the default client name to bind to
    "MRUMatchDelta": "0.000999",
    "FollowActiveSlice": "true",
    "MuteOthersOnSliceActive": "true",
    "EnableTxOnSliceActive": "true",
    "TempUnitInF": "true",
    "PgxlTuneStandby": "true", // this will set AMP to STANDBY when TUNE is activated
    "PgxlModeRestore": "true", // this will return AMP to OPERATE after TUNE complete
    "PgxlRadioMaxPower": "50", // this is MAX radio power level when AMP is OPERATE
    "PgxlRadioStandbyPower": "100", // this is MAX radio power level when AMP is STANDBY
    "PGXLOnAntenna": "0", // 0 or 1 or 2; 0 for both, 1 for ANT1, 2 for ANT2
    "RCATXACCTuneDisable": "false", 
    "RCATX1TuneDisable": "false",
    "RCATX2TuneDisable": "false",
    "RCATX3TuneDisable": "false",
    "RadioTuneModeDetect": "false", // this is set true if you want to detect a Radio Tune button push, remember to set TX Delay on radio
    "SPEComPort": "", // this is the Serial device for SPE AMP Control port (Not the CAT port)
    "SPETuneStandby": "false", // this will set SPE to STANDBY when TUNE is activated
    "SPEModeRestore": "false", // this will return SPE to OPERATE after TUNE complete
    "SPEOnAntenna": "0", // 0 or 1 or 2; 0 for both, 1 for ANT1, 2 for ANT2
    "SPEUseDTR": "false", // this will set DTR to power up amp
    "SPEProtocolV1": "false", // this is set true for SPE V1 amps
    "SPEAutoOpen": "false", // this is set true to OPEN SPE after connecting to radio
    "SteppIRComPort": "", // port,baud,parity,stop,FollowAntInt,EnabledBool,SyncManualBool,AntTxInhibitInt,AntennaType eg. "/dev/ttyUSB0,9600,None,One,0,true,true,1,1"
    "FDXProtect": "false,false,false,false,false,false", // enabled,ant1,ant2,rxa,rxb,wide
    "UDPSettings": "false,255.255.255.255,12070,false,127.0.0.1,12071,false,127.0.0.1,12072,false,127.0.0.1,12073", // enabled,IPADDR,PORT, enabled,IPADDR,PORT, enabled,IPADDR,PORT, enabled,IPADDR,PORT 
    "UDPMeterSettings": "false,255.255.255.255,12270,false", // enabled,IPADDR,PORT,SMeterEnabled
    "ModeSetsDax": "0", // 0 - Disable, 1 - turn DAX on when mode is DIGL/H, 2 - turn DAX off if not DIGL/H, 3 - both
    "CustomFunctions": "",
    //
    // Set GPIO Logical Pins by string of numbers 
    // where 0 is not set
    // "1" - Input
    // "2" - Input Pull down
    // "3" - Input Pull up
    // "4" - Output
    // "5" - Output set low on start
    // "6" - Output set high on start
    //   GPIO        0000000000111111111122222222
    //   PINS #s     0123456789012345678901234567
    "GPIOConfig": "", // RPi3 or RPi4 GPIO configuration 
    // MOX In, Out values using GPIO numbers 0-27
    "MOXInOut": "",
    //
    // Sample MOX in on 20 and MOX output on 13
    //   GPIO        0000000000111111111122222222
    //   PINS #s     0123456789012345678901234567
    //"GPIOConfig": "0000000000000500000020000000",
    //"MOXInOut": "20,13" 
    //
    "SliceTrackEnabled": false, // Slice B tracks slice A Freq
    "SliceTrackRev": false // Tracking freq in reverse, ignored if SliceTrackEnabled is false
  }
}

//SteppIRComPort comma delimited settings 
//    COMPort,
//    Baudrate, usually 9600 or 19200
//    Parity, - None, Odd, Even
//    StopBits, - One or Two
//    FollowAntInt, 0 - 8, 0 means TX Slice or 1-8 is for slice letter A thru H for bound client 
//    EnabledBool, - False or True, True means enable this feature
//    SyncManualBool, - False or True, True means manual Freq sync
//    AntTxInhibitInt - 0 - 3, 0 - no TX Inhibit, 1 - ANT1, 2 - ANT2, 3 - Both ANT
//    AntennaType, 0 to 3, 0 = Beam using CAT, 1=Vertical using CAT, 2=Bean no CAT, 3=Vertical no CAT

RPi3 or RPi4 GPIO configuration

For RPi3 and RPi4 Devices you can configure the GPIO pin for use by the GPIO Rest API.

On boot all GPIO are in INPUT mode, GPIO 0-8 have pull-ups to 3V3 enabled, GPIO 9-27 have pull-downs to 0V enabled.

During boot a sequence of optional configurations can set GPIO. See links below:

BCM2835-ARM-Peripherals.pdf
pin-configuration
config-txt GPIO

FRStackAPI appSettings GPIOConfig

Set GPIO Logical Pins by string of numbers

// GPIO        0000000000111111111122222222
// PINS #s     0123456789012345678901234567
"GPIOConfig": "0000022000000500000500000000"

// this sample shows 
// inputs 5 and 6 w/ pull down and 
// outputs 13 and 19 set to low (0) on service start


// This Sample MOX in on 20 and MOX output on 13
//   GPIO        0000000000111111111122222222
//   PINS #s     0123456789012345678901234567
"GPIOConfig": "0000000000000500000020000000",
"MOXInOut": "20,13" 


This link will jump to the GPIO Rest APIs:
GPIO Rest API




FRStackWebApi APIs

FRStack Commands
http://localhost:5025/FRStack/{cmd}?param={val}

FRStack cmd val Parameter
AUTOCONNECT True to enable auto connect to radio, false to disable
DISCONNECT 1 to disconnect radio
CONNECT Nickname or Serial Number of radio to connect with,
or radio number (1 for 1st radio found sorted by nickname)
RADIOS No Param - Returns list of detected 6x00 radio Nicknames to use for CONNECT,
or Param is Nickname or Serial No. for dump of Radio object (for testing)
SLICES No Param - Returns list of Slice Letter(Index) strings for the connected radio,
or Param is Letter(Index) for dump of Slice object (for testing)
MUTEOTHERSONSLICEACTIVE 2 to toggle MUTE OTHERS ON SLICE ACTIVE, 1 or true to enable, 0 or false to disable
ENABLETXONSLICEACTIVE 2 to toggle ENABLE TX ON SLICE ACTIVE, 1 or true to enable, 0 or false to disable
FOLLOWACTIVESLICE 2 to toggle FOLLOW ACTIVE SLICE, 1 or true to enable, 0 or false to disable
MODESETSDAX 0 - Disable, 1 - turn DAX on when mode is DIGL/H, 2 - turn DAX off if not DIGL/H, 3 - both
-XX- Invalid cmd



Radio Commands
http://localhost:5025/Radio/{cmd}?param={val}

Radio cmd val Parameter
INFO returns radio information
ENUMINFO returns radio properties enumeration information
ACC 0 turn off, 1 turn on, other toggle setting
AMCARRIER UP* to increase level, DOWN* to decrease level, or carrier level
AMPOPERATE 0 turn off, 1 turn on, other toggle setting
ATU Param values are START, BYPASS or CLEAR
ATUMEM 0 turn off, 1 turn on, other toggle setting
AUDIOGAIN UP* to increase level, DOWN* to decrease level, or audio level
BINAURAL 0 turn off, 1 turn on, other toggle setting
CLIENT NEXT to switch clients, or set client station name, returns client station name
CLIENTS returns list of clients
CWBREAKIN 0 turn off, 1 turn on, other toggle setting
CWDELAY UP* to increase offset, DOWN* to decrease offset
CWIAMBICMODEA 0 turn off, 1 turn on, other toggle setting
CWIAMBICMODEB 0 turn off, 1 turn on, other toggle setting
CWPITCH UP* to increase offset, DOWN* to decrease offset
CWSIDETONE 0 turn off, 1 turn on, other toggle setting
CWSPEED UP* to increase offset, DOWN* to decrease offset
CWSWAPPADDLES 0 turn off, 1 turn on, other toggle setting
CWX 1 - 12 transmits the CWX Macro
CWXQSK 0 turn off, 1 turn on, other toggle setting
CWXSPEED UP* increase speed, DOWN* decrease speed, or speed value
CWXDELAY UP* increase delay, DOWN* decrease delay, or delay value
DAX 0 turn off, 1 turn on, other toggle setting
DEXP 0 turn off, 1 turn on, other toggle setting
DEXPLEVEL UP* to increase level, DOWN* to decrease level, or DEXP level
FDX 0 turn off, 1 turn on, other toggle setting
FILTERSHARPNESS No param returns CA-ON,CL-1,DA-ON,DL-1,VA-ON,VL-1
CA - CW Auto, CL - CW Sharpness Level
DA - CW Auto, DL - Digital Sharpness Level
VA - CW Auto, VL - Voice Sharpness Level
Note: key value separator can be - or ?
Note: ON/OFF is same as true/false and 1/0, 2 is toggle
param=CA will return only CA
param=CA-OFF will set CA to OFF
param=CA-ON will set CA to ON
combine settings with comma to read or set in single command
param=VA-OFF,VL-2 will turn off voice auto and set level to 2, returns OFF,2
GLOBALPROFILE Param is the profile you are selecting
HEADPHONEGAIN UP* to increase level, DOWN* to decrease level, or audio level
HEADPHONEMUTE 0 turn off, 1 turn on, other toggle setting
METERINRX Meter in RX - 0 turn off, 1 turn on, other toggle setting
MIC UP to set previous, DOWN to set next
MICBIAS Mic Bias - 0 turn off, 1 turn on, other toggle setting
MICBOOST Mic Boost - 0 turn off, 1 turn on, other toggle setting
MICLEVEL UP* to increase level, DOWN* to decrease level, or mic level
MICPROFILE Param is the profile you are selecting
MON TX Monitor - 0 turn off, 1 turn on, other toggle setting
MONGAINTXCW TX Monitor CW Gain - UP* to increase level, DOWN* to decrease level, or level
MONPANTXCW TX Monitor CW Pan - UP* to increase level, DOWN* to decrease level, or level
MONGAINTXSB TX Monitor SSB Gain - UP* to increase level, DOWN* to decrease level, or level
MONPANTXSB TX Monitor SSB Pan - UP* to increase level, DOWN* to decrease level, or level
MOX 0 turn off, 1 turn on, other toggle setting
MUTE 0 turn off, 1 turn on, other toggle setting
MUTEALL n/a
PROC 0 turn off, 1 turn on, other toggle setting
PROCLEVEL UP increase proc, DOWN decrease proc, value of 0, 1 or 2
RFPOWER UP to increase power, DOWN to decrease power, or power level
SLICE UP to previous slice, DOWN to next slice, CREATE to add slice, DELETE to remove slice
SPOTS Info, Clear, Remove and Trigger Spots
param=info to list all spots
param=clear to clear all spots
param=remove,n where spot index n is removed
param=trigger,n where spot index n is triggered
TRACKA Slice B tracks slice A Freq enabled; param = true / false
TRACKREV Track in reverse direction; param = true / false
TUNE 0 turn off, 1 turn on, other toggle setting
TUNEPOWER UP* to increase power, DOWN* to decrease power, or power level
TXFILTER Returns delta between High and Low
TXFILTERLOW UP* to increase offset, DOWN* to decrease offset
TXFILTERHIGH UP* to increase offset, DOWN* to decrease offset
TXINHIBIT 0 turn off, 1 turn on, other toggle setting
TXPROFILE Param is the profile you are selecting
VOX 0 turn off, 1 turn on, other toggle setting
VOXLEVEL UP* to increase, DOWN* do decrease, or level value
VOXDELAY UP* to increase, DOWN* do decrease, or delay value
XVTRS Transverter array of Index, Name elements
-XX- Invalid cmd

* NOTE
- DOWN can be replaced by -1, -2, -5, -10, -20 or -50 to step non-default values
- UP can be replaced by +1, +2, +5, +10, +20 or +50 to step non-default values; You must prefix with the +


Slice / Active Slice Commands
http://localhost:5025/ActiveSlice/{cmd}?param={val}
To target specific slice letter use
http://localhost:5025/Slice/{A-H}/{cmd}?param={val}
To target TX slice letter use
http://localhost:5025/Slice/TX/{cmd}?param={val}

Slice cmd val Parameter
INFO returns slice information
ACTIVE return active state and 1 to set it active
AGCMODE DOWN to next mode
AGCLEVEL UP* to increase level, DOWN* to decrease level, or level value
ANF 0 turn off, 1 turn on, other toggle setting
ANFLEVEL UP* to increase level, DOWN* to decrease level, or level value
APF 0 turn off, 1 turn on, other toggle setting
APFLEVEL UP* to increase level, DOWN* to decrease level, or level value
AUDIOGAIN UP* to increase level, DOWN* to decrease level, or level value
AUDIOPAN UP* to increase level, DOWN* to decrease level, or level value
BAND band selections
Set band values like 2200, 160, 40, 20, GEN, WWV
or XVTR0, XVTR1, XVTR2, etc.
CLOSE 1 to Close Slice
DAX 0 turn off, 1 - 8 DAX channel
DIV 0 turn off, 1 turn on, other toggle setting
FILTER UP to previous filter, DOWN to next filter, 0 - 9 to select filter
FILTERLOW UP* to increase offset, DOWN* to decrease offset
FILTERHIGH UP* to increase offset, DOWN* to decrease offset
FREQ UP moves FREQ up by STEP, DOWN moves FREQ down by STEP, other is MHz value
Use 1 - 6 to format exponent length of Frequency; e.g. 2 results in 7.12
FREQE Frequency Entry; Param values are 0,1,2,3,4,5,6,7,8,9,., CLEAR or ENTER
ENTER will set the Slice Frequency to accumulated value
LETTER returns slice letter and index
LOCK 0 turn off, 1 turn on, other toggle setting
MODE UP to previous mode, DOWN to next mode, other MODE setting (eg. AM, LSB)
MUTE 0 turn off, 1 turn on, other toggle setting
NR 0 turn off, 1 turn on, other toggle setting
NRLEVEL UP* to increase level, DOWN* to decrease level, or level value
NB 0 turn off, 1 turn on, other toggle setting
NBLEVEL UP* to increase level, DOWN* to decrease level, or level value
PAN Panadapter settings
CENTER center panadapter on slice
UP increase bandwidth, DOWN decrease bandwidth
SEGMENT zooms to band segment, BAND zooms to band
MIN zooms to min bandwidth, MAX zooms to maximum bandwidth
1 - 1000 sets bandwidth
PLAY 0 turn off, 1 turn on, other toggle setting
RECORD 0 turn off, 1 turn on, other toggle setting
RFGAIN UP to increase gain, DOWN to decrease gain, or gain value
RIT 0 turn off, 1 turn on, other toggle setting
RITFREQ UP* to increase offset, DOWN* to decrease offset, or freq value
RXANT RX antenna selection or , NEXT selects next in list, PREV selects previous in list
SPLIT 1 will attempt to SPLIT slice. Will silently fail if no remaining slices for client. This is not a toggle.
STEP UP to increase step, DOWN to decrease step, or step value
SCAN start scan on scan bank
Set scan bank number 1 - 20
or 0 to get scanning bank number
SMUTE 0 - 7 slice number to toggle mute setting
SWAP 0 - 7 slice number to swap with active slice, if 2+ slices present use NEXT swap active slice with next one
TX 0 turn off, 1 turn on, other toggle setting
TXANT TX antenna selection or NEXT selects next in list, PREV selects previous in list
WNB 0 turn off, 1 turn on, other toggle setting
WNBLEVEL UP* to increase level, DOWN* to decrease level, or level value
XIT 0 turn off, 1 turn on, other toggle setting
XITFREQ UP* to increase offset, DOWN* to decrease offset, or freq value
-XX- Invalid cmd
-- Slice not found

* NOTE
- DOWN can be replaced by -1, -2, -5, -10, -20 or -50 to step non-default values
- UP can be replaced by +1, +2, +5, +10, +20 or +50 to step non-default values; You must prefix with the +



Radio Memory Commands
http://localhost:5025/RadioMem/{cmd}?param={val}

RadioMem cmd val Parameter
INFO returns radio memory information
no param returns array of all memory's properties
param=1 returns array of { "Index": 29, "Name": "7.149000 LSB", "Freq": 7.149, "Mode": "LSB" }
param=2 returns array of { "Index": 29, "Name": "7.149000 LSB" }
SELECT sets active slice to radio memory by index; param = index
DELETE deletes radio memory by index; param = index
SAVE create new radio memory from slice index; param = 0 - 7



SPE Amplifier Slice Commands
http://localhost:5025/SPEAMP/{cmd}?param={val}

SPEAMP cmd val Parameter
INFO returns SPE information
OPEN 1 to Open COM port
OPER 1 toggle Operate
ANT 1 switch Antenna
CLOSE 1 to Close COM port, DTR feature must be enabled
INPUT 1 switch Input
POWER 1 to change Power Level
TUNE 1 to initiate Tune
BAND reports Band
AMPS reports Amps
MEMB report Memory Bank
MODEL reports Model
OUTPUT report Output Power
VOLTS reports Volts
SWR reports Ant SWR
SWRT reports Tuner SWR
RX reports ON when in RX
TX reports ON when in TX
-- Amp not configured
-XX- Invalid cmd



SteppIR Commands
http://localhost:5025/STEPPIR/{cmd}?param={val}

SteppIR cmd val Parameter
INFO returns SteppIR information
ANTSTATE returns Antenna State hex code
ANTSTATESTR returns Antenna State code string
AUTOTRACK 0 turn off Autotrack, 1 turn on Autotrack
BIDIR 1 to set Bi-Directional for Beam, 3/4 for Vertical
CALIBRATE 1 to Calibrate
DIR returns the direction
FOLLOWANT 0 - 8 or TX or A - H to set follow ANT by Slice id, TX or letter A to H
FORWARD 1 to set Forward
FREQ returns the Freq
FREQANT sets the Antenna Freq in Manual sync mode, returns the Antenna Freq
FREQE Frequency Entry; Param values are 0,1,2,3,4,5,6,7,8,9,., CLEAR or ENTER
ENTER will set the Antenna Frequency to accumulated value
MANUAL 0 to manually sync, 1 to auto sync Freq with Antenna Freq, 2 toggles setting
OPEN 0 to Close, 1 to Open, 2 to Toggle Open/Close
RETRACT 1 to Retract
REVERSE 1 to set Reverse
SYNC 1 to set Slice Frequency to Antenna in Manual sync mode
34 1 to set 3/4 in Vertical, Bi-Directional for Beam
TXINHIBIT returns Inhibit boolean

Note:




GPIO Commands
http://localhost:5025/GPIO/{pin} - Read IO Pin Value

http://localhost:5025/GPIO/{pin}/{0_or_1} - Write Output Pin Value

http://localhost:5025/GPIO/{cmd}?param={val}

GPIO cmd val Parameter
INFO returns all configured pin values
READ returns values for list of comma separated pins
eg. param=5,6,13,19
WRITE write values for list of comma separated pin,value sets
eg. param=13,1,19,0 will set pin 13 high, pin 19 low

JSON object returned

{
    "pin": "13,19,26",  // pin list
    "val": "110",       // binary list of values       
    "ival": 6           // decimal value for pin list  
}



Meter information over WebSocket

http://localhost:5025/ws/meters

Json Meter Data returned

{
 "station":"6600M",
 "callsign":"W3II",
 "nickname":"6600M",
 "ipaddr":"192.168.1.202",
 "meters":{
    "+13.8A":"14.2",
    "PATEMPC":"32.1",
    "FWDPWR":"0.0",
    "REVPWR":"0.0",
    "SWR":"1.0",
    "AMP PWR":"0",
    "AMP ID":"0",
    "AMP SWR":"1.1",
    "AMP TEMPC":"30.2",
    "AMP TEMPF":"86.3",
    "PATEMPF":"89.8"}
}

Json S-Meter Data returned

{
 "machinename":"rpi4svr",
 "callsign":"W3II",
 "nickname":"6600M",
 "ipaddr":"192.168.1.202",
 "smeters":[  // 8 smeter objects for slice index 0 - 7 
   { // slice 0
     "letter":"A",
     "client":"6600M",
     "dbm":-67,  // -150 dbm to 27 dbm
     "sunit":"S9"
   },
   { // slice 1
     "letter":null, // this is the 2nd slice which is not present
     "client":null,
     "dbm":0,
     "sunit":null
   }, 
   // ... remaining Slice 2-7, 6 slice slots follow ...
  ]
}

Slice information contains an INDEX property which can be used to index into the smeter array.



Assign FTDI serial cable to fixed name

From a terminal window:

  1. find out what's on ttyUSB:
pi@raspberrypi:~ $ dmesg | grep ttyUSB 
[142617.031424] usb 1-1.4: FTDI USB Serial Device converter now attached to ttyUSB0
Take note of the node numbers: In this case 1-1.4
  1. list all attributes of the devices (in this case USB0 and USB1):
pi@raspberrypi:~ $ udevadm info --name=/dev/ttyUSB0 --attribute-walk
...
looking at parent device '/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4':
    KERNELS=="1-1.4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{devspec}=="(null)"
    ATTRS{quirks}=="0x0"
    ATTRS{product}=="USB Serial Converter"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{devnum}=="20"
    ATTRS{idProduct}=="6001"
    ATTRS{speed}=="12"
    ATTRS{ltm_capable}=="no"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{maxchild}=="0"
    ATTRS{devpath}=="1.4"
    ATTRS{manufacturer}=="FTDI"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{busnum}=="1"
    ATTRS{urbnum}=="143382"
    ATTRS{bcdDevice}=="0600"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bMaxPower}=="44mA"
    ATTRS{serial}=="FT8YXPRB"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{tx_lanes}=="1"
    ATTRS{configuration}==""
    ATTRS{rx_lanes}=="1"
    ATTRS{removable}=="unknown"
    ATTRS{bmAttributes}=="a0"
    ATTRS{version}==" 2.00"
    ATTRS{bDeviceClass}=="00"
    ATTRS{authorized}=="1"
    ATTRS{idVendor}=="0403"
...

Look at the tree leaf matching the node name from the prior step. In this case ..../usb1/1-1/1-1.4 You have to look at a unique differentiator between the devices. In most cases you can use the idVendor field (0403 in this case) or the idProduct field (6001 in this case) as the differentiator between the two devices. In case the vendor ID is the same, you can use the serial number of the two devices.

  1. We are now going to create a new USB device linked to the unique information we have. Create a file /etc/udev/rules.d/10-usb-serial.rules with rules for all USB devices in it:
pi@raspberrypi:~ $ sudo nano /etc/udev/rules.d/10-usb-serial.rules

Type the following in the nano editor and then save the file (ctrl-o) and (ctrl-x):

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="FT8YXPRB",  SYMLINK+="ttyUSB_SIR"
  1. Load the new rule:
pi@raspberrypi:~ $ sudo udevadm trigger
  1. Verify this works:
pi@raspberrypi:~ $ ls -l /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Aug  8 15:24 /dev/ttyUSB0
lrwxrwxrwx 1 root root         7 Aug  8 14:22 /dev/ttyUSB_SIR -> ttyUSB0

As you see we still have the existing USB0 device, but we also have a symbolic link to device that are match the correct hardware. These symbolic links will be created at each reboot or when the USB device is plugged into an USB port.

  1. Now change the device for the FTDI cable to ttyUSB_SIR