Winlink gateway HB9AK (test session)

Almost a year ago if have post something about the Winlink Gateway HB9AK.

https://packet-radio.net/winlink-gateway-hb9ak/

Today I have extensively tested the Gateway. And I have to say it works great.
So thank you Martin HB9AUR that you make all this possible.
Just running with 1.51 Watt in a HyEndFed antenna.

Fist Ardop

Second Winmor

Then Pactor 1, Unfortunately I don’t have an expensive P4Dragon. So I have to do with Pactor 1.

Now Robust Packet……

And finally Vara, I really don’t want to pay 69 dollars for a registered Vara version, since I never use Vara.

The NEW… NinoTNC form TARPN

Tadd KA2DEW send me some great news. Thank you Tadd.

I`ve read that they were working on it, but that they were already that far …..

The sale will probably start at the end of January or the beginning of February.

TARPN is about to start selling its own TNC called NinoTNC. This is to be sold as a programmed CPU and PCB for $14 including shipping. They give you a BOM file and instructions to submit it to DigiKey for the rest of the parts. Costs about $25 including USPS shipping. Total cost is < $40. The NinoTNC is a USB KISS hardware/firmware TNC which looks like the TNC-PI, but isn’t a HAT. It is powered over USB and can connect to any USB equipped computer which supports a program to operate a KISS TNC. The NinoTNC has its own FEC mode useful for making dedicated point-to-point links.

Here some links with further information.

http://tarpn.net/d
http://tarpn.net/t/nino-tnc/n9600a/news-about-ninotnc9600A2—starting-field-tests.pdf
http://tarpn.net/t/nino-tnc/n9600a/n9600a_general_info.html

Weather beacon

I wanted to broadcast a weather beacon, but since I don’t have a weather station it became a bit more difficult. After some searching on the internet I came across a site where I can download a file with an api with weather data that is no more than 10 minutes old. Great. After downloading the file looks a little messy.

 "liveweer": [{"plaats": "Kortgene", "station": "DE BILT AWS", "timestamp": "1577030283", "time": "22-12-2019 16:58:03", "temp": "7.3", "gtemp": "4.6", "samenv": "Van tijd tot tijd lichte regenbuien of regen", "image": "regen", "windrgr": "182.7", "windr": "ZZO", "windms": "4.06", "windbft": "3", "windknp": "7.9", "windkmh": "14.6", "windstootms": "5.19", "windstootbft": "3", "windstootknp": "10.1", "windstootkmh": "18.7", "luchttemp": "7.2", "lv": "99", "luchtd"

I can’t do much with this. Let`s manupilate the file. First add some “enters”/”new lines” in the file.

