Packet Radio: Starting LinBPQ from Systemd

Ideal for Raspbian Buster.

Optional but recommended:

Note in the above example there is a line referencing an application /usr/bin/screen. If you do not have the screen package installed, it is highly recommended to do so- screen will create a virtual console for linbpq, ideal for checking, diagnostics, debug/errors etc.

sudo apt install screen

When the node is running, while logged in as the user defined in the linbpq.service:

To attach:
screen -r linbpq
To detatch, press key combination sequence:
Ctrl-a d

Create the runbpq Script

I recommend running a script rather than the binary directly so that if you need to add TNC drivers or bind additional devices such as bluetooth TNCs, this would be the ideal place to put them In sequence.

#!/bin/bash
#
# Edit to reflect the directory location of linBPQ installation
cd /home/bpq/node
#
# Attempt to upgrade (if linbpq.new exists) on next restart
mv linbpq.new linbpq
./linbpq

Set execute and the correct USERID and GROUP permissions on the runbpq script AND linbpq binary. This will make it run with the correct user ID if at any point it is launched manually.

sudo chmod +x runbpq
chown <userid>:<groupid> runbpq linbpq
sudo chmod u+s runbpq linbpq

Upgrade preparation

IMPORTANT: If you drop an upgraded linbpq into the directory, you should name it linbpq.new and run the following commands on it to prepare it for when the linbpq service is next restarted (useful if running a node with a specific scheduled maintenance window).

sudo chmod +x linbpq.new
sudo chown <userid>:<groupid> linbpq.new
sudo chmod u+s linbpq.new

Starting linbpq from systemd

Create the file linbpq.service with the following contents:

[Unit]
Description=LinBPQ
After=network.target
[Service]
Type=forking
WorkingDirectory=/home/bpq/node
Restart=always
User=bpq
Group=bpq
ExecStart=/usr/bin/screen -S linbpq -d -m /home/bpq/node/runbpq
#ExecStart=/bin/bash /home/bpq/node/runbpq
SyslogIdentifier=LinBPQ
[Install]
WantedBy=multi-user.target

Edit the ExecStart path to reflect the location of runbpq on your system.

Move linbpq.service into the /etc/systemd/system/ directory

sudo mv ./linbpq.service /etc/systemd/system/
cd /etc/systemd/system/

Then run

sudo systemctl daemon-reload
sudo systemctl enable linbpq.service

Which does this:

Created symlink /etc/systemd/system/multi-user.target.wants/linbpq.service → /etc/systemd/system/linbpq.service.

And that should be it. LinBPQ will now start from boot, and you have prepared a system to assist with future upgrades of the node binary.

Further tips

You can check your systemd startup sequence status issuing:

sudo systemctl status

Packet Radio: LinBPQ Ready to Go

Got a Raspberry Pi and want to get back into Packet Radio?

The LinBPQ-RTG has been moved to a GitHub repository, meaning keep it up-to-date is much easier. To download, install ‘git’ on your system and use the following command to copy the repository to your system:

git clone https://github.com/pe1rrr/linbpq_rtg

This is a complete packet radio setup for amateur radio use. The repository has binaries included for the Raspberry Pi providing the full node network stack, QtSoundModem and QtTermTCP.

The repository contains documentation and configuration pretty much ready to go, only a few things need to be edited to set your callsign, file paths and a couple of parameters such as grid square locator, GPS coordinates and APRS-IS password.

Please note this software is in Beta, it is recommended that you run all three update scripts before starting, and most importantly, read the README.md – also viewable on https://github.com/pe1rrr/linbpq_rtg

