Steve SpenceKK4HFJ · Advanced Research Systems

Building Box Nineteen

A solar-powered 2-meter packet mailbox, by Steve Spence, KK4HFJ

In the story, Mr. Hale puts a gray box on the knob behind Opal Ward’s store. The box holds messages until somebody comes for them, beacons every half hour so anyone listening knows it’s alive, and shuts itself down instead of killing its battery when the sun stays away too long. This post covers how to build the real one. I’m putting mine up in Clay County, Tennessee. (New here? Read the story first.)

Everything here is off-the-shelf or free. Measure your own currents and check your own settings against the docs before you leave a box unattended on a hill.

What it does

  • Runs 1200-baud AX.25 packet on a 2m simplex frequency.
  • Answers connects as a node with a small BBS (personal mailbox). A passing station connects, picks up mail, and drops mail off.
  • Forwards anything addressed to a partner BBS (Opal’s “COUNTY” line) on its own.
  • Sends an APRS beacon every 30 minutes with its battery voltage. That’s the nod to Bob Bruninga, WB4APR.
  • Runs unattended on solar, survives power loss, and restarts itself if it hangs.

Parts

Part What I’m using / looking for Notes
Computer Raspberry Pi Zero 2 W (a Pi 3B+ or 4 works too) The Zero 2 W idles under a watt. Measure yours.
Sound interface USB sound adapter, CM108/CM119 chipset Direwolf can key PTT from the CM108’s GPIO pin, so no separate PTT circuit is needed. A Digirig is a ready-made version.
Radio Any 2m FM radio with a data port or mic/speaker jacks Receive current drives the whole power budget. Turn the backlight off and measure.
Antenna J-pole, on a guyed mast Copper pipe or ladder line. Opal’s “copper pipe bent like the letter J.”
Charge controller Victron SmartSolar MPPT 75/10 Load output with programmable low-voltage disconnect. The VE.Direct port gives you battery voltage for the beacon.
Battery 12V LiFePO4 with low-temperature charge cutoff, or AGM Sized below. It freezes on the knob.
Panel 50–100W Sized below.
Enclosure NEMA-rated box, gland fittings Ferrites on every cable.
Cable VE.Direct to USB For reading the controller.

How it’s wired

Solar panel ──► Victron 75/10 ──► Battery
                     │
                     └─ Load output (LVD) ──► 12V bus
                                               ├─► Radio
                                               └─► 12V→5V buck ──► Pi Zero 2 W
                                                                    ├─ USB: CM108 sound adapter ──► Radio data port (audio + PTT)
                                                                    └─ USB: VE.Direct cable ──► Victron (battery voltage)

The load output is what makes Opal’s box shut itself down. When the battery drops to the disconnect voltage, the controller cuts the radio and the Pi, then turns them back on when the panel brings the battery back up. Because the Pi loses power hard, the filesystem must be read-only (see “Making it survive”).

Power budget

The radio dominates. Here’s a worked example. Plug in your own measurements.

Load Watts Hours/day Wh/day
Pi Zero 2 W, idle 0.8 24 19
Radio, receive (backlight off) 1.5 24 36
Radio, transmit (beacons + traffic) 25 0.1 3
Buck converter losses 5
Total ~63

Panel: Middle Tennessee gets roughly 2.5–3 peak sun hours in December. At 3 hours and a 0.7 derate, 63 Wh/day needs about 30W just to break even. Use 50W minimum, 100W if you want to recover fast after a cloudy week.

Battery: Five days with no sun is 63 × 5 ≈ 315 Wh. A 12V 30Ah LiFePO4 (about 384 Wh) covers it. Mr. Hale’s second battery after the storm took Opal’s box from four or five days to a week, which is the right instinct.

A 2m mobile radio idling with the backlight on can pull 0.3–0.6 A, which is 4–8W around the clock. That alone would triple this budget. Pick the radio carefully, or use a handheld on a battery eliminator.

Software

1. Raspberry Pi OS Lite

Flash Raspberry Pi OS Lite (64-bit) with the Imager, set the hostname (box19), enable SSH, then update:

sudo apt update && sudo apt full-upgrade -y

2. Direwolf (the software TNC)

sudo apt install -y direwolf

