# FRStack WebAPI Service

Version 4.0.0

This version of FRStack provides REST APIs for RADIO, SLICE, UDP, PGXL AMP, TUNER, 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 / RPi5 GPIO
FRStackWebApi APIs

# Download links

Raspberry PI Version
Raspberry PI ARM64 Version
Linux ARM64 Version
Linux X64 Version
OSX X64 Version
OSX M Version
Windows X64 Version
Windows ARM64 Version

## Version History

V4.0.0.5 (OSX, Linux, RPi, Win)

- Add DSP NRF, NRL, NRS, ANFL Levels

V4.0.0.4 (OSX, Linux, RPi, Win)

- Fix PGXL Tune Detect when using XVTR

V4.0.0.3 (OSX, Linux, RPi, Win)

- Fix ESCGAIN and ESCPHASESHIFT
- Fix Tune Detect

V4.0.0.1 (OSX, Linux, RPi, Win)

- Update to latest SDK 4.1.5
- Add Slice DSP: NRL, NRS, RNN, NRF ANFL, ANFT
- Add Slice ESC, ESCGAIN, ESCPHASESHIFT
- Add Slice FMTX1750 for EU

V3.9.18.84 (OSX, Linux, RPi, Win)

- Update to latest SDK 3.9.18
- Add APD to Rest Radio
- Add Profile Auto Save to Rest Radio
- Add Tune Mode to Rest Radio
- Add Tuner to Rest Tuner
- Add 2nd SteppIR support
- .NET9 support

V3.8.14.80 (OSX, Linux, RPi, Win)

- Add Radio Profile Global, Mic, TX Save API

V3.8.13.79 (OSX, Linux, RPi, Win)

- Fix Slice Band XVTR API

V3.8.12.78 (OSX, Linux, RPi, Win)

- Add SQUELCH and SQUELCHLEVEL API to REST Slice INFO

V3.8.12.77 (OSX, Linux, RPi, Win)

- Add SQUELCH and SQUELCHLEVEL API to REST Slice
- Update PGXL Power limit handling
- Fix Tune Detection logic
- Update to latest SDK 3.8

V3.7.3.74 (OSX, Linux, RPi, Win)

- Add config parameter initRadioIP. Connect to Radio by IP address without Discovery
- Switch to .NET 8
- Add forced Garbage Collection to reduce memory growth

V3.3.34.70 (OSX, Linux, RPi)

- Add Slice PAN API
- Add FILTERLOW FILTERHIGH set value using param= 3000
- Add Radio COPYTO COPYFROM APIs
- Add TGXL API
- Add TNF API
- Localization fix on Rest Frequency
- Bugfix FILTER set 1-9
- Bugfix Radio Tune, Tgxl Autotune detect logic

V3.3.33.63 (OSX, Linux, RPi)

- .Net 6.0 update

V3.3.32.62 (OSX, Linux, RPi)

- Remove console debug info

V3.1.31.60 (OSX, Linux, RPi)

- Add TX Slice API to the Active Slice and Slice A to H
- SteppIR add Follow Antenna selection API
- Fix SPE 1 support

V3.1.30.59 (OSX, Linux, RPi)

- RADIO INFO adds Transverter array - XVTRS
- SLICE BAND now accepts XVTRn where n is Transverter Index
- Document the installation of FRStack Web APIs Service second instance
- Node Red sample adds Radio Memory panel

V3.1.27.57 (OSX, Linux, RPi)

- Fix SPE Amp serial port .NET5 issue

V3.1.26.54 (OSX, Linux, RPi)

- Add Radio Memory REST API
- Add Radio SPOTS REST API
- Add Slice B tracks Slice A w/ rev direction feature

V3.1.25.53 (OSX, Linux, RPi)

- Enhance Radio Filter Sharpness API
- UDP Network Info - Adds RadioMox and ActiveRadioMox
- MOX state added to UDP Network and Web Socket information
- MOX state mapping to GPIO Output
- MOX input mapping to GPIO Input
- Fix UDP Broadcast on smaller ranges e.g. 192.168.1.255

V3.1.25.52 (OSX, Linux, RPi)

