Systemd and Linfbb

I had some problems starting Linfbb with systemd. The problem turned out to be that Linfbb was running in the background. Systemd was thinking fbb was going offline and kept restarting. Now it is possible to provide start options with fbb.

Command line options of the fbb script :
—————————————-
-f : Software is run in foreground
-h : help information
-q : run silent
-l logfile : log debug info to logfile

Now I put the following in my fbb start file.

pd9q@packet:~/linbpq $ cat fbb.start
# Start Linfbb file
sudo /usr/local/sbin/fbb -f -l /home/pd9q/linbpq/fbb.log

The unit file for systemd.

pd9q@packet:~/linbpq $ cat /etc/systemd/system/fbb.service
[Unit]
Description=LinFbb Daemon
After=network.target
After=linbpq.target
After=direwolf.target
StartLimitInterval=0

[Service]
Type=simple
Restart=always
RestartSec=5
ExecStartPost=/bin/sh -c "echo $MAINPID > /home/pd9q/linbpq/run/fbb.pid"
ExecStart=/bin/sh /home/pd9q/linbpq/fbb.start

[Install]
WantedBy=multi-user.target
Alias=fbb.service

Systemctl status fbb

pd9q@packet:~/linbpq $ sudo systemctl status fbb
● fbb.service - LinFbb Daemon
   Loaded: loaded (/etc/systemd/system/fbb.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-10-27 06:04:57 UTC; 24min ago
  Process: 536 ExecStartPost=/bin/sh -c echo $MAINPID > /home/pd9q/linbpq/run/fbb.pid (code=exited, status=0/SUCCESS)
 Main PID: 535 (sh)
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/fbb.service
           ├─535 /bin/sh /home/pd9q/linbpq/fbb.start
           ├─541 sudo /usr/local/sbin/fbb -f -l /home/pd9q/linbpq/fbb.log
           ├─584 /bin/bash /usr/local/sbin/fbb -f -l /home/pd9q/linbpq/fbb.log
           └─826 /usr/local/sbin/xfbbd -a

Oct 27 06:05:02 packet sh[535]: 1 records updated
Oct 27 06:05:02 packet sh[535]: Files set-up complete
Oct 27 06:05:02 packet sh[535]: FORWARD set-up
Oct 27 06:05:02 packet sh[535]: BBS set-up
Oct 27 06:05:02 packet sh[535]: Set-up complete
Oct 27 06:05:02 packet sh[535]: GMT 06:05 - LOCAL 06:05
Oct 27 06:05:02 packet sh[535]: Starting multitasking ... ok
Oct 27 06:05:02 packet sh[535]: FBB options : -a
Oct 27 06:05:02 packet sh[535]: Running XFBB in foreground mode ^C to abort
Oct 27 06:05:07 packet sh[535]: Starting XFBB (pwd = /usr/local/var/ax25/fbb)...

Now is fbb running just fine. 

Monitor with Monit

A few days ago I posted a message about creating a pid file for linbpq. So that it becomes possible to monitor the process with watchdog.

You can read that here.

Now I use Monit to display this graphically. Why, because it looks nice. Now you immediately have an overview of running processes and their status.

The configuration file that I use for this.

/etc/monit/monitrc

## Start Monit in the background (run as a daemon):
#
  set daemon 300            # check services at 5-minute intervals
  set logfile /var/log/monit.log
  set pidfile /var/run/monit.pid
  set idfile /var/lib/monit/id
  set statefile /var/lib/monit/state

  set httpd port 2812
        use address 192.168.1.168
        allow 192.168.1.0/255.255.255.0
        allow admin:pancake

  set mailserver localhost               # primary mailserver

  set eventqueue
      basedir /var/lib/monit/events # set the base directory where events will be stored
      slots 100                     # optionally limit the queue size
  set alert pd9q@packet-radio.net                      # receive all alerts

  check system $HOST
    if loadavg (1min) > 4 then alert
    if loadavg (5min) > 2 then alert
    if cpu usage > 95% for 10 cycles then alert
    if memory usage > 75% then alert
    if swap usage > 25% then alert

  check process Linbpq with pidfile /home/pd9q/linbpq/run/linbpq.pid
  if changed pid then alert
  check file bpq32.cfg with path /home/pd9q/linbpq/bpq32.cfg

  check process Direwolf with pidfile /home/pd9q/linbpq/run/direwolf.pid
  if changed pid then alert
  check file direwolf.conf with path /home/pd9q/linbpq/direwolf.conf
 check host Router with address 192.168.1.1
    if failed ping then alert

  check network Eth0 with interface eth0
    if failed link then alert
    if changed link then alert
    if saturation > 90% then alert
    if download > 10 MB/s then alert
    if total uploaded > 1 GB in last hour then alert

check host Packet-radio.net with address packet-radio.net
      if failed icmp type echo count 5 with timeout 15 seconds
         then alert
      if failed port 80 proto http then alert
      if failed port 443 type TCPSSL proto http then alert
      alert pd9q@packet-radio.net

   include /etc/monit/conf.d/*
   include /etc/monit/conf-enabled/*

 

SCS released PMOM

Not sure if people saw this but SCS has released a program to monitor Pactor 1/2/3 transmissions even with B2F/LZHUF-compressed messages for the Raspberry Pi: 

https://www.p4dragon.com/en/PMON.html

David emailed them to see if they plan on releasing X86 versions and possibly packages for other distros like Ubuntu, Fedora, etc.  We’ll see what they say but this looks pretty cool!

Reaction of scs

Thank you for your inquiry.
Currently there is no plan to release PMON for other systems than Raspberry Pi. As also stated on the PMON web site, PACTOR-4 will follow in early 2020.

Thanks to David “Dranch”

Watchdog

I use watchdog to monitor my RPI. Do services go offline or the RPI is not responding, watchdog kicks in and restart the system. Now I also want watchdog to watch my Linbpq. This is possible with watchdog, watchdog looks at a PID file. As far as I know, no PID file is created when starting Linbpq.

Now there is a possibility that when starting Linbpq with systemd a command can be given so that a PID file is created.

This is my linbpq.service file from systemd

pd9q@packet:~ $ sudo cat /etc/systemd/system/linbpq.service
[Unit]
Description=Linbpq Daemon
After=network.target
After=direwolf.target
StartLimitInterval=0

[Service]
Type=simple
Restart=always
RestartSec=5
ExecStartPost=/bin/sh -c "echo $MAINPID > /home/pd9q/linbpq/run/linbpq.pid"
ExecStart=/bin/bash /home/pd9q/linbpq/linbpq.start
WorkingDirectory=/home/pd9q/linbpq

[Install]
WantedBy=multi-user.target
Alias=linbpq.service

This command creates a linbpq.pid file, now it is possible that watchdog monitors linbpq.

ExecStartPost=/bin/sh -c "echo $MAINPID > /home/pd9q/linbpq/run/linbpq.pid"
pd9q@packet:~ $ sudo ls -l /home/pd9q/linbpq/run
-rw-r--r-- 1 root root 4 Oct 14 18:36 linbpq.pid
pd9q@packet:~ $

At the end of my watchdog configuration file (/etc/watchdog.conf) I have added the following line.

# Check if Linbpq is running
pidfile         = /home/pd9q/linbpq/run/linbpq.pid

Take a look at what happens when you stop Linbpq.

sudo systemctl stop linbpq.service

Yes the system is ReBoOtInG (I hoop)

Lcd Display on a PI

After a busy period, I finally have a bit  “Me Time” again.

David KI6ZHD (drache), has written a fantastic article about setting up and configuring a RaspBerry PI. This article also contains a piece about setting up an LCD display at the GPIO port of the Raspberry PI.

This can be read here.
http://www.trinityos.com/HAM/CentosDigitalModes/RPi/rpi2-setup.html#60a.appendix-i2c-lcd

I have ordered a 20×4 LCD display and an I2C LCD interface on the internet.The price was $ 14.96 including shipping costs. Nice.

Take the time to read this good article.

http://www.trinityos.com/HAM/CentosDigitalModes/RPi/rpi2-setup.html

Winlink Gateway HB9AK

As Winlink Gateway i`m using HB9AK from Switzerland on dail 7.050Mhz. HB9AUR (Martin) is the Operator (SysOp) of HB9AK.
I have test the system of Martin with Winmor, Ardop, Robust 300/600. I have a old AEA DSP2232 modem that can make Pactor 1, but i have some issues to get things going.

HB9AK is a big boy with many possibilities. Here a small list.

Technical details of HB9AK (JN36PV, 650 m asl):

QRGs (dial frequency): 3’613.0, 7’050.0, 10’144.4(NB), 14’108.9, 18’114.4, 21’113.5 (NB: narrow band only). Use USB for all QRGs. Center frequency is 1.5 kHz higher than dial frequency.

TRX1 (40m): KENWOOD TS-590S, dipole(N/S); Modes WINMOR, PACTOR(1-4), Robust Packet Radio, ARDOP, VARA

TRX2 (30m): KENWOOD TS-590SG, dipole(N/S); Modes WINMOR(500), PACTOR(1-2), ARDOP

TRX3 (20m): KENWOOD TS-590SG, dipole(N/S) or LogPer; Modes WINMOR, PACTOR(1-4), Robust Packet Radio, ARDOP, VARA

TRX4 (80m/17m/15m): KENWOOD TS-590S, 80m dipole, 17/15m fan dipole; Modes WINMOR, PACTOR(1-4), Robust Packet Radio, ARDOP, VARA

Technical details of HB9AK-1 (JN47LI, 1130 m asl):

TRX5 (10m): ICOM IC-706, vertical dipole; Modes WINMOR, PACTOR(1-4), Robust Packet, ARDOP, VARA

TRX6 (2m): MOTOROLA GM340, X-50; Mode Packet Radio AFSK 1200 Bd, BPSK 1200 Bd, BPSK 2400 Bd, QPSK 2400 bps, QPSK 3600 bps

Technical details of HB9AK-14 (JN46FS, 3020 m asl):

TRX7 (10m): KENWOOD TS-480SAT, Inv-V; Modes PACTOR(1-4), Robust Packet, WINMOR, ARDOP, VARA

I have contacted Martin, and we have been talking for a while about anything and everything. I asked him about his configuration, he found it no problem to share it.

/* This begins a multi-line comment

CONFIGURATION FILE FOR BPQ32: G8BPQ SWITCH SOFTWARE

Includes 1 AX/IP/UDP Port, 1 Telnet Port, 1 PACTOR, 1 WINMOR, 1 ARDOP, 1 VARA, 1 RPR

*/ This ends a multi-line comment
SIMPLE			; Sets lots of rarely changed setting to default values
NODE=0                  ; only RMS application

PASSWORD=ABCDEFG
LOCATOR=JN47LI

NODECALL=HB9AK-13	; Node callsign
NODEALIAS=WLHLI	; Node alias (6 characters max)

IDMSG:			; UI broadcast text from NODECALL to fixed dest ID
HB9AK BPQ WINLINK Gateway
***			; Denotes end of IDMSG text

BTEXT:			; UI broadcast text from BCALL to destination UNPROTO=
HB9AK BPQ WINLINK Gateway
***			; Denotes end of BTEXT text

INFOMSG:		; The INFO command text follows:
Welcome to the HB9AK BPQ WINLINK Gateway
Located at HOERNLI ZH, Switzerland
Operating 10m ports for PACTOR 1-4, Robust Packet, WINMOR, ARDOP, VARA

Thanks for visiting.

***			; Denotes end of INFOMSG text

CTEXT:			; The CTEXT text follows:
HB9AK WINLINK RMS HOERNLI
BERN:HB9AK-13 BBS RMS CONNECT BYE INFO NODES PORTS ROUTES USERS MHEARD
***			; Denotes end of CTEXT text

HFCTEXT= *** WINLINK HOERNLI (JN47LI, 1130 m asl) ***

FULL_CTEXT=0		; 0=send CTEXT to L2 connects to NODEALIAS only
			; 1=send CTEXT to all connectees


;----------------------------------------------------
; Network System Parameters:

NODESINTERVAL=45	; Nodes broadcast interval in minutes
IDINTERVAL=10		; 'IDMSG' UI broadcast interval in minutes, 0=OFF
BTINTERVAL=60		; The BTEXT broadcast interval in minutes, 0=OFF
MINQUAL=85		; Minimum quality to add to nodes table


;----------------------------------------------------
; Port Definitions:
; AX/IP/UDP Port

PORT
 PORTNUM=1		; Optional but sets port number if stated
 ID=AX/IP/UDP		; Displayed by PORTS command
 DRIVER=BPQAXIP                   ; Uses BPQAXIP driver
 QUALITY=90		; Quality factor applied to node broadcasts heard on
			; this port, unless overridden by a locked route
			; entry. Setting to 0 stops node broadcasts
 MINQUAL=85		; Entries in the nodes table with qualities greater or
			; equal to MINQUAL will be sent on this port. A value
			; of 0 sends everything.
 MAXFRAME=7		; Max outstanding frames (1 thru 7)
 FRACK=3000		; Level 2 timout in milliseconds
 RESPTIME=1000		; Level 2 delayed ack timer in milliseconds
 RETRIES=5		; Level 2 maximum retry value

CONFIG
 MHEARD ON
 UDP 10093
 BROADCAST NODES

; MAP XX6JJJ-1 XX6JJJ.NO-IP.ORG UDP 10093 B

ENDPORT 


;----------------------------------------------------
; BPQTelnetServer Port

PORT
 PORTNUM=2
 ID=Telnet Server
 DRIVER=TELNET		; Uses TELNET driver
 PORTCALL=HB9AK

CONFIG
 RELAYHOST=127.0.0.1 8772
 CMS=1
 CMSCALL=HB9AK
 CMSPASS=******
 LOGGING=1
 DisconnectOnClose=1
 TCPPORT=17020
 FBBPORT=17021
 HTTPPORT=8080
 MAXSESSIONS=3
 FALLBACKTORELAY=1

 CTEXT=Welcome to HB9AK's Telnet Server\nEnter ? for list of commands\n\n

 USER=HB9AUR,****,HB9AUR,"",sysop

ENDPORT

;
; WINMOR Port
;
PORT
 ID=WINMOR_10m
 DRIVER=WINMOR
 INTERLOCK=4
 CONFIG
 ADDR 127.0.0.1 8500 PTT CAT PATH C:\RMS\RMS Trimode\WINMOR TNC.exe
 CWID True
 BW 1600
 DRIVELEVEL 78
 BUSYLOCK False
 WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 28312500, WINMOR1600, 50
ENDPORT

;------------------------------------------------
; ARDOP PORT
;
PORT
 ID=ARDOP_10m
 DRIVER=ARDOP
 INTERLOCK=4
 CONFIG
  ADDR 127.0.0.1 8515 PTT CAT PATH C:\RMS\ARDOP\ARDOP_Win.exe

  DEBUGLOG TRUE
  CMDTRACE True
  CWID TRUE
  DRIVELEVEL 78
  BUSYWAIT 20
  GRIDSQUARE JN47LI
  FECREPEATS 0
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 28312500, ARDOP2000, 100
ENDPORT

;-------------------------------------------------
; PACTOR PORT
;
PORT
 ID=PACTOR_10m
 DRIVER=SCSPACTOR
 INTERLOCK=4
 COMPORT=5
 SPEED=57600
 PORTCALL=HB9AK-1
 
 CONFIG                 ; Driver-Specific Configuration
  PAC BAUD R600
  PAC MCON 6
  PAC MON 6
  PAC TXL 380

  DRAGON SINGLE
  MAXLEVEL 4
 
  APPL RMS            ; Autoconnect to CMS
  RIGCONTROL
  COM11 57600 KENWOOD TS480 DATAPTT  
  6,28.31105,USB,P1234,W2,R2
  ;6,28.3145,USB,P1234,W2,R2
  ****

  PSKA 360               ; PSK TX Output level.
  FSKA 360               ; TX Level for FSK modes.
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 28312500, P1234, 100
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 28312500, ROBUST, 100
ENDPORT

;----------------------------------------------------
; VARA port 10 m
;
PORT
 ID=VARA_10m
 DRIVER=VARA
 INTERLOCK=4
 CONFIG
  ADDR 127.0.0.1 8300 PTT CAT PATH C:\RMS\VARA\VARA.exe
  ;GATEWAY HB9AK-1 JN47LI 28311.0 Hoernli (1130m asl)
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 28312500, VARA, 100
ENDPORT

;----------------------------------------------------
; VARA port 2m 9600
;
PORT
 ID=VARA_2m
 DRIVER=VARA
 INTERLOCK=3
 CONFIG
  ADDR 127.0.0.1 8320 PTT RTS PATH C:\VARA FM123\VARAFM.exe
  RIGCONTROL COM14 57600 PTTONLY
  ;GATEWAY HB9AK-1 JN47LI 144875.0 Hoernli (1130m asl)
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 144875000, VARA, 100
ENDPORT

;----------------------------------------------------
; VARA port 2m 1200
;
PORT
 ID=VARA_2m_1200
 DRIVER=VARA
 INTERLOCK=3
 CONFIG
  ADDR 127.0.0.1 8340 PTT RTS PATH C:\VARA FM123 12\VARAFM.exe
  RIGCONTROL COM14 57600 PTTONLY
  ;GATEWAY HB9AK-1 JN47LI 144875.0 Hoernli (1130m asl)
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 144875000, VARA, 100
ENDPORT

;----------------------------------------------------
; AX.25 port AFSK 1200
;
PORT
ID=UZ7HO A1
DRIVER=UZ7HO

;INTERLOCK=3
CHANNEL=A
QUALITY=0
MAXFRAME=4
FULLDUP=0
FRACK=8000
RESPTIME=3000
RETRIES=10
PACLEN=128
TXDELAY=200
SLOTTIME=100
PERSIST=64
KISSOPTIONS=ACKMODE

 CONFIG
  ADDR 127.0.0.1 8100 PATH C:\RMS Express\soundmodem.exe
  MAXSESSIONS=4
  ;GATEWAY HB9AK-1 JN47LI 28311.0 Hoernli (1130m asl)
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 28312500, VARA, 100
ENDPORT

;----------------------------------------------------
; AX.25 port QPSK 3600
;
PORT
ID=UZ7HO A2
DRIVER=UZ7HO

;INTERLOCK=3
CHANNEL=B
QUALITY=0
MAXFRAME=4
FULLDUP=0
FRACK=8000
RESPTIME=3000
RETRIES=10
PACLEN=128
TXDELAY=200
SLOTTIME=100
PERSIST=64
KISSOPTIONS=ACKMODE

 CONFIG
  ADDR 127.0.0.1 8100 PATH C:\RMS Express\soundmodem.exe
  MAXSESSIONS=4
  ;GATEWAY HB9AK-1 JN47LI 28311.0 Hoernli (1130m asl)
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 28312500, VARA, 100
ENDPORT

;----------------------------------------------------
; AX.25 port BPSK 2400
;
PORT
ID=UZ7HO B1
DRIVER=UZ7HO

;INTERLOCK=3
CHANNEL=A
QUALITY=0
MAXFRAME=4
FULLDUP=0
FRACK=8000
RESPTIME=3000
RETRIES=10
PACLEN=128
TXDELAY=200
SLOTTIME=100
PERSIST=64
KISSOPTIONS=ACKMODE

 CONFIG
  ADDR 127.0.0.1 8120 PATH C:\RMS\RMS Packet B\soundmodem.exe
  MAXSESSIONS=4
  ;GATEWAY HB9AK-1 JN47LI 28311.0 Hoernli (1130m asl)
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 28312500, VARA, 100
ENDPORT

;----------------------------------------------------
; AX.25 port QPSK 2400
;
PORT
ID=UZ7HO B2
DRIVER=UZ7HO

;INTERLOCK=3
CHANNEL=B
QUALITY=0
MAXFRAME=4
FULLDUP=0
FRACK=8000
RESPTIME=3000
RETRIES=10
PACLEN=128
TXDELAY=200
SLOTTIME=100
PERSIST=64
KISSOPTIONS=ACKMODE

 CONFIG
  ADDR 127.0.0.1 8120 PATH C:\RMS\RMS Packet B\soundmodem.exe
  MAXSESSIONS=4
  ;GATEWAY HB9AK-1 JN47LI 28311.0 Hoernli (1130m asl)
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 28312500, VARA, 100
ENDPORT

;----------------------------------------------------
; AX.25 port BPSK 1200
;
PORT
ID=UZ7HO C1
DRIVER=UZ7HO

;INTERLOCK=3
CHANNEL=A
QUALITY=0
MAXFRAME=4
FULLDUP=0
FRACK=8000
RESPTIME=3000
RETRIES=10
PACLEN=128
TXDELAY=200
SLOTTIME=100
PERSIST=64
KISSOPTIONS=ACKMODE

 CONFIG
  ADDR 127.0.0.1 8140 PATH C:\RMS\RMS Packet C\soundmodem.exe
  MAXSESSIONS=4
  ;GATEWAY HB9AK-1 JN47LI 28311.0 Hoernli (1130m asl)
  WL2KREPORT PUBLIC, server.winlink.org, 8085, HB9AK-1, JN47LI, 00-23, 28312500, VARA, 100
ENDPORT

;----------------------------------------------------
; Applications

APPLICATION 1,RMS,C 2 CMS,HB9AK-1,WL2K,255
;APPLICATION 3,RMS,C 2 CMS,HB9AK,WL2K,255
;APPLICATION 2,*BYE,BYE,HB9AK

;APPLICATION 32,SYSOP

 Very nice system. 

ClusterHat….

New project.

https://clusterhat.com/

pi@controller:~ $ for I in 1 2 3 4; do echo -n "p$I:";ssh pi@p$I.local uptime;done
p1: 16:19:13 up  5:34,  0 users,  load average: 0.17, 0.32, 0.34
p2: 16:19:15 up  5:36,  0 users,  load average: 0.37, 0.32, 0.32
p3: 16:19:16 up  5:34,  0 users,  load average: 0.37, 0.32, 0.28
p4: 16:19:18 up  5:35,  0 users,  load average: 0.36, 0.35, 0.36
pi@controller:~ $

 

Related NewsGroups

BPQ32
https://groups.yahoo.com/neo/groups/BPQ32/info
LinuxRMS RMSGateway
https://groups.yahoo.com/neo/groups/LinuxRMS/info
Direwolf Packet
https://groups.yahoo.com/neo/groups/direwolf_packet/info
Winmor
https://groups.yahoo.com/neo/groups/WINMOR/info
Ardop
https://groups.yahoo.com/neo/groups/ardop/info
Ardop
https://ardop.groups.io/g/main
Scs Tracker Modes
https://groups.io/g/SCS-Tracker-Modem
Digital Amateur Radio
https://groups.io/g/digital-amateur-radio
Digital Radio
https://digitalradio.groups.io/g/main
Vara Modem
https://groups.io/g/VARA-MODEM
RaspberryPi 4 Hamradio
https://groups.io/g/raspberrypi-4-hamradio
Network 105
https://groups.io/g/network105
T.A.R.P.N
https://groups.io/g/tarpn
Pactor and Packet Group
https://groups.io/g/pactor