Find the sound adapter’s card number:

arecord -l

/etc/direwolf.conf, minimal (replace the call and position):

ADEVICE plughw:1,0
CHANNEL 0
MYCALL KK4HFJ-7
MODEM 1200
PTT CM108

AGWPORT 8000
KISSPORT 8001

# APRS beacon every 30 minutes with battery voltage in the comment
PBEACON delay=1 every=30 overlay=S symbol="digi" lat=36^33.00N long=085^30.00W commentcmd="/usr/local/bin/box19-volts.py"

Then set receive and transmit audio levels with alsamixer. Watch Direwolf’s audio level readout on received packets. Around 50 is a good target. Too hot and it decodes nothing.

3. Battery voltage for the beacon

The Victron streams a text protocol over VE.Direct. The V field is battery voltage in millivolts. /usr/local/bin/box19-volts.py:

#!/usr/bin/env python3
# Prints a short APRS comment like: "BOX19 12.84V"
import serial

with serial.Serial("/dev/ttyUSB0", 19200, timeout=3) as port:
    for _ in range(40):
        fields = port.readline().decode("ascii", "ignore").split()
        if len(fields) == 2 and fields[0] == "V":
            volts = int(fields[1]) / 1000
            print(f"BOX19 {volts:.2f}V")
            break
    else:
        print("BOX19 V?")
sudo apt install -y python3-serial
sudo chmod +x /usr/local/bin/box19-volts.py

That beacon is exactly what Harlan was watching from the courthouse. When it stops, something’s wrong.

4. LinBPQ (node, BBS and forwarding)

LinBPQ, by John Wiseman, G8BPQ, provides the node, the mailbox and BBS forwarding. It talks to Direwolf over KISS on TCP port 8001. A starting point for the radio port in bpq32.cfg:

PORT
 PORTNUM=1
 ID=2m Direwolf
 TYPE=ASYNC
 PROTOCOL=KISS
 IPADDR=127.0.0.1
 TCPPORT=8001
 CHANNEL=A
ENDPORT

You then enable the BBS application, set your node call and alias (BOX19), and set up a forwarding partner, which is the “COUNTY” station. BPQ’s syntax is particular and changes between versions. Build the rest from the current LinBPQ documentation and its web management pages, not from memory. I’ll post my working config once the box is on the air.

5. Opal’s screen

Opal never sees a command prompt. She gets a big-text menu with two choices, WRITE and READ, written in Python. It talks to LinBPQ over its local telnet port. That front end is its own post.

Making it survive

  • Read-only root. In sudo raspi-config, go to Performance Options, then Overlay File System, and enable it. The Pi can lose power at any moment and boot clean. Keep the mailbox data on a separate writable partition or USB stick.
  • Hardware watchdog. In /etc/systemd/system.conf, set RuntimeWatchdogSec=15. If the Pi hangs, it reboots itself.
  • Low-voltage disconnect. Set the Victron load output to disconnect well above the battery’s protection cutoff and reconnect a volt or so higher.
  • Ferrites on the audio, USB and power leads at both ends. RF in the audio path causes most of the strange problems you’ll see.
  • Guy it well. Screw anchors, not stakes. Or a big old cedar.

The antenna’s blind spot

A J-pole is a vertical, and a vertical has a null straight overhead. That’s fine for stations on the horizon. In the story it’s why the Hale rig hears the box on the low approach and loses it overhead. If you need overhead coverage, for satellites or an aircraft, a turnstile or eggbeater antenna fills the null.

Licensing

Running a data station under automatic control on 2m is allowed under Part 97. The box is your station, and you’re responsible for what it sends. If people who aren’t licensed type messages into it, that’s third-party traffic and comes with its own rules. In a real emergency, Part 97 lets an amateur station use whatever means it has to protect life. Opal would have been covered that Saturday. The rest of the year, get your users licensed.

What’s next

  1. Bench test: Pi, sound adapter, radio into a dummy load, Direwolf decoding.
  2. Measure real currents and redo the power budget.
  3. LinBPQ BBS and forwarding to a partner station.
  4. Opal’s WRITE/READ front end.
  5. Mast, guys, J-pole and solar on the hill.

73, Steve, KK4HFJ