- Add Radio Filter Sharpness API

V3.1.24.50 (RPi only)

- Add GPIO APIs

V3.1.23.48 (OSX, Linux, RPi)

- Add CustomFunction feature
- Mode sets DAX ON / OFF feature
- Fixed Tune Detect logic
- Cleanup API return format

V3.1.20.10

- Add SteppIR retry for Home and Calibrate

V3.1.19.9

- Fix SteppIR bound client fix, command retry

V3.1.18.8

- Add web socket smeter data
- Fix smeter UDP

V3.1.16.7

- Radio Info Add NICKNAME, CALLSIGN, MODEL, SERIAL, VERSION, TXINHIBIT
- UDP info add App node
- SPE Add Info and Bug fixes
- SteppIR Add Info and Bug Fixes
- SWR Peak Hold and PGXL meter bug fixes

V3.1.16.2

- Initial Release

## Upgrade to .NET 9.0 on RPi or Linux

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

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

    # rename dotnet version ? folder
    sudo mv /opt/dotnet /opt/dotnet?

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

## Install .NET ASP.NET 9 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/9.0

    # Here is the current one for Linux ARM32 devices
    # https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.6/aspnetcore-runtime-9.0.6-linux-arm.tar.gz

    # Here is the current one for Linux ARM64 devices
    # https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.6/aspnetcore-runtime-9.0.6-linux-arm64.tar.gz

    # Here is the current one for Linux x64 devices
    # https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.6/aspnetcore-runtime-9.0.6-linux-x64.tar.gz

    # From the Downloads folder, execute the following commands:

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

## Install .NET ASP.NET Core 9 on OSX

The FRStackWebApi-osx-?64_x_y_z_v.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 9 runtime
    ./dotnet-install.sh --channel 9.0 --runtime aspnetcore

## Install FRStackWebApi on OSX

    # Expand https://www.mkcmsoftware.com/download/FRStackWebApi-osx-arm64_4_0_0_5.zip in the /usr/local/frstack
    # or Expand https://www.mkcmsoftware.com/download/FRStackWebApi-osx-x64_4_0_0_5.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

- node-red-dashboard
- node-red-contrib-ui-level
- node-red-contrib-ui-led

## 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/FRStackWebApi-rpi-arm32_4_0_0_5.zip
    # for RPi 64
    sudo wget https://www.mkcmsoftware.com/download/FRStackWebApi-rpi-arm64_4_0_0_5.zip
    # for Linux x64
    sudo wget https://www.mkcmsoftware.com/download/FRStackWebApi-linux-arm64_4_0_0_5.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",
        "initRadioIP": null, // optionally configure the default radio IP address here to autoconnect to, useful when Discovery is not working
        "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"
        "SteppIRComPort2": "", // 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

## RPi GPIO configuration

For RPi 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

- 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": "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/?param=

