User Tools

Site Tools


packet:kernel-ax25-pi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
packet:kernel-ax25-pi [2023/04/15 22:13] – [Startup Scripts] m0ltepacket:kernel-ax25-pi [2023/04/16 23:40] (current) – Updating m0gzp
Line 72: 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
 <code> <code>
-v144    M0GZP-1         19200   236     4       144.375 Mhz 1k2bps +VHF     M0GZP-1         19200   255     4       144.375 Mhz 1k2bps 
-HF      M0GZP-2         19200   236     4       HF 300bps+HF      M0GZP-2         19200   200     4       HF 300bps
 </code> </code>
  
Line 79: Line 79:
 This file sets up a NET/ROM port aliased as GZPNOD This file sets up a NET/ROM port aliased as GZPNOD
 <code> <code>
-netrom  M0GZP-7 GZPNOD  236     Linux Switch Port+nrvhf   M0GZP-5 GZPVHF  235     VHF NET/ROM Port 
 +nrhf    M0GZP-6 GZPHF   40      HF NET/ROM Port
 </code> </code>
  
Line 85: Line 86:
  
 === nrbroadcast === === nrbroadcast ===
-This file configures how our AX.25 ports will broadcast NET/ROM nodes.  My VHF node sets all seen nodes to a default quality of 220, and will broadcast any node with a minimum quality of 200.  The HF node on the other hand sets all nodes to a default quality of 199 (so as not to advertise HF nodes over VHF), and will broadcast nodes with a minimum quality of 199.+This file configures how our AX.25 ports will broadcast NET/ROM nodes.  My VHF node sets all seen nodes to a default quality of 220, and will broadcast any node with a minimum quality of 200.  The HF node on the other hand sets all nodes to a default quality of 200 (so as not to advertise HF nodes over VHF), and will broadcast nodes with a minimum quality of 200.
 <code> <code>
-v144    5       220     200     1 +VHF     5       200     200     1 
-HF      5       199     199     1+HF      5       220     200     1 
 +</code> 
 + 
 +=== 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. 
 +<code> 
 +[M0GZP-1 via VHF] 
 +NOCALL   * * * * * *  L 
 +default  * * * * * *  0 root  /usr/local/sbin/uronode   uronode 
 + 
 +[M0GZP-2 via HF] 
 +NOCALL   * * * * * *  L 
 +default  * * * * * *  0 root  /usr/local/sbin/uronode   uronode 
 + 
 +<nrhf> 
 +NOCALL   * * * * * *  L 
 +default  * * * * * *  0 root  /usr/local/sbin/uronode   uronode 
 + 
 +<nrvhf> 
 +NOCALL   * * * * * *  L 
 +default  * * * * * *  0 root  /usr/local/sbin/uronode   uronode
 </code> </code>
  
Line 101: Line 122:
   * Load the ''netrom'' module and attach it to the port defined in nrports   * Load the ''netrom'' module and attach it to the port defined in nrports
   * 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
 <code> <code>
 #!/bin/bash #!/bin/bash
Line 109: Line 133:
 echo Done echo Done
 echo -n Attaching KISS interfaces for direwolf... echo -n Attaching KISS interfaces for direwolf...
-kissattach `ls -l /tmp/kiss8001 | awk '{ print $11 }'v144+kissattach -l `ls -l /tmp/kiss8001 | awk '{ print $11 }'VHF
 sleep 1 sleep 1
-kissattach `ls -l /tmp/kiss8002 | awk '{ print $11 }'` HF+kissattach -l `ls -l /tmp/kiss8002 | awk '{ print $11 }'` HF
 sleep 1 sleep 1
 echo Done echo Done
 echo -n 'Bringing up NET/ROM runtime...' echo -n 'Bringing up NET/ROM runtime...'
 modprobe netrom modprobe netrom
-nrattach netrom+nrattach nrvhf 
 +nrattach nrhf
 netromd -i -l -d netromd -i -l -d
 echo -n Restoring node tables... echo -n Restoring node tables...
 [ -x /etc/ax25/nodesave.sh ] && /etc/ax25/nodesave.sh [ -x /etc/ax25/nodesave.sh ] && /etc/ax25/nodesave.sh
 +echo Done
 +echo -n Starting mheard daemon...
 +mheardd -l
 +echo Done
 +echo -n Starting ax25 daemon...
 +ax25d -l
 echo Done echo Done
 </code> </code>
Line 139: Line 170:
 echo Done echo Done
 </code> </code>
 +
 +NB this script appears to run before /dev/ttyACM0 is available, so currently doesn't work. I'm coming up with a fix.
  
 === /usr/sbin/stopRadio.sh === === /usr/sbin/stopRadio.sh ===
Line 144: Line 177:
 <code> <code>
 #!/bin/bash #!/bin/bash
-echo Saving node tables...+echo -n Saving node tables...
 /usr/sbin/nodesave > /etc/ax25/nodesave.sh && chmod 755 /etc/ax25/nodesave.sh /usr/sbin/nodesave > /etc/ax25/nodesave.sh && chmod 755 /etc/ax25/nodesave.sh
-echo Killing all kissattach processes +echo Done 
-killall kissattach +echo -n Killing mheard daemon... 
-echo Killing all socat processes in case they do not end cleanly+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 killall socat
-echo Killing the netromd process+sleep 1 
 +echo Done 
 +echo -n Killing all kissattach processes... 
 +killall kissattach 
 +sleep 1 
 +echo Done 
 +echo -n Killing the netromd process...
 killall netromd killall netromd