Add a enter after/new line “, ”
sed -i $’s/”, “/),\\\n(/g’ ~/wx-project/meteo.wx

Now the file looks like this

{ "liveweer": [{"plaats": "Kortgene),
(station": "DE BILT AWS),
(timestamp": "1577030283),
(time": "22-12-2019 16:58:03),
(temp": "7.3),
(gtemp": "4.6),
(samenv": "Van tijd tot tijd lichte regenbuien of regen),
(image": "regen),
(windrgr": "182.7),
(windr": "ZZO),
(windms": "4.06),
(windbft": "3),
(windknp": "7.9),
(windkmh": "14.6),
(windstootms": "5.19),
(windstootbft": "3),
(windstootknp": "10.1),
(windstootkmh": "18.7),
(luchttemp": "7.2),
(lv": "99),
(luchtd": "_),

That’s better, just clean up the mess. I end up with this.

# Remove the non-letters/numbers except . and : and –
sed -i -e “s/[^ 0-9a-zA-Z.:-]//g” -e ‘s/ \+/ /’ ~/wx-project/meteo.wx

liveweer: plaats: Kortgene
station: DE BILT AWS
timestamp: 1577030283
time: 22-12-2019 16:58:03
temp: 7.3
gtemp: 4.6
samenv: Van tijd tot tijd lichte regenbuien of regen
image: regen
windrgr: 182.7
windr: ZZO
windms: 4.06
windbft: 3
windknp: 7.9
windkmh: 14.6
windstootms: 5.19
windstootbft: 3
windstootknp: 10.1
windstootkmh: 18.7
luchttemp: 7.2
lv: 99

Now we can read the line and get the value from it. I do this with “awk”

temp=$(awk ‘NR==5{print $2}’ meteo.wx)
echo TEMP=”$temp”°C Temperature degrees Celsius

Read line 5 word number two. And we have…………….

7.3°C Temperature degrees Celsius.

In the Netherlands we work with the mertrice system. Now the weather beacon is displayed in the imperial system. Now some calculation work must take place.

# Do some calulation
# From °Celsius to Fahrenheit
fah=$(echo "(($temp*1.8)+32)" | bc)
fah1=$(echo "$fah" | awk -F'.' '{print $1}')
fah2=$(echo $fah1 | sed -e :a -e 's/^.\{1,2\}$/0&/;ta')
echo FAH="$fah2"F Temperature degrees Fahrenheit
# (Wind speed miles)From kilometer per hour to miles per hour and add leading zero(s)
wpm=$(echo "$wpk"/1.609344 | bc)
wpm0=$(echo $wpm | sed -e :a -e 's/^.\{1,2\}$/0&/;ta')
echo WPM="$wpm0"mph Wind speed in miles per hour
# (Wind guts miles) From kilometer per hour to miles per hour and add leading zero(s)
wgm=$(echo "$wgk"/1.609344 | bc)
wgm0=$(echo $wgm | sed -e :a -e 's/^.\{1,2\}$/0&/;ta')
echo WGM="$wgm0"mph Wind guts in miles per hour
# (Rain in inches) From mm to inches the last hour. Remove the (DOT) and only the first 3 numbers
rni=$(echo "$rn"*0.0039370 | bc)
rni0=$(echo $rni | sed -e 's/^[.]*//g' -e 's/^\(.\{3\}\).*$/\1/')
echo RNI="$rni0"inch Rain in the last hour in inches
# (Rain (24) in inches) From mm to inches the last 24 hour. Remove the (DOT) and only the first 3 numbers
rni24=$(echo "$rn24"*0.0039370 | bc)
rni240=$(echo $rni24 | sed -e 's/^[.]*//g' -e 's/^\(.\{3\}\).*$/\1/')
echo RNI="$rni240"inch Rain in the last 24 hour in inches
# (Rain (12) in inches) From mm to inches the last 12 hour. Remove the (DOT) and only the first 3 numbers
rni12=$(echo "$rn12"*0.0039370 | bc)
rni120=$(echo $rni12 | sed -e 's/^[.]*//g' -e 's/^\(.\{3\}\).*$/\1/')
echo RNI="$rni120"inch Rain in the last 12 hour in inches

We can finally put the beacon together.

# Let show what we have and put it on the place it belong.
echo !5133.52N/00348.15E_"$grd"/"$wpm0"g"$wgm0"t"$fah2"r"$rni0"p"$rni240"P"$rni120"h"$hum"b"$bar"
echo !5133.52N/00348.15E_"$grd"/"$wpm0"g"$wgm0"t"$fah2"r"$rni0"p"$rni240"P"$rni120"h"$hum"b"$bar" > /home/pd9q/jnos/wx/current.wx

Output

!5133.52N/00348.15E_272/010g022t046r005p028P017h92b0987

The compleet output looks like this.

TEMP=8°C Temperature degrees Celsius
WPK=16.8km/h Wind speed in Kilometers per hour
WGK=35.6km/h Wind guts in Kilometers per hour
GRD=272° Wind direction in degrees
RAIN=1.48067mm Rain in the last hour in mm
RAIN24=7.23632mm Rain in the last 24 hour in mm
RAIN12=4.53765mm Rain in the last 12 hour in mm
HUM=92% Humidity in procent
Bar=0987mb Barometric pressure in millibars
FAH=046F Temperature degrees Fahrenheit
WPM=010mph Wind speed in miles per hour
WGM=022mph Wind guts in miles per hour
RNI=005inch Rain in the last hour in inches
RNI=028inch Rain in the last 24 hour in inches
RNI=017inch Rain in the last 12 hour in inches
!5133.52N/00348.15E_272/010g022t046r005p028P017h92b098

The complete script look like this.

I put it in a cronjob, now it’s running every 15 minutes.
crontab -e
*/15 * * * * /home/pd9q/wx-project/get-wx.sh >/dev/null 2>&1

!/bin/bash
# Date 22-12-2019... Dammmmm what a job :)
# The weather beacon have to look like this....
# @220424z5057.81N/00729.37E_094/002g005t043r000p006P006h89b09783
# !5133.52N/00348.15E_073/013g...t048h85b10040wWXD
#
# Jun 01 2003 08:07
# 272/000g006t069r010p030P020h61b10150
# ***********************************************************
# 272 - wind direction - 272 degrees
# 010 - wind speed - 10 mph
# g015 - wind gust - 15 mph
# t069 - temperature - 69 degrees F
# r010 - rain in last hour in hundredths of an inch - 0.1 inches
# p030 - rain in last 24 hours in hundredths of an inch - 0.3 inches
# P020 - rain since midnight in hundredths of an inch - 0.2 inches
# h61 - humidity 61% (00 = 100%)
# b10153 - barometric pressure in tenths of a MILLIBAR - 1015.3 MILLIBARS
#
# Get the wx data from Weerlive/Meteoserver
#wget -O - "http://weerlive.nl/api/json-data-10min.php?key=?!?!?!?!?!&locatie=Kortgene" > ~/wx-project/weerlive.wx
#
wget -O - "https://data.meteoserver.nl/api/liveweer_synop.php?locatie=Kortgene&key=!?!?!?!?!?!?&select=1" > ~/wx-project/meteo.wx
#
# Some file manipulation on the METEO.WX file
# Add a enter after ", "
sed -i $'s/", "/),\\\n(/g' ~/wx-project/meteo.wx
# Remove the non-letters/numbers except . and : and -
sed -i -e "s/[^ 0-9a-zA-Z.:-]//g" -e 's/ \+/ /' ~/wx-project/meteo.wx
#
# Getting the data sorted....
now=$(date +%d%H%M)
#
temp=$(awk 'NR==5{print $2}' meteo.wx)
echo TEMP="$temp"°C Temperature degrees Celsius
# Wind speed (Kilometers)
wpk=$(awk 'NR==14{print $2}' meteo.wx)
echo WPK="$wpk"km/h Wind speed in Kilometers per hour
# Wind gust (Kilometers)
wgk=$(awk 'NR==18{print $2}' meteo.wx)
echo WGK="$wgk"km/h Wind guts in Kilometers per hour
grd=$(awk 'NR==9{print $2}' meteo.wx | awk -F'.' '{print $1}')
echo GRD="$grd"° Wind direction in degrees
rn=$(awk 'NR==38{print $2}' meteo.wx)
echo RAIN="$rn"mm Rain in the last hour in mm
rn24=$(awk 'NR==39{print $2}' meteo.wx)
echo RAIN24="$rn24"mm Rain in the last 24 hour in mm
rn12=$(awk 'NR==37{print $2}' meteo.wx)
echo RAIN12="$rn12"mm Rain in the last 12 hour in mm
hum=$(awk 'NR==20{print $2}' meteo.wx)
echo HUM="$hum"% Humidity in procent
bar=$(awk 'NR==21{print $2}' meteo.wx | awk -F: '{ printf "%04i", $1,$2 }')
echo Bar="$bar"mb Barometric pressure in millibars

# Do some calulation
# From °Celsius to Fahrenheit
fah=$(echo "(($temp*1.8)+32)" | bc)
fah1=$(echo "$fah" | awk -F'.' '{print $1}')
fah2=$(echo $fah1 | sed -e :a -e 's/^.\{1,2\}$/0&/;ta')
echo FAH="$fah2"F Temperature degrees Fahrenheit
# (Wind speed miles)From kilometer per hour to miles per hour and add leading zero(s)
wpm=$(echo "$wpk"/1.609344 | bc)
wpm0=$(echo $wpm | sed -e :a -e 's/^.\{1,2\}$/0&/;ta')
echo WPM="$wpm0"mph Wind speed in miles per hour
# (Wind guts miles) From kilometer per hour to miles per hour and add leading zero(s)
wgm=$(echo "$wgk"/1.609344 | bc)
wgm0=$(echo $wgm | sed -e :a -e 's/^.\{1,2\}$/0&/;ta')
echo WGM="$wgm0"mph Wind guts in miles per hour
# (Rain in inches) From mm to inches the last hour. Remove the (DOT) and only the first 3 numbers
rni=$(echo "$rn"*0.0039370 | bc)
rni0=$(echo $rni | sed -e 's/^[.]*//g' -e 's/^\(.\{3\}\).*$/\1/')
echo RNI="$rni0"inch Rain in the last hour in inches
# (Rain (24) in inches) From mm to inches the last 24 hour. Remove the (DOT) and only the first 3 numbers
rni24=$(echo "$rn24"*0.0039370 | bc)
rni240=$(echo $rni24 | sed -e 's/^[.]*//g' -e 's/^\(.\{3\}\).*$/\1/')
echo RNI="$rni240"inch Rain in the last 24 hour in inches
# (Rain (12) in inches) From mm to inches the last 12 hour. Remove the (DOT) and only the first 3 numbers
rni12=$(echo "$rn12"*0.0039370 | bc)
rni120=$(echo $rni12 | sed -e 's/^[.]*//g' -e 's/^\(.\{3\}\).*$/\1/')
echo RNI="$rni120"inch Rain in the last 12 hour in inches

#@220424z5057.81N/00729.37E_094/002g005t043r000p006P006h89b09783
# Let show what we have and put it on place it belong.
echo !5133.52N/00348.15E_"$grd"/"$wpm0"g"$wgm0"t"$fah2"r"$rni0"p"$rni240"P"$rni120"h"$hum"b"$bar"
echo !5133.52N/00348.15E_"$grd"/"$wpm0"g"$wgm0"t"$fah2"r"$rni0"p"$rni240"P"$rni120"h"$hum"b"$bar" > /home/pd9q/jnos/wx/current.wx
#

 

Brian Kantor, WB6CYT, SK

Very,very sad news…..

Below a mail from Phil Karn.

[44net] Brian Kantor, WB6CYT, SK
Date:       Fri, 22 Nov 2019 15:27:49 -0800 (11/22/2019 06:27:49 PM)

I have very sad news. My good friend, Brian Kantor, WB6CYT ,suddenly passed away this week at his home in San Diego, California.

Brian retired only two years ago after 47 years of service on the staff at the University of California San Diego (UCSD). Way back in the mid 1980s, Brian and I founded AMPRnet, the TCP/IP over amateur radio network. He continued to manage it until his passing.

Brian recently created and served as chair and CEO of Amateur Radio Digital Communications (ARDC), a charitable foundation funded by the sale of unused AMPRnet IPv4 addresses.  ARDC promotes STEM education and amateur radio digital development through scholarships and by funding the development of open source hardware and software.

Brian will be sorely missed and impossible to replace. Memorial arrangements will be announced when known.

Phil Karn, KA9Q

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