Checking the weather using packet radio

After spending some time playing around with BPQ, I have learned how powerful its applications interface is. I first followed a guide to create a system info application, allowing for checking system resources from afar. Today, I set out to create a weather application that allows the user to check their local (to the zip code) weather over packet.

Get the wx.py script at GitHub.

The script is written in Python, and is fairly simple. It only requires one module installation: requests, which is used for retrieving the JSON data from Openweathermap. This script requests the user’s zip code, and returns values such as:

  • Current temperature
  • “Feels like” temperature
  • Barometric pressure
  • Humidity
  • Wind speed, direction, gust speed
  • Textual description of the weather.
  • Rainfall amounts in the past 1, and past 3 hours
  • Snowfall amounts in the past 1 and past 3 hours

All you’ve got to do to run it is request an API key from Openweathermap, install the requests module via pip install requests, create the configuration file which simply consists of your API key, and run it. Running the program on its own for the first time instructions you how to create the configuration file, but it simply contains the following:

[DEFAULT]
api_key=YOURAPIKEY

Replace YOURAPIKEY with whichever key you’re assigned by Openweathermap.

If running it plainly, and not through BPQ, you’ll see a blank screen. This is because of a line in the code that waits for BPQ to send the user’s call, call = input(). This is done to capture the call string that is sent by BPQ by default to applications run through its application interface. Press enter at this blank screen and you’ll be prompted to enter the zip code for which you’d like to request the weather report.

In order to set the application up to run through BPQ, follow this guide. In my configuration, the entry in bpq32.cfg looks like:

APPLICATION 6,WX, C 2 HOST 2 S

When users connect to my node, they will see the “WX” option and are able to access it through that.

Please note that, after cloning the script from GitHub, you must make it executable. In Linux, this is accomplished by running the command chmod +x wx.py. If you don’t do this, it will not run when executed from BPQ.

Monitoring System Stats via BPQ & Python

While setting up my BPQ node, I came across another node that hosted an interesting application: System Info. This application displayed stats such as CPU usage, system uptime, available memory, etc. I think this would be interesting for remote management, so I decided to implement it.

I found this guide, which was very helpful, but it used the Perl language. Not a big fan of Perl (mostly because I don’t know it well), I wanted to rewrite the small script in Python. Here is the script. Before you run it, you’ll need to install the following modules:

  • py-cpuinfo
  • certifi
  • distro
  • psutil
  • uptime

I’ve included a requirements.txt file, so all you’ll have to do is run pip install -r requirements.txt. If you haven’t got pip install, run sudo apt install -y python3-pip.

Follow the guide linked to above, until you get to the scripting portion. Simply replace the line in /etc/inetd.conf with this:

bpqdemo    stream    tcp    nowait    YOURUSER  /usr/local/linbpq/sysinfo.py

make sure you change the path to wherever your linbpq installation is located. It will look like /home/USERNAME/linbpq, so the full path should look like /home/USERNAME/linbpq/sysinf.py. Also, don’t forget to replace YOURUSER with the username used to run linbpq.

The script has been tested on Ubuntu 20.04, but it should run anywhere. Hope you enjoy it! Feel free to submit pull requests if you have any ideas for improvements.

The KD5LPB-7 2m BPQ32 Node

Over the past month, I’ve been at work setting up a 2 meter BQP node here in Aurora, Colorado. I chose BPQ32 as it is full of features, is well supported, and is widely used. The nodes broadcast feature is attractive to me, as I think it would be cool to have an automatically generated list of nodes that are reachable from any one station.

I’m new to this mode and am learning something every day.

The node equipment:

  • Kenwood D710G
  • Intel NUC running linbpq on Ubuntu 20.04
  • 20m/440 mobile antenna

The D710G is a great rig for packet, as it comes with a built-in TNC. The built-in TNC has basic BBS functionality, but nothing compared to what is offered by BPQ.

While the antenna is subpar for a fixed node, it’s the best I can do while living in an apartment. It’s mounted to the balcony rail using an MFJ-1907 balcony mount. This seems to work fairly well, and achieves a 1.2:1 VSWR on the local packet frequency, 145.050.

Packet radio in Colorado is very much alive and well. I only wish more folks broadcast their nodes list so that a more comprehensive list of local nodes could be built.

My hierarchical route is KD5LPB.#NCO.CO.USA.NOAM

I can be mapped in BPQ via MAP kd5lpb-7 node.kd5lpb.com UDP 10093 B; Aurora, CO

WordPress Appliance - Powered by TurnKey Linux