Skip to content

Radio config reference ​

A radio module config is one configs/<model>.json file. Build a radio driver walks through the Baofeng UV-5R file. This page lists the fields.

Two checks apply, and they are not the same list:

  • SchemaValidator.validateRadioProtocol in @springfield/ham-radio-utils compiles src/schemas/radio-protocol-schema.json. The root object does not set additionalProperties: false, so fields that the schema does not name are still accepted. After the schema check, the validator requires serialConfig.baudRate to be a member of serialConfig.baudRates when that array is present.
  • validateConfiguration in @springfield/ham-radio-registry requires id.model, serialConfig, memoryConfig, a non-empty readMemory, a non-empty writeMemory, and settingsSchema. It also checks readMessage and writeMessage when they are present. It does not reject unknown fields, and it does not require minApiVersion.

yarn pack:release in the manufacturer repo requires minApiVersion, id.model, id.name, and version, and it requires the file name to be configs/<id.model>.json.

Step behavior is Protocol DSL. Memory-map behavior is Memory-map DSL. The tables below are the field lists from the schemas those pages describe.

Protocol schema fields ​

Generated from src/schemas/radio-protocol-schema.json in springfield-ham-radio/ham-radio-utils at 9477e28b27a671db52869db8f3dde3c867b7c896.

Radio Protocol DSL Schema. Schema for defining radio communication protocols as send/expect exchanges

Required: id, version, description, serialConfig, memoryConfig, settingsSchema, readMemory, writeMemory.

FieldRequiredTypeDescription
idyesobjectRadio identification information
versionyesstring, pattern ^\d+\.\d+\.\d+$Version of the radio configuration
descriptionyesstringHuman-readable description of the radio configuration
settingsSchemayesobjectSchema definitions for radio settings and channels
serialConfigyesobjectSerial port configuration
memoryConfigyesobjectMemory configuration for radio segments
readMemoryyesarray of protocolStepProtocol steps for reading memory
writeMemoryyesarray of protocolStepProtocol steps for writing memory
onErroronErrorOptional cleanup exchanges run after a read or write failure (or cancel)

id ​

Radio identification information

Required: model, name, manufacturer.

FieldRequiredTypeDescription
modelyesstringRadio model identifier
nameyesstringHuman-readable radio name
manufactureryesstringRadio manufacturer name

settingsSchema ​

Schema definitions for radio settings and channels

Required: model, settingsSchema, channelSchema.

FieldRequiredTypeDescription
modelyesstringRadio model identifier
settingsSchemayesobjectJSON schema for radio settings
channelSchemayesobjectJSON schema for radio channels

serialConfig ​

Serial port configuration

Required: baudRate.

FieldRequiredTypeDescription
baudRateyesinteger, 1200–115200Default serial baud rate used to open the programming port. Must be included in baudRates when that list is present.
baudRatesarray of integer, 1200–115200, min items 1, uniqueBaud rates the radio programming port accepts. Omit when only baudRate is valid. The HamBench import and write dialogs show a selector when more than one value is listed.
dataBitsenum 5, 6, 7, 8, default 8Number of data bits
stopBitsone of the shapes belowNumber of stop bits
parityenum none, even, odd, default none
rtsctsbooleanHardware RTS/CTS flow control (Kenwood TH-D74 clone on macOS)
rtsbooleanRTS line after open. TH-F6 live CAT needs false
dtrbooleanDTR line after open

stopBits ​

Number of stop bits

Exactly one of these shapes:

integer ​

enum 1, 2.

number ​

enum 1.5.

memoryConfig ​

Memory configuration for radio segments

Required: chunkSize, addressSize, addressEndianness, segments.

FieldRequiredTypeDescription
chunkSizeyesinteger, min 1Size of memory chunks in bytes
addressSizeyesinteger, 1–4Size of addresses in bytes for memory operations
addressEndiannessyesenum big, littleByte order for address values in memory operations
segmentsyesmap of objectMemory segment definitions

segments ​

Memory segment definitions

map of object.

segments entry ​

Required: startAddress, endAddress.

FieldRequiredTypeDescription
startAddressyesinteger, min 0Starting address of the memory segment
endAddressyesinteger, min 0Inclusive ending address of the memory segment

Definitions ​

onError ​

Per-operation cleanup steps. Items are send/expect exchanges only; no chunked read/write or CAT loops.

Extra fields are rejected.