Recommended system requirements: Raspberry Pi4 if running the provided QtSoundModem soundmodem. If not using the soundmodem, serial port based TNCs can be used on a Pi Model B / Pi Zero as the performance overhead is much lower. Raspberry Pi Model 3’s have issues with ALSA driver (see: https://bugs.launchpad.net/raspbian/+bug/1819560) although a workaround has been included in the repository, see qtsm_rpi3 file.

If you wish to compile the source code yourself, download the latest archive from G8BPQ’s website/repository here. If using a 64bit OS, you must first install x86 32bit compatibility libraries before building. A binary compiled without these may execute but it will send corrupted frames, so be careful.

Good luck!

73

Red – PE1RRR

Appendix

The update scripts provided can be easily modified to download the binaries for x86 32bit Linux.

Open them in a text editor and adjust the filename= parameter.

The filename downloaded by the scripts should be changed from ‘pilinbpq’ to ‘linbpq’. The same procedure should be employed for qtsm and qtterm update scripts- just remove the ‘pi’.

Linux x86

If running a 64bit OS you will need to install the 32bit compatibility libraries. For Ubuntu and Debian, this is accomplished with:

apt-get install ia32-libs
QtTerm configured in MDI mode
QtSoundModem

Windows

For Windows users, the configuration files are compatible with the Win32 build of BPQ32 available from G8BPQ’s website here.

Be aware the configuration here is for the latest Beta so after installing the Win32 package, also download the latest beta DLL. As this package is aimed at Raspbian Linux for the Raspberry Pi it is a little out of scope to provide details for the Windows platform.

See BPQ32 Documentation

Packet Radio: JNOS – Forwarding Mail over Telnet

Internally Forwarding Mail to BPQ

Create a new user with BBS flags for your JNOS instance within the BPQ User Management Area.

For this account, do not use the callsign of the JNOS instance, instead use a descriptive alias. This avoids a problem with callsign collision which will usually cause JNOS to refuse to work. In my example, I will refer to this USER as RRRNOS on the BPQ side.

The HROUTE of RRRNOS is RRRNOS.PE1RRR.NLD.EURO, as configured in the mailbox settings for JNOS.

All mail for RRRNOS arrives first at PE1RRR.NLD.EURO and is queued for forwarding to RRRNOS.

In turn, we also will refer to the BPQMail instance in the JNOS configuration as MATRIX, rather than the callsign.

Configuring forward.bbs

IMPORTANT: The passwords for BPQ telnet sessions are NOT defined in the BPQMail User account, but instead in the bpq32.cfg node configuration file under the TELNET port declaration. See BPQ Telnet Server Documentation.

matrix 0023 P
telnet <bpq node address> <bpq fbbport> cronly
.<bpq port defined telnet userid>
.<password>
* 0
.BBS
* 0
<list of areas to forward>

IMPORTANT: The FBBPORT is often misunderstood as a direct connection to the BBS- when it is not. The port opens a connection to only the node which is why we must issue an extra command: .BBS

FBB sysops frequently get this wrong and wonder why their telnet forwarding to a BPQMail instance doesn't work.

JNOS ftpusers Configuration

It is necessary to provide BPQMail with an account on JNOS with which to log in and access BBS functions. This is possible by adding an account with the necessary privileges set.

JNOS won’t allow the use of an invalid callsign for a login user ID by default, to do so would require recompiling the JNOS source with one of the config.h “defines” changed (it is easy to do, but not recommended).

A workaround, if forwarding downstream to yourself– is to just use your own callsign for the login, as it would be coming from your own upstream BPQMail BBS anyway.

Permissions needed (if not using your own sysop login): Expert, BBS.

From the FTPUSERS PERMISSIONS reference sheet, sum up the permission level as such:

  • BBS: 8192
  • Expert: 16384
  • Summed together: 24576
FTPUSERS PERMISSIONS
The following is a list of the user permission values allowed in FTPUSERS file.
  Name          value    hex value    comments
FTP_READ         1        0x1       /* Read files */
FTP_CREATE       2        0x2       /* Create new files */
FTP_WRITE        4        0x4       /* Overwrite or delete existing files */
AX25_CMD         8        0x8       /* AX.25 gateway operation allowed */
TELNET_CMD       16       0x10      /* Telnet gateway operation allowed */
NETROM_CMD       32       0x20      /* NET/ROM gateway operation allowed */
SYSOP_CMD        64       0x40      /* Remote sysop access allowed */
EXCLUDED_CMD     128      0x80      /* This user is banned from the BBS */
PPP_ACCESS_PRIV  256      0x100     /* bit for PPP connection */
PPP_PWD_LOOKUP   512      0x200     /* Priv bit for peerID/pass lookup */
NO_SENDCMD       1024     0x400     /* Disallow send command */
NO_READCMD       2048     0x800     /* Disallow read command */
NO_3PARTY        4096     0x1000    /* Disallow third-party mail */
IS_BBS           8192     0x2000    /* This user is a bbs */
IS_EXPERT        16384    0x4000    /* This user is an expert */
NO_CONVERS       32768    0x8000    /* Disallow convers command */
NO_ESCAPE        65536    0x10000   /* Default is no escape char */
NO_LISTS         131072   0x20000   /* No lists displayed from mailbox */
NO_LINKEDTO      262144   0x40000   /* Disable '*** linked to'  */
NO_LASTREAD      524288   0X80000   /* Ignore lastread in <area>.usr
                                       (shared accts)*/
NO-FBBCMP        1048576  0x100000  /* Avoid FBB compression */
XG_ALLOWED       2097152  0X200000  /* Allow XG (dynip route) cmd */

Edit the ftpusers file and append:

<callsign> <password> /jnos/public 24576

Note: If this BBS is also a regular user, give them AX and netrom permissions too (add 8 + 32 to the final sum).

Configuring BPQ Forwarding

The BPQ User created with the BBS flag (RRRNOS in this example) should be visible in the Forwarding Management Area of BPQ as one of the callsigns in the list.

Click on RRRNOS user and then set the fields with the following information, if not explicitly mentioned, the fields are to be left empty.

Connect Script

ATTACH 10
C <jnos host/ip> <jnos port> TELNET <jnos userid> <jnos password>

BBS HA

RRRNOS.PE1RRR.NLD.EURO

Hierarchical Routes (Flood Bulls)

AF
AS
OC
EURO
NOAM
SOAM
CEAM
WW

HR (Personals and Directed Bulls)

WW

Enabled Checkbox/Flags (all not explicitly mentioned should be disabled)

  • Enable Forwarding [ON] Interval [600]
  • FBB Blocked [ON] Max Block [10000]
  • Send new messages without waiting for poll timer [ON]
  • Allow Binary [ON]
  • Use B2 Protocol [ON]

Click Update to finish.

Check and Test

Open a new terminal an go to your BPQ directory, open the log file using the tail command, this will open the log file and checks the file for new data is written to it every 0.1 seconds.

tail -f -s 0.1 logLatest_BBS.txt

From the BPQ Forwarding Area, select the BBS account and click Forward

Alternatively use: fwd <callsign> now from the BPQ mail prompt.

Watch the log file for errors.

If all goes well this is what you should see:

200213 16:31:41 |RRRNOS    Incoming Connect from RRRNOS
200213 16:31:41 >RRRNOS    [BPQ-6.0.19.30-B2FWIHJM$]
200213 16:31:41 >RRRNOS    0 messages to fwd to RRRNOS
200213 16:31:41 >RRRNOS    PE1RRR BBS>
200213 16:31:41 <RRRNOS    [JNOS-2.0m-B2FHIM$]
200213 16:31:42 <RRRNOS    FF
200213 16:31:42 >RRRNOS    FQ
200213 16:31:42 |RRRNOS    RRRNOS Disconnected

To test from the other direction, log into JNOS sysop console and issue:

Note: In the examples below. ‘MATRIX’ is the arbitrary name I have given to the BPQ mailbox in JNOS, it just so happens to also be the BPQ mailbox’s NETROM alias but that is not important at all as this is a telnet session, it is just for practicality.

mbox kick <bpq bbs name defined in forward.bbs>
e.g.
mbox kick MATRIX

Note: when calling mbox kick, use upper case for the callsign if there is no local mail to actually forward. This initiates a reverse forward. If you don’t use this method, and you have no mail to forward, it won’t try and connect, and as such you won’t see diddly squat happening in the log file.