-echo Taking down the netrom interface+sleep 1 
 +echo Done 
 +echo -n Taking down the netrom interface...
 ifconfig nr0 down ifconfig nr0 down
-echo Removing kernel modules +sleep 1 
-rmmod netrom +echo Done 
-rmmod mkiss +echo -n Removing kernel modules... 
-rmmod ax25 +rmmod netrom && sleep 1 && rmmod mkiss && sleep 1 && rmmod ax25 && sleep 1 
-echo Taking down the AX.25 interfaces+echo Done 
 +echo -n 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 ifconfig ax1 > /dev/null 2>&1 && ifconfig ax1 down
 +sleep 1
 echo Done echo Done
 </code> </code>
Line 183: Line 233:
 ifconfig ax0 > /dev/null 2>&1 && ifconfig ax0 down ifconfig ax0 > /dev/null 2>&1 && ifconfig ax0 down
 echo Done echo Done
 +</code>
 +
 +Don't forget to make these scripts executable:
 +
 +<code>
 +chmod +x /usr/sbin/startRadio.sh
 +chmod +x /usr/sbin/stopRadio.sh
 </code> </code>
  
Line 190: Line 247:
 [Unit] [Unit]
 Description=Start up radio processes Description=Start up radio processes
 +After=direwolf.service
 +Requires=direwolf.service
  
 [Service] [Service]
Line 208: Line 267:
 ● ax25.service - Start up radio processes ● ax25.service - Start up radio processes
      Loaded: loaded (/lib/systemd/system/ax25.service; disabled; vendor preset: enabled)      Loaded: loaded (/lib/systemd/system/ax25.service; disabled; vendor preset: enabled)
-     Active: active (exited) since Wed 2023-04-12 22:16:27 BST; 4s ago +     Active: active (exited) since Mon 2023-04-17 00:36:38 BST; 7s ago 
-    Process: 2476 ExecStart=/usr/sbin/startRadio.sh (code=exited, status=0/SUCCESS) +    Process: 3036 ExecStart=/usr/sbin/startRadio.sh (code=exited, status=0/SUCCESS) 
-   Main PID: 2476 (code=exited, status=0/SUCCESS) +   Main PID: 3036 (code=exited, status=0/SUCCESS) 
-      Tasks: (limit: 4915) +      Tasks: (limit: 4915) 
-        CPU: 151ms+        CPU: 156ms
      CGroup: /system.slice/ax25.service      CGroup: /system.slice/ax25.service
-             ├─2477 socat pty,echo=0,link=/tmp/kiss8001,wait-slave tcp:127.0.0.1:8001 +             ├─3037 socat pty,echo=0,link=/tmp/kiss8001,wait-slave tcp:127.0.0.1:8001 
-             ├─2478 socat pty,echo=0,link=/tmp/kiss8002,wait-slave tcp:127.0.0.1:8002 +             ├─3038 socat pty,echo=0,link=/tmp/kiss8002,wait-slave tcp:127.0.0.1:8002 
-             ├─2486 kissattach /dev/pts/v144 +             ├─3047 kissattach -l /dev/pts/VHF 
-             ├─2501 kissattach /dev/pts/HF +             ├─3061 kissattach -l /dev/pts/HF 
-             2519 netromd -i -l -d+             3089 netromd -i -l -d 
 +             ├─3099 mheardd -l 
 +             └─3104 ax25d -l
  
-Apr 12 22:16:25 radio startRadio.sh[2483]: AX.25 port v144 bound to device ax0 +Apr 17 00:36:38 radio startRadio.sh[3077]: NET/ROM port nrvhf bound to device nr0 
-Apr 12 22:16:25 radio startRadio.sh[2486]: AX.25 port v144 bound to device ax0 +Apr 17 00:36:38 radio startRadio.sh[3082]: NET/ROM port nrhf bound to device nr1 
-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:~ $ 
 </code> </code>
Line 235: 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):
 <code> <code>
-ax0: flags=67<UP,BROADCAST,RUNNING>  mtu 236+ax0: flags=67<UP,BROADCAST,RUNNING>  mtu 255
         ax25 M0GZP-1  txqueuelen 10  (AMPR AX.25)         ax25 M0GZP-1  txqueuelen 10  (AMPR AX.25)
         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  bytes 77 (77.0 B)+        TX packets  bytes 49 (49.0 B)
         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<UP,BROADCAST,RUNNING>  mtu 236+ax1: flags=67<UP,BROADCAST,RUNNING>  mtu 200
         ax25 M0GZP-2  txqueuelen 10  (AMPR AX.25)         ax25 M0GZP-2  txqueuelen 10  (AMPR AX.25)
         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  bytes 77 (77.0 B)+        TX packets  bytes (0.0 B)
         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<UP,RUNNING,NOARP>  mtu 236 +nr0: flags=193<UP,RUNNING,NOARP>  mtu 235 
-        netrom M0GZP- txqueuelen 1000  (AMPR NET/ROM)+        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<UP,RUNNING,NOARP>  mtu 40 
 +        netrom M0GZP-6  txqueuelen 1000  (AMPR NET/ROM)
         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 258: Line 326:
  
 You can now use ''axcall'' to contact another node, ''axlisten'' to monitor traffic, etc. You can now use ''axcall'' to contact another node, ''axlisten'' to monitor traffic, etc.
 +
 +If it was all successful, enable the service to start at boot:
 +
 +<code>
 +sudo systemctl enable ax25.service
 +</code>
packet/kernel-ax25-pi.1681596809.txt.gz · Last modified: 2023/04/15 22:13 by m0lte