FieldRequiredTypeDescription
readMemoryarray of exchangeStepCleanup exchanges after a failed or cancelled readMemory
writeMemoryarray of exchangeStepCleanup exchanges after a failed or cancelled writeMemory

protocolStep ​

A single protocol step: an exchange, a chunked read, a chunked write, or a live CAT memory loop

Exactly one of: readStep, writeStep, catReadStep, catWriteStep, exchangeStep.

byteToken ​

A send/expect token: a byte, hex string (0x50), ASCII opcode (S), or placeholder ($address)

Exactly one of these shapes:

integer ​

integer, 0–255.

string ​

string, min length 1.

sendData ​

Bytes and placeholders to send

array of byteToken.

expect ​

Expected serial reply: exact byte(s), opaque length, or a framed pattern

Exactly one of these shapes:

byteToken ​

See byteToken.

array ​

array of byteToken, min items 1.

bytes ​

Required: bytes.

Extra fields are rejected.

FieldRequiredTypeDescription
bytesyesinteger, min 1Accept any content of this many bytes
until ​

Required: until.

Extra fields are rejected.

FieldRequiredTypeDescription
untilyesbyteTokenRead until this delimiter byte; the delimiter is not included (Kenwood CAT CR)

catMemory ​

Live CAT memory loop over logical channel records

Required: segment, count, recordSize, pack.

Extra fields are rejected.

FieldRequiredTypeDescription
segmentyesstringMemory segment that receives packed records
countyesinteger, min 1Number of channel indexes to scan
recordSizeyesinteger, min 1Packed logical record size in bytes
packyesenum kenwood-th-f6CAT reply packer
indexWidthinteger, 1–6, default 3Zero-padded decimal width of the memory index (TH-F6 uses 3)
emptyByteinteger, 0–255, default 255Fill byte for empty memories
timeoutinteger, min 1Timeout in milliseconds for each CAT line
interCommandDelayMsinteger, min 0Milliseconds to wait between CAT commands

catReadStep ​

Read memories with live CAT commands

Required: catRead.

Extra fields are rejected.

FieldRequiredTypeDescription
descriptionstring
catReadyescatMemory

catWriteStep ​

Write memories with live CAT commands

Required: catWrite.

Extra fields are rejected.

FieldRequiredTypeDescription
descriptionstring
catWriteyescatMemory

exchangeStep ​

Send bytes and/or wait for a reply

At least one of send, or expect, or setBaudRate.

Extra fields are rejected.

FieldRequiredTypeDescription
descriptionstringHuman-readable description of the step
sendsendData
expectexpect
timeoutinteger, min 1, default 5000Timeout in milliseconds
delayinteger, min 0Milliseconds to wait after send
setBaudRateinteger, 1200–115200Switch serial baud rate before send/expect (TH-D74 clone transfers at 57600)

readStep ​

Chunked memory read

Required: read.

Extra fields are rejected.

FieldRequiredTypeDescription
descriptionstringHuman-readable description of the step
readyesobject, no extra fields
read ​

Required: segments, send, expect.

Extra fields are rejected.

FieldRequiredTypeDescription
segmentsyesarray of string, min items 1Memory segment names to read
sendyessendData
expectyesexpect
ackexchangeStepOptional exchange after each chunk
timeoutinteger, min 1Timeout in milliseconds for each chunk exchange
delayinteger, min 0Milliseconds to wait after each accepted chunk, including after ack
readybyteTokenByte prefixed to the next chunk when ack.expect times out. UV-5R clone uses 0x06 with ack.timeout 50 so a silent radio is not held until it answers 0xFE.

writeStep ​

Chunked memory write

Required: write.

Extra fields are rejected.

FieldRequiredTypeDescription
descriptionstringHuman-readable description of the step
writeyesobject, no extra fields
write ​

Required: segments, send, expect.

Extra fields are rejected.

FieldRequiredTypeDescription
segmentsyesarray of string, min items 1Memory segment names to write
sendyessendData
expectyesexpect
chunkSizeinteger, min 1Override memoryConfig.chunkSize for this write (UV-5R clone writes 16-byte blocks)
delayinteger, min 0Milliseconds to wait after each accepted block (UV-5R clone waits 50ms)
skiparray of object, no extra fieldsInclusive radio-address ranges that must not be uploaded
timeoutinteger, min 1Timeout in milliseconds for each chunk exchange
skip ​