FRStack cmd | val Parameter
--- | ---
AUTOCONNECT | True to enable auto connect to radio, false to disable
DISCONNECT | 1 to disconnect radio
CONNECT | IPV4, 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/?param=

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
APD | 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
GLOBALPROFILESAVE | Param is the profile name you are selecting, UPDATE for current profile, DATETIME for GyyyMMddHHmm
HEADPHONEGAIN | UP* to increase level, DOWN* to decrease level, or audio level
HEADPHONEMUTE | 0 turn off, 1 turn on, other toggle setting
LICENSE | returns radio Feature License information
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
MICPROFILESAVE | Param is the profile name you are selecting, UPDATE for current profile, DATETIME for MyyyMMddHHmm
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
PAN | CREATE add Panadapter, DELETE remove active slice Panadapter
PROC | 0 turn off, 1 turn on, other toggle setting
PROCLEVEL | UP increase proc, DOWN decrease proc, value of 0, 1 or 2
PROFILEAUTOSAVE | 0 turn off, 1 turn on, other toggle setting
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
TUNEMODE | 0 for single or 1 for two tone mode, 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
TXPROFILESAVE | Param is the profile name you are selecting, UPDATE for current profile, DATETIME for TyyyMMddHHmm
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/?param=
To target specific slice letter use
http://localhost:5025/Slice//?param=
http://localhost:5025/ActiveSlice/?letter=&param=
To target TX slice letter use
http://localhost:5025/Slice/TX/?param=
To target slice index use
http://localhost:5025/ActiveSlice/?index={0-7}&param=

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
ANFL | 0 turn off, 1 turn on, other toggle setting
ANFLLEVEL | UP* to increase level, DOWN* to decrease level, or level value
ANFT | 0 turn off, 1 turn on, other toggle setting
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 to XVTR9.
CLOSE | 1 to Close Slice
COPYFROM | Copy slice information from slice index 0-7 or letter A-H
COPYTO | Copy slice information to slice index 0-7 or letter A-H
DAX | 0 turn off, 1 - 8 DAX channel
DIV | 0 turn off, 1 turn on, other toggle setting
ESC | 0 turn off, 1 turn on, other toggle setting
ESCPHASESHIFT | get or set integer value 0 - 360 degrees
ESCGAIN | get value 0.00 to 2.00, set value by using integer 0 - 200: UP, DOWN, +/-10 for .1 change, or space + value
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
FMTX1750 | 0 turn off, 1 turn on, other toggle setting (EU)
FREQ |
| UP moves FREQ up by STEP, DOWN moves FREQ down by STEP
| numbers are MHz or Hz value; e.g. 7.2 or 7200000
| + or - then numbers is Hz increment or decrement; e.g. +1000 or -500
| 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
NB | 0 turn off, 1 turn on, other toggle setting
NBLEVEL | UP* to increase level, DOWN* to decrease level, or level value
NR | 0 turn off, 1 turn on, other toggle setting
NRLEVEL | UP* to increase level, DOWN* to decrease level, or level value
NRF | 0 turn off, 1 turn on, other toggle setting
NRFLEVEL | UP* to increase level, DOWN* to decrease level, or level value
NRL | 0 turn off, 1 turn on, other toggle setting
NRLLEVEL | UP* to increase level, DOWN* to decrease level, or level value
NRS | 0 turn off, 1 turn on, other toggle setting
NRSLEVEL | 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
RNN | 0 turn off, 1 turn on, other toggle setting
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
SQUELCH | 0 turn off, 1 turn on, other toggle setting
SQUELCHLEVEL | UP* to increase level, DOWN* to decrease level, or level value
SWAP | 0 - 7 index or letter A-H letter 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 +
- DOWN or UP can be replaced by a value to set; You must prefix with the space

Radio Memory Commands
http://localhost:5025/RadioMem/?param=

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/?param=

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/?param=

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:

- FREQANT, FREQE, SYNC can only be used when CAT cable is not used.
- OPEN with param=1 will connect to COM port then send the 'R' Wake / Turn on Serial frequency update command
- RETRACT will send 'U' Turn off Serial frequency update then 'S' Home antenna

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

TUNER cmd | val Parameter
--- | ---
INFO | returns TUNER information
BYPASS | 1 to set Bypass, 0 to set Inline, 2 to toggle
OPERATE | 1 to set Operate, 0 to set Standby, 2 to toggle
AUTOTUNE | Any value initiates Tune operation

TGXL Commands
http://localhost:5025/TGXL/?param=

This is deprecated, must be enabled in FRStack.exe.config file DirectTG value to True.

TGXL cmd | val Parameter
--- | ---
INFO | returns TGXL information
CONNECT | 1 to Connect to TGXL, 0 to Disconnect from TGXL, 2 to toggle connection
DISCONNECT | Any value will disconnect from TGXL
BYPASS | 1 to set Bypass, 0 to set Operate, 2 to toggle
OPERATE | 1 to set Operate, 0 to set Bypass, 2 to toggle
TUNE | Any value initiates Tune operation

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

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

http://localhost:5025/GPIO/?param=

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",
        "MOX":"0"}
    }

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

2. 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.

3. 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"

4. Load the new rule:

    pi@raspberrypi:~ $ sudo udevadm trigger

5. 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.

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

Copyright � MKCM Software, LLC 2014-2026