aprx and weather reporting

I’ve been sending weather reports via APRS-IS and RF for some years and have recently re-architected the way it works.  My APRS station uses aprx software running on a Raspberry Pi Model B.

My weather station is a Davis Vantage Vue with WeatherLinkIP module. The module allows the weather station to plug directly into my ethernet network. I formerly used WeatherLinkIP to feed the data to CWOP which would in turn show up on APRS-IS.  I would then gateway my reports back to RF using an aprx filter.  This seemed convoluted to me, so I wanted to improve things.

I now use a program called Weather Display, a very capable weather program, which has the capability to generate an APRS WXNOW.TXT file.  Weather Display can directly poll the Davis station via IP.  Through the steps documented below, I now send my weather reports via RF and APRS-IS in the same step.

Every 10 minutes, via crond, I perform some preprocessing on the WXNOW.TXT file to embed the weather report in the APRS “Complete Weather Report Format — with Lat/Long position and Timestamp” and then secure copy the file over to my Raspberry Pi APRS system:

#!/bin/bash
#
if [ ! -f ~/tmp/WXNOW.TXT ]; then
   exit 1
fi
# Change to the Lat/Long of your weather station
LATLONG="4023.75N/07412.53W"
line=0
while read FILE; do
   if [ $line = 0 ]; then
      # Change America/New_York to your timezone
      TIME=`TZ=UTC date --date="TZ=\"America/New_York\" $FILE" +%d%H%M`
      line=$((line+1))
   fi
WX=$FILE
done < ~/tmp/WXNOW.TXT # echo /$TIME\z$LATLONG\_$WX > ~/tmp/wxnow.tmp
# 
echo `cat ~/tmp/wxnow.tmp | tr -d '\r'`XDsIP > ~/tmp/wxnow.txt
# You must setup ssh key based authentication for this to work
# Another method could be a file copy via NFS or CIFS
scp ~/tmp/wxnow.txt pi@aprs:/dev/shm/wxnow.txt
# 
rm ~/tmp/wxnow.txt ~/tmp/wxnow.tmp

On the APRS host, I defined the following beacon section in /etc/aprx.conf:

beaconmode both
cycle-size 10m

beacon via WIDE2-1 \
srccall N0CALL-13 \
exec /usr/local/bin/aprx-wxnow.sh

Finally, the beacon exec script, is installed in /usr/local/bin/aprx-wxow.sh:

#!/bin/bash
#
TIME=$(printf `date -u "+%d%H%M"`)
if [ -f /dev/shm/wxnow.txt ]; then
   if [ -f /dev/shm/wxold.txt ]; then
      FULLWXOLD=`cat /dev/shm/wxold.txt`
   else
      FULLWXOLD=""
   fi
   FULLWXNOW=`cat /dev/shm/wxnow.txt`
   if [ "$FULLWXOLD" == "$FULLWXNOW" ]; then
      # Convert date/times to minutes for date arithmetic
      CURDAY=`echo $TIME | cut -b 1-2`
      OLDDAY=`echo $FULLWXOLD | cut -b 2-3`
      CURHR=`echo $TIME | cut -b 3-4`
      OLDHR=`echo $FULLWXOLD | cut -b 4-5`
      CURMIN=`echo $TIME | cut -b 5-6`
      OLDMIN=`echo $FULLWXOLD | cut -b 6-7`
      CURTIME=$((10#$CURDAY * 1440 + 10#$CURHR * 60 + 10#$CURMIN))
      OLDTIME=$((10#$OLDDAY * 1440 + 10#$OLDHR * 60 + 10#$OLDMIN))
      # If report older than 20 minutes then not updating
      if (( $(($CURTIME-$OLDTIME)) > 20 )) ; then
         echo -n \>$TIME\z
         echo " WX rpt not updating"
         exit 0
      fi
      # Unchanged report but <= 20 min old then don't transmit
      echo
      exit 0
   else
      OLDRPT=`echo $FULLWXOLD | cut -b 9-`
      NEWRPT=`echo $FULLWXNOW | cut -b 9-`
      #if new and old report are same then don't transmit
      if [ "$OLDRPT" == "$NEWRPT" ]; then
         echo
         exit 0
      fi
      # Transmit report and copy wxnow.txt to wxold.txt
      echo $FULLWXNOW cp /dev/shm/wxnow.txt /dev/shm/wxold.txt
   fi
else
   echo -n \>$TIME\z
   echo " WX rpt not found"
fi

While debugging, I noticed that the wxnow.txt file would sometimes disapper from /dev/shm.  This turned out to be systemd cleaning up interprocess communication whenever the pi user logged out.  I fixed this by adding the following line to /etc/systemd/logind.conf:

RemoveIPC=no

Following this change, you must restart systemd-logind.service:

sudo systemctl restart systemd-logind.service

If you implement this on your aprx system, please leave a comment.

Radiation reporting to APRS

A large scale public health/public safety initiative when I worked for the City of New York was NYPD’s radiation monitoring program. Designed to detect a dirty bomb, it makes use of wireless real-time alerting.

Now you can perform your own monitoring as part of your amateur radio station and send the results in real-time to the Automatic Packet Reporting System.

Amateur radio operator “Adminck” (S55MA) in Slovenia has published this blog post. It explains how a Raspberry Pi Zero, a tiny geiger counter, and some scripts are sending his radiation measurements live to the world via the internet.

You can see the actual reports here.

Decode HD Radio on RTL-SDR!

During my 2017 SWL Fest presentation, I mentioned that there is no way to decode either HD Radio or ATSC HD Television using software designed for the RTL2832U dongles. The explanation I provided is that both protocols are covered by patents and that the holders have not been forthcoming on providing necessary details to the open source community.

A cybersecurity researcher, Theori, has cracked the codec used by the NRSC-5-C standard for US based terrestrial digital radio. I am now listening to HD Radio via an RTL SDR dongle. It takes a decent signal, so I’m not getting too many stations using an inside whip antenna, but there are enough to experiment with. It also takes a better dongle with good frequency stability. An older dongle without the TCXO was not up to the task, even on an i7 based system.

The discovery is summarized on the RTL SDR Blog. You’ll need some familiarity with building packages under Linux to grab the source from github and to compile it on your system. So far, I’ve compiled under Debian x86_64, Fedora x86_64, and Raspbian! Next, I want to get it running under Cygwin so that I can use it on the Windows 10 computer in the radio room.

It is a blast to be able to decode the alternate program streams. Audio quality is better than Sirius XM.

Thanks Theori!

DV4mini RPi Image Update

Note: This image has been replaced by this one.

I’ve created an updated image for use with the DV4mini and the Raspberry Pi 2 and 3. It incorporates changes through dv4mini software version date 20170517. It also includes my Brandmeister XTG Dialer for use with extended routing.

Changes include enhacements for YSF reflectors, DMR, DStar as well as the introduction of a text chat window.

Thanks to Ulrich Prinz (DC3AX) for his hard work in support of the DV4 community!

For default passwords, see this post.

Wanna Cry Patches for XP

In case you still have an XP machine running somewhere that you just cannot upgrade right away, Microsoft has released a patch for the Wanna Cry vulnerability. This is the vulnerability that was exploited in recent days to hold up the United Kingdom’s National Health Service and many other organizations for for ransom.

Although Microsoft stopped official support for Windows XP some time ago, the release of this patch for an unsupported product underscores the severity of the matter. The tool used is said to have come out of the United States National Security Agency.

Here is a link to the official Microsoft download. Patch away!

Google Home Goes Multiuser

Google Home has rolled out multiuser functionality. Despite an initial glitch, it seems to work well.

Each member of your household records their voice saying “Hey Google” and “OK Google” by kicking off a dialog on their Android mobile device. They then get access to their personal calendar, music content, and other personalized services to follow. Once enabled, each user can voice query, “Hey Google, what is my name?” and Google Home knows!

I was the initial owner of Google Home when we set up our two devices. After Tina enabled her profile, we found a glitch where Home did not know who I was any longer. It kept referring me to my Google Home app to enable multiuser functionality. But, it took a few days for Home to offer me that option within the app.

Yesterday, when I tried to listen to some content, Google Home complained that it didn’t recognize me and again asked that I enable multiuser. This time, the option was present and I was able to complete the setup.

Running BMXTG on Windows 10

I’ve been able to run the Brandmeister XTG Dialer on Windows 10 by following this procedure.

Visit the PyGTK FAQ page and fully read 21.1.

I installed the following items referred to in the FAQ:

Python 2.7.13
PyGTK for Microsoft Windows using the all-in-one installer

Run a Windows command prompt as Administrator.

cd \Python27
python -m pip install -U pip setuptools
python -m pip install -U requests

Exit the Administrator command prompt and then open a command prompt as a regular user.

cd %AppData%
mkdir Python

Copy bmxtg-v1.2.zip into your %AppData%\Python directory and unzip.

Create a desktop shortcut to bmxtg.py. The “Target” should be “C:\Python27\pythonw.exe bmxtg.py” and the “Start in” directory should be “%AppData%\Python\bmxtg-v1.2”.

Be certain to review and follow the configuration notes in the README. Then, you’re ready to fire it up!

BMXTG 1.2 Released

The Brandmeister XTG Dialer (BMXTG) has been updated to version 1.2. Enhancements include automatic download of the masters address list and automatic download of talkgroup IDs and labels. Any talkgroup label may be changed through use of the talkgroups.conf file. Be sure to review the README file for changes.

DV4mini control panel in the background with the Brandmeister XTG Dialer in the foreground.

The changes will make BMXTG easier to configure and the user no longer needs to be concerned about IP address changes of the BM servers. A simple stop and start of the program will refresh the server list and talkgroup list automatically.

I’ve also updated the DV4mini Raspberry Pi 2/3 image to include BMXTG v1.2.

BMXTG is licensed under the Creative Commons Attribution + Noncommercial 3.0 License. Attribution Required / Noncommercial use permitted.

Tracking North Korean Numbers

My Aussie mate, Mark Fahey, has spent a number of years studying the Democratic People’s Republic of Korea.  He passes on the following information about North Korean “spy numbers” stations:

“The Pyongyang numbers (designated V15) have either become less regular or changed their schedule since March. Its been a few months since I have personally received them – but I also haven’t been specifically tuning in for them lately so maybe I have simply missed noticing a timing change.

“If you want to find the North Korean numbers, they are read out in a block between songs within the regular programing of the Pyongyang Pangsong radio station. The choice of music immediately before the number block seems to indicate which recipient agent the transmission is directed to. For Agent 27 “We Will Go Together with a Song Of Joy” is played, whereas Agent 21’s song is “Spring of my Hometown.”

“The announcements typically take between 5 to 10 minutes to read dependent on the number of digits passed. The transmission schedule is variable; in early 2017 the broadcast alternated with a cycle of one week on Thursday night at 12:45AM Pyongyang Time (1615 UTC) and the following week on Saturday night at 11:45PM Pyongyang Time (1515 UTC).

“Pyongyang Pangsong can be heard on these shortwave band frequencies (it is also on MF & FM on the Korean peninsular):

3250 kHz Pyongyang 100KW Transmitter
3320 kHz, Pyongyang 50KW Transmitter
6400 kHa Kanggye 50KW Transmitter”

If you’re interested in learning about what life is like “Behind the Curtain“, Mark has compiled a detailed multimedia publication based upon his actual observations inside North Korea.  It is available at no cost via iTunes.

RetroPie, A Tasty Gaming Platform

Retrogaming, the enjoyment of older computer based games and platforms, has been growing in popularity. I was intrigued a couple of years ago when, at a Vintage Computer Fest, I saw a multigame platform with hundreds of game ROMs copied onto a single emulation device. I had been wondering what the old games would look like connected via an HDMI input as opposed to the old low resolution RF transmitter method.

Then I came across the RetroPie project. RetroPie is a framework, delivered as an image, that allows you to run a number of game and computer system emulators on a Raspberry Pi. RPi models 2 and 3 are much better than older versions for this application. It is very simple to install and I was even able to use an old Colecovision controller to play Donkey Kong, Ladybug, and Carnival.

To connect the old controller, I came across a device called the Vision-daptor. One side sports a DB9 male connector, the other a USB B jack.  It arrived just a couple of days after my order.  The RPi recognized the device as a joystick controller without adding any additional drivers.

The Coleco emulation is handled by an optional component called CoolCV. CoolCV will also run under Linux, Mac and Windows. If you use a controller, rather than a keyboard, you may need to make some changes to key mappings in a configuration file.

There are plenty of sources for games online, but remember that games may still be covered by copyright. Some folks copy the contents of ROMs that they have purchased allowing them to play games for which they no longer have a gaming device. This requires some specialized hardware.

If you do download games via the internet, keep in mind that some sites may be vectors for the transmission of viruses and other malware. Exercise caution while you kill off those space invaders.  And the games do look great on an HDMI monitor!