YAML Configuration
As well as Dire Wolf’s line-at-a-time format, samoyed-direwolf can read its
configuration from YAML. A configuration file whose name ends in .yaml or
.yml is read as YAML; anything else is read as before.
$ samoyed-direwolf -c samoyed.yaml --config-check
This is new, and only some directives have a YAML form so far. Everything else
can still be used, from a legacy block (see below).
Example
samoyed:
audioDevices:
- input: plughw:1,0
output: plughw:2,0
channels: 2
rate: 48000
channels:
- channel: 0
mycall: Q1TEST-1
txdelay: 30
txtail: 15
modem:
speed: "1200"
tones: {mark: 1200, space: 2200}
decoders: {count: 3, offset: 30}
ptt:
method: serial
device: /dev/ttyUSB0
line: rts
line2: dtr
invert2: true
- channel: 1
mycall: Q1TEST-2
modem: {speed: "9600", type: g3ruh}
ptt: {method: gpio, pin: 25, invert: true}
il2ptx: {}
agwPort: 8000
kissPorts:
- port: 8001
- {port: 8002, channel: 1}
legacy: |
DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$
That is the same configuration as:
ADEVICE plughw:1,0 plughw:2,0
ACHANNELS 2
ARATE 48000
CHANNEL 0
MYCALL Q1TEST-1
TXDELAY 30
TXTAIL 15
MODEM 1200 1200:2200 3@30
PTT /dev/ttyUSB0 RTS -DTR
CHANNEL 1
MYCALL Q1TEST-2
MODEM 9600 G3RUH
PTT GPIO -25
IL2PTX
AGWPORT 8000
KISSPORT 8001
KISSPORT 8002 1
DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$
Both are checked by the same code, so a setting means the same, and draws the same complaints, whichever way it is written.
Reference
Every setting goes under a top-level samoyed key,
leaving the rest of the file free for anything else that might one day want a place in it.
A file with settings outside it is refused.
These are the keys under samoyed:
audioDevicesA list of audio devices (
ADEVICE,ACHANNELS). Each hasinput, an optionaloutputwhen transmitting goes somewhere else, andchannels, 1 for mono (the default) or 2 for stereo, andrate, the sample rate (ARATE). A device’s number is its position in the list, unless it gives one withdevice.channelsA list of radio channels. Each needs
channel, its number, and may have:mycallThe station callsign (
MYCALL). As withMYCALL, it is also used for any channel that does not set its own.txdelay,txtail,dwait,slottimeTransmit timing, in 10 ms units (
TXDELAY,TXTAIL,DWAIT,SLOTTIME).persistThe chance, out of 255, of transmitting in a slot (
PERSIST).fullduptruefor full duplex (FULLDUP).fx25txFX.25 transmission (
FX25TX): 0 for off, 1 for automatic, or the number of parity bytes (16, 32 or 64).il2ptxIL2P transmission (
IL2PTX), withinvert(-) to invert the polarity,maxfec: false(0) for the weaker FEC, andcrc: false(c) to leave out the CRC.il2ptx: {}turns it on with the defaults. Given along withfx25tx, IL2P wins.il2pversionThe IL2P version (
IL2PVERSION):0.4,0.6orcompat.modemThe modem (
MODEM):speed- bits per second, orAISorEAS. Quote it, as"1200".type-bpskorg3ruh, whatever the default for the speed.tones-markandspacein Hz for AFSK.decoders-countdecoders,offsetHz apart.divide- sample rate division factor, 1 to 8.upsample- upsample ratio for G3RUH, 1 to 4.profiles- demodulator profile letters, such asA+.v26-aorb, the V.26 alternative for 2400 bps.
ptt,dcd,conThe output controls (
PTT,DCD,CON).methodis one of:serial-device,line(rtsordtr), and optionallyline2.gpio-pin.gpiod-device(the GPIO chip) andpin.lpt-pin, the bit number.rig- hamlib:model(a number, orauto),device, and optionallyrate.cm108- optionallypin(3 if left out) anddevice.
invertdrives the pin or line low to transmit, where Dire Wolf’s format has a-in front of it;invert2does the same forline2.
agwPortThe port for the AGW TCPIP Socket Interface (
AGWPORT), or 0 for none.kissPortsKISS TCP ports (
KISSPORT), each withportand optionallychannel, to give that port just one radio channel. They are taken in order, like successiveKISSPORTlines, soport: 0first drops the default port 8001.axudpPortsAXUDP ports: AX.25 frames to and from other nodes (BPQ, XRouter, another Samoyed, …) as UDP datagrams, each port a virtual channel of its own, as
NCHANNELmakes one for a network TNC. These have no equivalent in Dire Wolf’s format. Each has:portThe local UDP port, listened on and sent from.
channelThe virtual channel, outside the radio channels’ range, and not otherwise in use.
mapsWhere frames go, each with
ax25addr, the destination, andhostandport, the node to send it to. An address with no SSID matches any SSID of that callsign, unless another entry names the SSID itself.broadcast: truealso sends the node frames for the broadcast addresses, like theBon a BPQMAPline.broadcastThe destinations, such as NET/ROM’s
NODES, whose frames go to every map withbroadcast: truerather than to one node, like BPQ’sBROADCASTlines.automaptruesends a frame for an address no map covers back to wherever a datagram from that address last came from, within the last hour, like BPQ’sAUTOADDMAP- so long as that datagram came from the IP address of a host inmaps, from any port. A node reached through a mapped neighbour can then connect without a map of its own. Maps always win over what is learned, and a learned node gets no broadcasts. Off by default.
Frames are sent with the RFC 1226 checksum appended; one on a received datagram is recognised and removed. Datagrams are accepted from anyone, not only the nodes in
maps, so the port should not be open to the internet at large.samoyed: axudpPorts: - port: 10093 channel: 10 broadcast: [NODES] automap: true maps: - {ax25addr: Q1TEST-2, host: node.example.org, port: 10093, broadcast: true} - {ax25addr: Q2TEST, host: 192.0.2.2, port: 93}
legacyDirectives in Dire Wolf’s format, one per line, read after everything else as though they were a file of their own - so a channel setting there needs its own
CHANNELline first. Use|to keep the lines apart, as in the example.
Things to look out for
A misspelt or unknown key is an error, not ignored, and a file with an error like that is not used at all.
A file holds one YAML document; a second one (after
---) is an error.Values containing a comma, such as ALSA device names like
plughw:1,0, must be quoted inside{...}, where a comma separates entries.Complaints give the line in the YAML file, including for the
legacyblock.