GB7HIB Config & Setup
GB7HIB
GB7HIB is my permanent packet radio node, living at my house in the woods atop a hill near Aberdeen! Ofcom’s details for this station are held on ukrepeater
It is accessible on 432.6250MHz, and is currently operating on legacy 1200bd. I am very excited to play with new, higher speed modes - The station was commissioned at and tested at 9600bd, and I am excited to play with new speeds as time, equipment and my userbase, allows!
Radio Hardware & RF Path
Radio
The Radio itself is a Motorola GM340, powered by a Motorola provided PSU capable of backup with a 12V SLAB battery.
Antenna System
The Antenna is a Diamond V-2000,which offers ‘8.4dB’ from the manufacturer, or as Ofcom see it 6.25dB. This difference will be dBi vs dBd. The antenna is mounted on a ~10m mast which is anchored to the side of my house, and the base of the antenna is around 10m AGL.
It’s fed with around 12m of M&P Hyperflex 5 cable. The coax has a characteristic loss of -17dB/100m, so I should only see 2dB loss (plus a little fuzz for connectors, I assume 0.3dB/connector… ish).
The coax and antenna combined with my enviable location give me a great takeoff to the north and south, allowing packet digipeating and reception through the city and towards many of the towns north like Newmachar or Udny.
I also hold a good takeoff to the West, hopefully allowing for packet access from the cairngorm mountains, but being out that far might require some gain.
The coaxial terminates in a Diamond MX-2000 Triplexer to allow me to use my antenna for 2m, this 70cm packet station and 6m simultaneously.
Output Power
My Notice of Variation, the license for the station, specified my maximum power output is 7dBW (7 decibel watts, which is 7dB over 1W, or 5W actual EIRP). The power budget for the system looks like this:
Item | Power | dB |
---|---|---|
Radio | 2.5W | 4dBW |
Cable | N/A | -2 dB |
Connectors & Triplexer | N/A | -1 dB |
Antenna | N/A | 6.25dB |
Total | N/A | 7dBW |
TNC
The TNC, or ‘modem’, depending on how you squint at it, is a NinoTNC.
The NinoTNC is a KISS TNC capable of multiple speeds and modes - when I received it, 300, 1200 and 9600bd were the primary speeds, but there is active work on new higher speeds and intermediate speeds by Nino KK4HEJ. It’s an exciting design and I am really enjoying using it on both HF and UHF. I can’t wait for the rumoured higher speeds coming soon…
At the moment, the TNC is in 1200bd mode with legacy AX25 to get my local users up to speed with packet, but as I have a 25kHz channel from Ofcom, I intend to run at 9600bd and beyond when technology permits.
Software Stack
Raspberry Pi OS
At the moment, I’m running Raspi OS 11 (although I have a feeling 12 is about to release any day) armhf/32bit on a raspberry pi 4.
From here out, I will refer to a lot of packages and put them in codeblocks
. Assume that you can apt install package
and it will appear on your Debian / Debian based distro.
Linux Native ax.25 Stack
I am running the tools that are native to linux, as I work on maintaining them in Debian. The packages are available in Ubuntu, Raspbian, Mint and other Debian derivatives, depending on how they mirror the archive!
The base tools are all contained within the hamradio-packetmodes
metapackage, but if you want to install a minimal setup, you can install ax25-tools ax25-apps
. I also have uronode
and fbb
installed - the former provides the interface/shell through which I and others access the node and the latter is the Bulletin Board/Personal Mailbox I run.
Each of the below components are required to make the complete node, but they are (generally) not all interdependent, and most of the unique components will work to make a stripped down version.
ax25
axports
Setting up basic ax25 on Debian is relatively simple - the key file to edit here is /etc/ax25/axports
.
GB7HIB currently runs the following below config. Each port has been given an internal reference, I like to detail what connection they are providing. Other people map them out by number or other methods, but I find having a pretty consistent set of references to the radio/interface I’m using keeps my brain in check.
The callsign&SSID is the physical address for the port, akin to a MAC address. It shows under ifconfig
as a mac address for the link.
Speed is the speed of the serial port on the interface. In the case of the NinoTNC, this is 57600.
Paclen is the packet length - for V/UHF links, 255 bytes is a nice length. For HF, 60-80 is more common. It means for shorter packets that aren’t as likely to be impacted by changes in propagation.
Window is the number of packets that can be sent in one burst. The more reliable the link,the higher the number. This is limited by the version of ax25 you’re running - 2.0 has a lower window than 2.0. If you’re running Linux, at the moment you’re on ax25 2.0.
hibby@raspberrypi:~ $ cat /etc/ax25/axports
# /etc/ax25/axports
#
# The format of this file is:
#
# name callsign speed paclen window description
#
uhf GB7HIB-10 57600 255 2 UHF 9600bd
ip GB7HIB-11 115200 255 7 IP
kissattach
kissattach
binds the axport to a physical kiss device.
I attach my UHF port to my NinoTNC with:
kissattach /dev/ttyACM0 uhf
systemd
I have a systemd startup script of the below to bring this up at boot time:
hibby@raspberrypi:/etc/openvpn $ cat /etc/systemd/system/kiss-tnc.service
[Unit]
Description=AX25 KISS TNC
[Service]
ExecStart=/usr/sbin/kissattach /dev/ttyACM0 uhf
ExecStop=/usr/bin/pkill -f 'kissattach /dev/ttyACM0'
TimeoutStopSec=5
[Install]
WantedBy=multi-user.target
axcall
With the basic port configured, you can use axcall
to place a call.
hibby@raspberrypi:~ $ axcall uhf gm0nrt-7
calls my neighbour bill over layer 2/ax.25 point to point.
You can go via someone too as a digipeter, axcall uhf gm0cqv-7 via gm0nrt
calls gm0cqv using gm0nrt as a digipeter!
ax25ipd
ax25ipd
manages point to point links over IP between myself and other stations. These can be UDP and TCP.
There are a couple of parts needed to make this work as an interface on my system - socat
, ax25ipd
and kissattach
.
socat
I create a socket pair to connect ax25ipd
and kissattach
to connect the ip
ax25 port to the axudp tunnel.
This is brought up at boottime by systemd:
hibby@raspberrypi:~ $ cat /etc/systemd/system/kiss-socat-axip.service
[Unit]
Description=Socat interconnect for AX25 AXIP
After=network-online.target
Wants=network-online.target
[Service]
WorkingDirectory=/var/ax25
ExecStart=socat -d -d -ly pty,raw,echo=0,link=/var/ax25/pty/axip1 pty,raw,echo=0,link=/var/ax25/pty/axip2
ExecStartPost=/usr/bin/bash -c 'while ! [ -h /var/ax25/pty/axip2 ]; do sleep 1 ; done'
ExecStopPost=rm /var/ax25/pty/axip1 /var/ax25/pty/axip2
[Install]
WantedBy=multi-user.target
ax25ipd.conf
ax25ipd.conf
is the core configuration file for this component. Below you can see that I connect to udp port 10095 of the remote station, and locally ax25ipd is in ’tnc’ mode, binding to the previously created axip1
. The route allows broadcasts b
and is my default route d
.
I beacon what the station is periodically, and I also allow NET/ROM NODES broadcasts and FBB broadcasts to go over the link.
hibby@raspberrypi:~ $ cat /etc/ax25/ax25ipd.conf
socket udp 10095
mode tnc
device /var/ax25/pty/axip1
speed 115200
loglevel 2
beacon after 3600
loglevel 2
btext ax25ip -- hibby/GB7HIB-2 -- AXIP Interface
broadcast QST-0 NODES-0 FBB-0
route MM3NDH 10.13.37.2 bd
The systemd entry for this is:
hibby@raspberrypi:~ $ cat /etc/systemd/system/ax25ipd.service
[Unit]
Description=AX.25 over IP (AXIP) daemon
After=network.target
StartLimitInterval=0
[Service]
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/sbin/ax25ipd
[Install]
WantedBy=multi-user.target
kissattach
I need to kissattach the ip port to the pty created earlier by socat. I use systemd to do this at boot, and I use a systemd trick for this:
To enable the below, i ran sudo systemctl enable kiss-tnc@ip.service
You’ll notice that the override.conf defines not only $TNC_TTY as the port that was created earlier but also that this must run after socat-axip.service.
hibby@raspberrypi:~ $ cat /etc/systemd/system/kiss-tnc@.service
[Unit]
Description=AX25 KISS TNC %I
[Service]
ExecStart=/usr/sbin/kissattach $TNC_TTY %i
ExecStop=pkill -f "kissattach $TNC_TTY %i"
ExecStartPost=/usr/bin/bash -c 'while ! /usr/sbin/kissparms -c 1 -p %i; do sleep 1; done'
TimeoutStopSec=5
[Install]
WantedBy=multi-user.target
hibby@raspberrypi:~ $ cat /etc/systemd/system/kiss-tnc@ip.service.d/override.conf
[Unit]
After=kiss-socat-axip.service
[Service]
Environment=TNC_TTY=/var/ax25/pty/axip2
NET/ROM
NET/ROM covers functionality analogous to OSI layer3/layer 4.
What it means in reality is that my node has a knowledge of its neighbours and what their neighbours are, and automates routing calls. To use the earlier example, I can call directly to gm0cqv and my machine will know the best path -
axcall nrnod GM0CQV-7
Each NET/ROM sends a ‘NODES’ broadcast periodically. This details what systems it can hear, what the gateway to the remote nodes is and a ‘quality’ value. Nodes on the network can have an alias too - GM0CQV’s node on -7 above is PTRNOD, so I can do the following -
axcall nrnod PTRNOD
and end up at the same location.
NET/ROM ports are largely independent of ax25 ports in that a user can call any given nrport without going through a specific axport. You can essentially define per-application nrports, and as many as you wish (assuming you have free unique SSIDs to offer them as mac addresses).
nrports
/etc/ax25/nrports
,similar to axports, defines the netrom ports the system has available. I expect primary incoming connections to be through netrom, so mine are lower numbered.
netrom ports should not share SSID numbers with axports. This will make your system rather unstable.
hibby@raspberrypi:~ $ cat /etc/ax25/nrports
# /etc/ax25/nrports
#
# The format of this file is:
#
# name callsign alias paclen description
#
nrnod GB7HIB-1 HIBNOD 235 Netrom node Port
nrbbs GB7HIB-2 HIBBBS 235 Netrom BBS Port
I have a port for my service, the callsign and port, and an up to 6 letter alias for the service. The packet length is 20 bytes shorter than the ax25 packet to account for overheads, and then there’s a wee description.
nrbroadcast
/etc/ax25/nrbroadcast
defines how often netromd
sends a NODES broadcast and what port it sends them over.
It also defines the default quality of stations received directly over that port, the worst quality it will broadcast, how long without hearing a nodes broadcast the station will remain in your routing table.
I have set some sensible defaults, things that come over the ip link are quite high, but I limit the worst quality so that my NODES table isn’t too big.
hibby@raspberrypi:~ $ cat /etc/ax25/nrbroadcast
# /etc/ax25/nrbroadcast
#
# The format of this file is:
#
# ax25_name min_obs def_qual worst_qual verbose
#
uhf 5 192 100 1
ip 3 200 130 1
nrattach
Like kissattach, we need to nrattach.
nrattach
is simple - you nrattach a port and that’s it.
nrattach nrnod
I use the systemd @ trick again so I can
systemctl enable nrattach@nrnod
for it to repeatedly come up at boot time!
hibby@raspberrypi:~ $ cat /etc/systemd/system/nrattach@.service
[Unit]
Description=AX.25 NET/ROM interface %I
After=network.target
StartLimitInterval=0
[Service]
Type=oneshot
ExecStart=/usr/sbin/nrattach %i
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
netromd
netromd
handles incoming and outgoing broadcasts.
I should really make this systemd unit come up after nrattach.
hibby@raspberrypi:~ $ cat /etc/systemd/system/netromd.service
[Unit]
Description=NET/ROM routing daemon
After=network.target
StartLimitInterval=0
[Service]
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/sbin/netromd -i -l -d -t 30
[Install]
WantedBy=multi-user.target
ax25d
ax25d is the Daemon that routes incoming connection requests and spins up a process for the caller.
Interestingly, it isn’t tied to the incoming port that the call is coming through, so you can have any port or interface handle calls to any callsign, alias or other word.
/etc/ax25/ax25d.conf
is the config file that controls this, and it handles ax25 ports and netrom ports slightly differently. The default config is full of great examples - mine is configured as below.
Reading it, you can see that GB7HIB is in [] and nrnod is in <>. They define the type of port. This means if you connect to GB7HIB over ax25, you get uronode. If you connect to HIBNOD, or GB7HIB-1 over netrom, you get uronode!
I am really interested in exploring some other applications, including axspawn
, which lets you spawn a bash (or other) shell and effectively gives shell access over ax25/netrom to a user.
There’s lots of options here, and it’s an incredibly flexible piece of software and is the core of why the Linux stack is so interesting to me. You can present any binary on your system to a connecting user!
hibby@raspberrypi:~ $ cat /etc/ax25/ax25d.conf
# /etc/ax25/ax25d.conf
#
# ax25d Configuration File.
#
# AX.25 Ports begin with a '['.
#
[GB7HIB via uhf]
NOCALL * * * * * * L
default * * * * * * - root /usr/sbin/uronode uronode
#
[GB7HIB via ip]
NOCALL * * * * * * L
default * * * * * * - root /usr/sbin/uronode uronode
#
# NET/ROM Ports begin with a '<'.
#
<nrnod>
NOCALL * * * * * * L
default * * * * * * - root /usr/sbin/uronode uronode
#
systemd
You bet I start this with systemd!
I should make it come up after all the ports are done, but it works so why change it!
hibby@raspberrypi:~ $ cat /etc/systemd/system/ax25d.service
[Unit]
Description=ax25 daemon
After=network.target
StartLimitInterval=0
[Service]
Type=simple
Restart=always
RestartSec=5
ExecStart=ax25d
[Install]
WantedBy=multi-user.target
Uronode Frontend
I use uronode both as a frontend for users connecting and for me connecting to the node and to neighbouring stations, essentially over telnet.
uronode.conf
This is the core config file for uronode that details what uronode can do. I’m running mine very stripped back, and have cut a lot of the defaults out:
You can see the BBS command is just a uronode call out to GB7HIB-2 over netrom, and there are external commands for netstat and the ’nodesearch’ program I quite like.
The rest is pretty much default.
hibby@raspberrypi:~ $ cat /etc/ax25/uronode.conf
# /etc/ax25/uronode.conf - URONode example configuration file
#
# see uronode.conf(5)
# "Local" network.
# This is your local amprnet subnet in full. Do NOT use 44.0.0.0/8!
LocalNet 10.66.66.0/24
# Command aliases. See uronode.conf(5) for the meaning of the uppercase
# letters in the name of the alias. Examples below:
Alias BBS "c GB7HIB-2"
# External commands. See uronode.conf(5) for the meaning of the uppercase
# letters in the name of the extcmd.
#
# Flags: 1 Run command through pipe
# 2 Reconnected flag
# 3 Run through pipe and reconnect
#
ExtCmd NEtstat 3 nobody /bin/netstat netstat --ax25 --netrom
ExtCmd NSearch 3 root /usr/local/bin/nodesearch nodesearch %1
# Node ID.
# This displays before all output texts when the user connects into
# your node via NetRom. Set to "" to leave blank.
# Note: This -must- be defined or will display as "(null)". A space
# is hardcoded in. Example: UROHUB:N1URO-2 do NOT add the bracket
# afterwards "}" this is predefined in URONode.
#
NodeId HIBNOD:GB7HIB-1
# Ax25/Flex ID.
# This displays before some strings and at logout to the end user when
# they connect in via ax25 as defined in your ax25d.conf file. If
# you don't define this "(null)" will be presented to the end user. Its
# suggested you take this from your ax25d config which either faces a
# flexnet system OR your 2-meter user interface. Note: do NOT make this
# ssid the same as your NetRom SSID here or in ax25d.conf.
FlexId GB7HIB-10
# Netrom port name. This port is used for outgoing netrom connects.
NrPort nrnod
ReConnect on
# Syslog Logging level - suggest leaving this at 3 for debugging. 0
# halts logging.
LogLevel 3
PassPrompt "yes"
# The default escape character (CTRL-T)
#
EscapeChar ^T
Other Uronode Config Files
I have modified some other files that are worth highlighting -
uronode.perms
I have added the below line which allows me to login without password from the localhost by starting from shell and gets me nice colours!
mm0rfn host * * 255
uronode.announce
This has local announcements in it!
uronode.info
This has information about the system in it
uronode.motd
This is the welcome message displayed on every login
uronode.users
This defines shell access for me as a sysop. I’ve never actually spawned a shell from uronode, but apparently it’s possible?!
Uronode as a local interface
I use uronode as my local packet radio terminal - instead of turning on and typing axcall nrnod salbbs
to get to gm0nrt, I log in, type uronode, feed it my callsign and I am met with the uronode command interface, from which I can type c salbbs
. It’s a much nicer place to be!
This required xinetd
for me to set up easily.
xinetd config
I think the below two config files are the only things required to make uronode listen on port 3964 -
xinetd
must be enabled and started by systemd to be listening (systemctl enable xinetd
, systemctl start xinetd
)
There is probably a systemd native way of doing this, but I couldn’t see that in the docs.
hibby@raspberrypi:~ $ cat /etc/xinetd.d/uronode
service uronode
{
disable = no
socket_type = stream
protocol = tcp
user = root
server = /usr/sbin/uronode
wait = no
instances = 20
}
hibby@raspberrypi:~ $ cat /etc/services | grep uronode
uronode 3694/tcp # Uronode
FBB BBS
fbb
is my BBS software of choice! It is an oddity in that it binds directly to the ports you tell it exist, so it’s listening on my ax25 and netrom ports without an entry in ax25d.conf
. This mostly seems like magic to me and I am happy to let it run this way!
It has a few config files - fbb.conf, which is populated by the first run, ports.sys
which defines the ports available and then bbs.sys
and forward.sys
which defines how you route to the outside world.
ports.sys
My reference for this file was this website, which was a helpful resource!
I have incremented the number of TNCs where appropriate and added my ports as 1,2,3. I have left the COM 1 Interface 9 etc alone.
hibby@raspberrypi:~ $ cat /etc/ax25/fbb/port.sys
# FBB7.0.11
#
#Ports TNCs
1 3
#
#Com Interface Adress (Hex) Baud
1 9 **** 9600
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
0 0 0 0 0 0 0 0 00/01 ---- File-fwd.
1 8 1 uhf 250 2 1 10 00/15 XUWYL 433.6250
2 8 1 ip 250 2 1 10 00/15 XUWYL ip port
3 8 1 nrbbs 236 2 1 10 00/15 XUWYL netrom port
#
# End of file.
#
bbs.sys, forward.sys
The Documentation is the best reference I’ve got for it, and I can’t improve upon it.
systemd to tie it together
I followed this guide from PD9Q to get fbb running under systemd, and it has done the job rather nicely!
Conclusion
I think that’s all of it. This post will get gentle updates and refinements as I work out what I’ve missed and what’re mistakes, but it’s quite a lot of information to commit to the internet for one night!
References
mquin’s gist proved important for working out systemd and ax25ipd
.
Tags: Debian Raspberry Pi Packet