Required: startAddress, endAddress.

Extra fields are rejected.

FieldRequiredTypeDescription
startAddressyesinteger, min 0Inclusive start address of a skipped range
endAddressyesinteger, min 0Inclusive end address of a skipped range

Fields the protocol schema does not name ​

Shipping configs in radio-module-baofeng and radio-module-kenwood set the fields in this section. The protocol schema allows them because its root does not forbid extra properties. There is no second JSON schema in ham-radio-utils for this section. The shapes below are the fields those configs and the registry types use.

$schema ​

Shipping configs set $schema to https://springfield-ham-radio.com/schemas/radio-config-v1.json. Tests call SchemaValidator.validateRadioProtocol on the utils schema vendored above. That $schema string is not the $id of radio-protocol-schema.json.

minApiVersion ​

Required by pack:release and by the catalog schema. Strict major.minor.patch. The pack script rejects a missing value and does not default it.

ADR 0009 set the floor for configs that existed at the cutover to 18.0.1 and removed the old pack default of 17.3.0. A later config can set a higher floor. Kenwood TH-D74 and TM-D710A set 18.3.0 because their onError cleanup needs that API (ADR 0011). Baofeng UV-5R and Kenwood TH-F6 stay on 18.0.1.

API version compatibility ​

HamBench compares the module floor with the API package it was built with.

  • APP_HAM_RADIO_API_VERSION in radio-module-install.ts is hamRadioApiPackage.version, the installed @springfield/ham-radio-api version. On current main of ham-radio-ui that dependency is 18.3.0.
  • Official install reads minApiVersion from the catalog entry. Local zip install reads it from the packed configs/*.json. A missing value, or a value that is not major.minor.patch, fails the install.
  • isApiVersionCompatible(installedApiVersion, minApiVersion) in @springfield/ham-radio-registry is compareSemver(installed, min) >= 0. The app installs the module when its own API version is greater than or equal to the module floor. Otherwise it refuses the install and reports both versions.

ADR 0005 describes an older literal '17.3.0' constant. That is not the check current HamBench runs. Do not write 17.3.0 into a new config to match that record.

Raising minApiVersion blocks older HamBench builds for that radio only. The catalog document's schemaVersion is a separate switch: current HamBench reads schema version 3 only.

capabilities ​

RadioCapabilities in ham-radio-registry:

FieldUV-5RWhen to set it
memoryReadtrueThe protocol can download memory
memoryWritetrueThe protocol can upload memory
channelProgrammingtrueChannel memories are editable
settingsProgrammingtrueRadio-wide settings are editable
liveControlomittedSet true only together with a cat block. Live VFO is independent of clone read / write

bands ​

Optional array of ADIF band tokens for bands this model can transmit on. HamBench shows them on the saved radio and compares them with a logged contact. Omit the field when coverage is unknown. Do not list receive-only ranges.

Tokens used by the shipping modules and the user guide: 160m, 80m, 40m, 30m, 20m, 17m, 15m, 12m, 10m, 6m, 2m, 1.25m, 70cm, 33cm, 23cm.

UV-5R sets "bands": ["2m", "70cm"]. The protocol schema does not enumerate these tokens.

codec ​

FieldValue for a new module
type"memoryMap"

createMemoryMapCodec() in @springfield/ham-radio-utils encodes and decodes. The registry type still allows "shared" and "inline" for old experiments. ADR 0004 says new modules must not use those.

memoryMap ​

FieldUV-5R
$ref"../src/shared/memory-maps/uv5r-settings.json"

The path is relative to the config file. pack:release copies that file, and every relative $ref it reaches, into the radio zip. The map file itself is checked with SchemaValidator.validateMemoryMap.

metadata ​

Shipping Baofeng and Kenwood configs set author, license, homepage, and repository. The registry TypeScript type RadioConfigMetadata also declares moduleId, moduleVersion, pluginPath, and lastUpdated. The shipping JSON does not set those four.

cat ​

Present when capabilities.liveControl is true. HamBench uses it for the live VFO page. It is independent of catRead / catWrite memory steps (Protocol DSL). RadioCatConfig in ham-radio-registry:

FieldRole
protocolCommand family, for example "kenwood"
wakeCrSend a wake CR and discard buffered replies before ID
vfoCountHow many VFOs to poll. Default 1
frequencyCommandsFrequency commands to try in order, for example ["FQ", "FO"]
frequencyWidthDigit width of the frequency field
vfoChannelFrequency command is a multi-field VFO channel. Omit a separate modeCommand when this is true
bandIndexedFQ, MD, and PC take a band index first (Kenwood TH-D74). Do not set when vfoChannel is true
bandModesMode names available per band index. The CAT code is still the index into modes
vfoModeCommandCommand that reads VFO or memory activity, for example "VM"
vfoModesNames indexed by that command's value, for example ["VFO", "Memory", "Call", "DV"]
modesMode names in CAT code order
powersPower names in CAT code order, as shown on the radio
modeCommandSeparate mode command, for example "MD"
powerBandIndexPass the band index to PC
bandControlRead BC for CTRL/PTT band

The four fields after vfoChannel are optional and ship with @springfield/ham-radio-registry 2.2.0 (registry ADR 0001, PR #48). TM-D710A (vfoChannel) and TH-F6 omit them and stay valid. bandModes names must appear in modes. HamBench rejects bandIndexed together with vfoChannel. Session behavior is ham-radio-ui ADR 0022. Copy a cat block from the Kenwood module config for the model you match.

TH-D74 cat example ​

From configs/kenwood-th-d74.json at driver version 1.28.0. modes index is the MD code. bandModes[0] and bandModes[1] are band indices 0 and 1.

json
{
  "protocol": "kenwood",
  "vfoCount": 2,
  "frequencyCommands": ["FQ"],
  "frequencyWidth": 10,
  "modes": ["FM", "DV", "AM", "LSB", "USB", "CW", "NFM", "DR", "WFM", "R-CW"],
  "bandModes": [
    ["FM", "DV", "AM", "NFM", "DR", "WFM"],
    ["FM", "DV", "AM", "LSB", "USB", "CW", "NFM", "DR", "WFM", "R-CW"]
  ],
  "powers": ["H", "M", "L", "EL"],
  "modeCommand": "MD",
  "bandControl": true,
  "bandIndexed": true,
  "powerBandIndex": true,
  "vfoModeCommand": "VM",
  "vfoModes": ["VFO", "Memory", "Call", "DV"]
}

A new command family needs a driver change in @springfield/ham-radio-driver, not a new key invented in the module.

readMessage and writeMessage ​

Optional setup text HamBench shows before Read or Write. validateRadioDialogMessage in @springfield/ham-radio-api:

FieldRule
titlePlain text, required when the object is present, trimmed, 1–80 characters
bodyPlain text, required when the object is present, trimmed, 1–600 characters. Newlines are kept
severity"info" or "warning". Omit it for info

TH-D74 sets both messages. UV-5R omits them. Control characters other than tab and newline are rejected.

Sample config ​

This is the UV-5R header from configs/baofeng-uv5r.json at driver version 3.7.0. The arrays in the repo are the real clone steps; they are not copied here. Read them from the file and from Protocol DSL.

json
{
  "$schema": "https://springfield-ham-radio.com/schemas/radio-config-v1.json",
  "id": {
    "model": "baofeng-uv5r",
    "name": "Baofeng UV-5R",
    "manufacturer": "Baofeng"
  },
  "version": "3.7.0",
  "minApiVersion": "18.0.1",
  "description": "UV-5R and UV-5RE Plus models",
  "capabilities": {
    "memoryRead": true,
    "memoryWrite": true,
    "channelProgramming": true,
    "settingsProgramming": true
  },
  "bands": ["2m", "70cm"],
  "metadata": {
    "author": "Springfield Ham Radio",
    "license": "MIT",
    "homepage": "https://springfield-ham-radio.com",
    "repository": "https://github.com/springfield-ham-radio/radio-module-baofeng"
  },
  "settingsSchema": {
    "model": "baofeng-uv5r",
    "settingsSchema": { "$ref": "../src/shared/schemas/settings-schema.json" },
    "channelSchema": { "$ref": "../src/shared/schemas/channel-schema.json" }
  },
  "memoryMap": { "$ref": "../src/shared/memory-maps/uv5r-settings.json" },
  "codec": { "type": "memoryMap" },
  "serialConfig": {
    "baudRate": 9600,
    "dataBits": 8,
    "stopBits": 1,
    "parity": "none"
  },
  "memoryConfig": {
    "chunkSize": 64,
    "addressSize": 2,
    "addressEndianness": "big",
    "segments": {
      "channels": { "startAddress": 0, "endAddress": 6143 },
      "settings": { "startAddress": 7872, "endAddress": 8191 }
    }
  }
}

A new radio starts version at 1.0.0. Bump that field when the config or a file it $refs changes (ADR 0006). The catalog version is this value (ADR 0009).

Memory-map schema fields ​

Generated from src/schemas/radio-memory-map-schema.json in springfield-ham-radio/ham-radio-utils at 9477e28b27a671db52869db8f3dde3c867b7c896.

Radio Memory-Map DSL Schema. Schema for defining radio EEPROM settings layout as JSON (Chirp MEM_FORMAT as data)

Required: structs.

FieldRequiredTypeDescription
versionstringOptional map version
descriptionstring
structsyesarray of struct, min items 1
channelBindingschannelBindings
groupsarray of group

Definitions ​

seek ​

Exactly one of these shapes:

integer ​

integer, min 0.

string ​

string, pattern ^(0[xX][0-9a-fA-F]+|[0-9]+)$.

channelBindings ​

Required: records, receiveFrequency, transmitFrequency, receiveTone, transmitTone.

Extra fields are rejected.

FieldRequiredTypeDescription
recordsyesstring, min length 1
namesstring, min length 1
nameFieldstring, min length 1
receiveFrequencyyesstring, min length 1
transmitFrequencyyesstring, min length 1
receiveToneyesstring, min length 1
transmitToneyesstring, min length 1
extrasstring, min length 1

emptyWhen ​

Required: equals.

Extra fields are rejected.

FieldRequiredTypeDescription
equalsyesinteger, 0–255

group ​

Required: id, label.

Extra fields are rejected.

FieldRequiredTypeDescription
idyesstring, min length 1
labelyesstring, min length 1
descriptionstring
iconstring, min length 1
warningobject, no extra fields
groupsarray of subgroup
warning ​

Required: title, description.

Extra fields are rejected.

FieldRequiredTypeDescription
titleyesstring, min length 1
descriptionyesstring, min length 1

subgroup ​

Required: id, label.

Extra fields are rejected.

FieldRequiredTypeDescription
idyesstring, min length 1
labelyesstring, min length 1
descriptionstring

ui ​

Required: group, label, widget.

Extra fields are rejected.

FieldRequiredTypeDescription
groupyesstring
subgroupstring, min length 1
labelyesstring
widgetyesenum integer, select, switch, text, number
descriptionstring
menuobject, no extra fields
writableboolean
orderinteger

Required: number.

Extra fields are rejected.

FieldRequiredTypeDescription
numberyesinteger, min 0
codestring, min length 1

value ​

Exactly one of these shapes:

integer ​

Required: kind.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst integer
minnumber
maxnumber
boolean ​

Required: kind.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst boolean
enum ​

Required: kind, values.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst enum
valuesyesarray of string, min items 1
ascii ​

Required: kind, length.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst ascii
lengthyesinteger, min 1
padinteger, 0–255
digits ​

Required: kind, length.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst digits
lengthyesinteger, min 1
scalenumber
dtmf ​

Required: kind, length.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst dtmf
lengthyesinteger, min 1
charsetstring
bbcd ​

Required: kind, length.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst bbcd
lengthyesinteger, min 1
lbcd ​

Required: kind, length.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst lbcd
lengthyesinteger, min 1
scalenumber
tone ​

Required: kind, values.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst tone
valuesyesarray of integer, min items 1
ctcssMininteger
reverseOffsetinteger
ctcss-index ​

Required: kind, values.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst ctcss-index
valuesyesarray of integer, min items 1
dcs-index ​

Required: kind, values.

Extra fields are rejected.

FieldRequiredTypeDescription
kindyesconst dcs-index
valuesyesarray of integer, min items 1

field ​

Required: id, type.

Extra fields are rejected.

FieldRequiredTypeDescription
idyesstring, min length 1
typeyesenum u8, u16, u32, bits, char
widthinteger, 1–8
reservedboolean
valuevalue
uiui

struct ​

Required: id, seek, fields.

Extra fields are rejected.

FieldRequiredTypeDescription
idyesstring, min length 1
seekyesseek
fieldsyesarray of field, min items 1
countinteger, min 1
strideinteger, min 1
groupSizeinteger, min 1
groupPadinteger, min 0
emptyWhenemptyWhen
clearEmptyboolean