packet:kernel-ax25-pi
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
packet:kernel-ax25-pi [2023/04/15 21:46] – m0lte | packet:kernel-ax25-pi [2023/04/16 23:40] (current) – Updating m0gzp | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Raspberry Pi and Linux Kernel AX.25 support ===== | ===== Raspberry Pi and Linux Kernel AX.25 support ===== | ||
- | This page documents how to set up a Raspberry Pi running Raspberry Pi OS Lite (32 bit). | + | This page documents how to set up a Raspberry Pi running Raspberry Pi OS Lite (32 bit), and was written by Szymon M0GZP. |
It is possible to do this on 64 bit Raspberry Pi OS as well, so long as you are consistently using 32 bit or 64 bit throughout; see the notes below. | It is possible to do this on 64 bit Raspberry Pi OS as well, so long as you are consistently using 32 bit or 64 bit throughout; see the notes below. | ||
Line 24: | Line 24: | ||
==== Software Prereqs ==== | ==== Software Prereqs ==== | ||
'' | '' | ||
+ | |||
+ | You do not need to install socat or direwolf packages if you will be using a hardware TNC such as NinoTNC. | ||
Notes: | Notes: | ||
* make absolutely certain that you are using a 32bit kernel if you have 32bit user binaries. | * make absolutely certain that you are using a 32bit kernel if you have 32bit user binaries. | ||
- | * you may need to use '' | + | * you currently |
==== TNC ==== | ==== TNC ==== | ||
- | I use Direwolf | + | The author uses Dire Wolf to run the two radios. |
+ | |||
+ | Here is a suitable Dire Wolf config: | ||
< | < | ||
Line 68: | Line 72: | ||
This file sets up two AX.25 ports, one for VHF and one for HF | This file sets up two AX.25 ports, one for VHF and one for HF | ||
< | < | ||
- | v144 | + | VHF M0GZP-1 |
- | HF M0GZP-2 | + | HF M0GZP-2 |
</ | </ | ||
Line 75: | Line 79: | ||
This file sets up a NET/ROM port aliased as GZPNOD | This file sets up a NET/ROM port aliased as GZPNOD | ||
< | < | ||
- | netrom | + | nrvhf M0GZP-5 GZPVHF |
+ | nrhf M0GZP-6 GZPHF | ||
</ | </ | ||
+ | |||
+ | NOTE: nrports cannot contain any blank lines. | ||
=== nrbroadcast === | === nrbroadcast === | ||
- | This file configures how our AX.25 ports will broadcast NET/ROM nodes. | + | This file configures how our AX.25 ports will broadcast NET/ROM nodes. |
< | < | ||
- | v144 | + | VHF 5 200 200 1 |
- | HF 5 199 | + | HF 5 220 |
+ | </ | ||
+ | |||
+ | === ax25d.conf === | ||
+ | This file configures the ax25 userspace daemon, which determines what processes are run when other users connect in to the node. In my example, I am calling the program uronode (by N1URO, sadly SK). A separate entry is required for each port. | ||
+ | < | ||
+ | [M0GZP-1 via VHF] | ||
+ | NOCALL | ||
+ | default | ||
+ | |||
+ | [M0GZP-2 via HF] | ||
+ | NOCALL | ||
+ | default | ||
+ | |||
+ | < | ||
+ | NOCALL | ||
+ | default | ||
+ | |||
+ | < | ||
+ | NOCALL | ||
+ | default | ||
</ | </ | ||
Line 95: | Line 122: | ||
* Load the '' | * Load the '' | ||
* Run the netrom userspace daemon which handles the netrom broadcasts | * Run the netrom userspace daemon which handles the netrom broadcasts | ||
+ | * Load previous netrom node tables | ||
+ | * Run the mheard daemon which keeps track of heard stations | ||
+ | * Run the ax25 daemon to support running services | ||
< | < | ||
#!/bin/bash | #!/bin/bash | ||
Line 103: | Line 133: | ||
echo Done | echo Done | ||
echo -n Attaching KISS interfaces for direwolf... | echo -n Attaching KISS interfaces for direwolf... | ||
- | kissattach `ls -l / | + | kissattach |
sleep 1 | sleep 1 | ||
- | kissattach `ls -l / | + | kissattach |
+ | sleep 1 | ||
+ | echo Done | ||
+ | echo -n ' | ||
+ | modprobe netrom | ||
+ | nrattach nrvhf | ||
+ | nrattach nrhf | ||
+ | netromd -i -l -d | ||
+ | echo -n Restoring node tables... | ||
+ | [ -x / | ||
+ | echo Done | ||
+ | echo -n Starting mheard daemon... | ||
+ | mheardd -l | ||
+ | echo Done | ||
+ | echo -n Starting ax25 daemon... | ||
+ | ax25d -l | ||
+ | echo Done | ||
+ | </ | ||
+ | |||
+ | For a modem other than Dire Wolf, an alternative script can be used: | ||
+ | |||
+ | < | ||
+ | # | ||
+ | echo -n Attaching KISS interfaces... | ||
+ | kissattach / | ||
sleep 1 | sleep 1 | ||
echo Done | echo Done | ||
Line 116: | Line 170: | ||
echo Done | echo Done | ||
</ | </ | ||
+ | |||
+ | NB this script appears to run before / | ||
=== / | === / | ||
This script does the opposite to startRadio, killing the processes and taking down the interfaces | This script does the opposite to startRadio, killing the processes and taking down the interfaces | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | echo -n Saving node tables... | ||
+ | / | ||
+ | echo Done | ||
+ | echo -n Killing mheard daemon... | ||
+ | killall mheardd | ||
+ | sleep 1 | ||
+ | echo Done | ||
+ | echo -n Killing ax25 daemon... | ||
+ | killall ax25d | ||
+ | sleep 1 | ||
+ | echo Done | ||
+ | echo -n Killing all socat processes in case they do not end cleanly... | ||
+ | killall socat | ||
+ | sleep 1 | ||
+ | echo Done | ||
+ | echo -n Killing all kissattach processes... | ||
+ | killall kissattach | ||
+ | sleep 1 | ||
+ | echo Done | ||
+ | echo -n Killing the netromd process... | ||
+ | killall netromd | ||
+ | sleep 1 | ||
+ | echo Done | ||
+ | echo -n Taking down the netrom interface... | ||
+ | ifconfig nr0 down | ||
+ | sleep 1 | ||
+ | echo Done | ||
+ | echo -n Removing kernel modules... | ||
+ | rmmod netrom && sleep 1 && rmmod mkiss && sleep 1 && rmmod ax25 && sleep 1 | ||
+ | echo Done | ||
+ | echo -n Taking down the AX.25 interfaces... | ||
+ | ifconfig ax0 > /dev/null 2>&1 && ifconfig ax0 down | ||
+ | ifconfig ax1 > /dev/null 2>&1 && ifconfig ax1 down | ||
+ | sleep 1 | ||
+ | echo Done | ||
+ | </ | ||
+ | |||
+ | For a modem other than Dire Wolf, an alternative script can be used: | ||
+ | |||
< | < | ||
#!/bin/bash | #!/bin/bash | ||
Line 125: | Line 222: | ||
echo Killing all kissattach processes | echo Killing all kissattach processes | ||
killall kissattach | killall kissattach | ||
- | echo Killing all socat processes in case they do not end cleanly | ||
- | killall socat | ||
echo Killing the netromd process | echo Killing the netromd process | ||
killall netromd | killall netromd | ||
Line 137: | Line 232: | ||
echo Taking down the AX.25 interfaces | echo Taking down the AX.25 interfaces | ||
ifconfig ax0 > /dev/null 2>&1 && ifconfig ax0 down | ifconfig ax0 > /dev/null 2>&1 && ifconfig ax0 down | ||
- | ifconfig ax1 > /dev/null 2>&1 && ifconfig ax1 down | ||
echo Done | echo Done | ||
+ | </ | ||
+ | |||
+ | Don't forget to make these scripts executable: | ||
+ | |||
+ | < | ||
+ | chmod +x / | ||
+ | chmod +x / | ||
</ | </ | ||
Line 146: | Line 247: | ||
[Unit] | [Unit] | ||
Description=Start up radio processes | Description=Start up radio processes | ||
+ | After=direwolf.service | ||
+ | Requires=direwolf.service | ||
[Service] | [Service] | ||
Line 164: | Line 267: | ||
● ax25.service - Start up radio processes | ● ax25.service - Start up radio processes | ||
| | ||
- | | + | |
- | Process: | + | Process: |
- | Main PID: 2476 (code=exited, | + | Main PID: 3036 (code=exited, |
- | Tasks: | + | Tasks: |
- | CPU: 151ms | + | CPU: 156ms |
| | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | └─2519 netromd -i -l -d | + | ├─3089 netromd -i -l -d |
+ | | ||
+ | | ||
- | Apr 12 22:16:25 radio startRadio.sh[2483]: AX.25 port v144 bound to device | + | Apr 17 00:36:38 radio startRadio.sh[3077]: NET/ |
- | Apr 12 22:16:25 radio startRadio.sh[2486]: AX.25 port v144 bound to device | + | Apr 17 00:36:38 radio startRadio.sh[3082]: NET/ |
- | Apr 12 22:16:26 radio startRadio.sh[2499]: AX.25 port HF bound to device ax1 | + | Apr 17 00:36:38 radio netromd[3089]: starting |
- | Apr 12 22:16:26 radio startRadio.sh[2501]: AX.25 port HF bound to device ax1 | + | Apr 17 00:36:38 radio startRadio.sh[3036]: Restoring node tables...Done |
- | Apr 12 22:16:27 radio startRadio.sh[2476]: Done | + | Apr 17 00:36:38 radio mheardd[3099]: starting |
- | Apr 12 22:16:27 radio startRadio.sh[2476]: Bringing up NET/ROM runtime... | + | Apr 17 00:36:38 radio startRadio.sh[3036]: Starting mheard daemon...Done |
- | Apr 12 22:16:27 radio startRadio.sh[2512]: NET/ROM port netrom bound to device nr0 | + | Apr 17 00:36:38 radio startRadio.sh[3036]: Starting ax25 daemon...Done |
- | Apr 12 22:16:27 radio netromd[2519]: starting | + | Apr 17 00:36:38 radio systemd[1]: Finished Start up radio processes. |
- | Apr 12 22:16:27 radio startRadio.sh[2476]: Restoring node tables...Done | + | Apr 17 00:36:38 radio ax25d[3104]: starting |
- | Apr 12 22:16:27 radio systemd[1]: Finished Start up radio processes. | + | Apr 17 00:36:38 radio ax25d[3104]: new config file loaded successfully |
szymon@radio: | szymon@radio: | ||
</ | </ | ||
Line 191: | Line 296: | ||
You will see some new network interfaces on ifconfig (I've removed my normal interfaces): | You will see some new network interfaces on ifconfig (I've removed my normal interfaces): | ||
< | < | ||
- | ax0: flags=67< | + | ax0: flags=67< |
ax25 M0GZP-1 | ax25 M0GZP-1 | ||
RX packets 0 bytes 0 (0.0 B) | RX packets 0 bytes 0 (0.0 B) | ||
RX errors 0 dropped 0 overruns 0 frame 0 | RX errors 0 dropped 0 overruns 0 frame 0 | ||
- | TX packets | + | TX packets |
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
- | ax1: flags=67< | + | ax1: flags=67< |
ax25 M0GZP-2 | ax25 M0GZP-2 | ||
RX packets 0 bytes 0 (0.0 B) | RX packets 0 bytes 0 (0.0 B) | ||
RX errors 0 dropped 0 overruns 0 frame 0 | RX errors 0 dropped 0 overruns 0 frame 0 | ||
- | TX packets | + | TX packets |
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
- | nr0: flags=193< | + | nr0: flags=193< |
- | netrom M0GZP-7 | + | netrom M0GZP-5 txqueuelen 1000 (AMPR NET/ROM) |
+ | RX packets 0 bytes 0 (0.0 B) | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 0 bytes 0 (0.0 B) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | |||
+ | nr1: flags=193< | ||
+ | netrom M0GZP-6 | ||
RX packets 0 bytes 0 (0.0 B) | RX packets 0 bytes 0 (0.0 B) | ||
RX errors 0 dropped 0 overruns 0 frame 0 | RX errors 0 dropped 0 overruns 0 frame 0 | ||
Line 214: | Line 326: | ||
You can now use '' | You can now use '' | ||
+ | |||
+ | If it was all successful, enable the service to start at boot: | ||
+ | |||
+ | < | ||
+ | sudo systemctl enable ax25.service | ||
+ | </ |
packet/kernel-ax25-pi.1681595163.txt.gz · Last modified: 2023/04/15 21:46 by m0lte