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 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:


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:


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 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/

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/ 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.

WordPress Appliance - Powered by TurnKey Linux