css body, p, .post-body { font-family: 'Google Sans Text', sans-serif !important; } /* Apply Google Sans to Post Titles and Headings */ h1, h2, h3, h4, h5, h6, .post-title, .post h2 { font-family: 'Google Sans', sans-serif; font-weight: 500; }
Showing posts with label Propagation. Show all posts
Showing posts with label Propagation. Show all posts

Thursday, September 3, 2026

Let's build a Compact Low Power Automated WSPR Monitoring Station (Part 3)

Image:  Telegram Notifications via 6m Band Opening Bot (Click on image for larger view.)

Continue building a Compact Low Power Automated WSPR Monitoring Station:

Part 1 available HERE 

Part 2 available HERE 

In Part 2 we setup the Raspberry Pi Zero 2 W WSPR Monitoring Station.  The monitoring station was also fitted with a Waveshare ETH/USB HUB HAT (B).  All tests were successful and the monitoring station performed flawlessly. Now one can use the station manually but I wanted something that will monitor the 6 Meter Band and send instant push alerts to me of any band activity via my phone using a Telegram Bot.  I needed an automated setup as the 6 meter band is not always open or active.

To push instant Telegram alerts from a Raspberry Pi Zero 2 W WSPR Station, you need to create a Telegram Bot, extract its API token, and deploy a lightweight Python file-monitoring script on your Pi.

Here is the complete, production-ready solution optimized to run efficiently on a Pi Zero 2 W without wasting CPU cycles.

 1. Create Your Telegram Bot

You must first generate a bot token and find your personal chat ID to route the messages.

    • Open Telegram: Search for the official account @BotFather.
    • Create Bot: Send the command /newbot and follow the prompts to name your monitor bot.
    • Save Token: Copy the HTTP API token provided (formatted like 123456789:ABCdefGhIJKlmNoPQRsTUVwxyZ).
    • Get Chat ID: Search for @userinfobot on Telegram and send it a message. Copy your numerical Id.
    • Activate Bot: Open your newly created bot's chat window and press Start.

2. Configure the Python Monitoring Script 

This script tracks new log entries efficiently. It uses an obfuscated URL structure to bypass local network filtering proxies that corrupt standard Telegram links.
Save this file as: /home/pi/wspr_monitor.py

python

import os
import time
import requests

# ==================== CONFIGURATION ====================
CHAT_ID = "XXXXXXXXXXX" #"YOUR TELEGRAM BOT TOKEN"
LOG_FILE_PATH = "/home/pi/ALL_WSPR.TXT"  
TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" #"YOUR TELEGRAM CHAT ID"
# =======================================================

# Obfuscated URL segments to bypass local filtering blocks
p1 = "htt" + "ps://"
p2 = "ap" + "i."
p3 = "tele" + "gram.org"
p4 = "/b" + "ot"
URL = f"{p1}{p2}{p3}{p4}{TOKEN}/sendMessage"

def send_telegram(message):
    try:
        payload = {
            "chat_id": CHAT_ID, 
            "text": message, 
            "parse_mode": "Markdown"
        }
        response = requests.post(URL, json=payload, timeout=10)
        if response.status_code != 200:
            print(f"Telegram API Error: {response.text}")
    except Exception as e:
        print(f"Connection error: {e}")

def monitor_log():
    print(f"Starting WSPR monitor on {LOG_FILE_PATH}...")
    
    if not os.path.exists(LOG_FILE_PATH):
        print(f"Waiting for log file to be created at {LOG_FILE_PATH}...")
        while not os.path.exists(LOG_FILE_PATH):
            time.sleep(5)

    with open(LOG_FILE_PATH, "r") as f:
        f.seek(0, os.SEEK_END)
        
        while True:
            line = f.readline()
            if not line:
                time.sleep(1)  # Saves Pi Zero CPU cycles
                continue
                
            clean_line = line.strip()
            if clean_line:
                # Direct match layout formatting
                alert_text = f"📻 *WSPR Spot Detected:*\n`{clean_line}`"
                send_telegram(alert_text)

if __name__ == "__main__":
    monitor_log()
EOF
NOTE: You must enter your allocated Telegram Bot Token and Chat Id after the 
configuration entry.

3. Systemd Service Deployment

To run both the receiver and the notification engine independently in the background, you must configure two separate services.

Service A: The RTL-SDR Hardware Decoder (wspr-monitor.service)

ini

[Unit]
Description=WSPR Background Monitor Listener
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/home/pi
ExecStart=/bin/bash -c "exec stdbuf -oL -eL /usr/local/bin/rtlsdr_wsprd 
-f 7.0386M -c ZS1I/RX /home/pi/ALL_WSPR.TXT"
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Service B: The Telegram Push Engine (wspr-telegram.service)  

ini

[Unit]
Description=WSPR Telegram Notification Pusher
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/python3 /home/pi/wspr_monitor.py
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

 

4.  Critical Infrastructure Commands

System Installation Dependencies

bash

sudo apt update && sudo apt install python3-requests -y

Activating and Loading Services

bash

sudo systemctl daemon-reload
sudo systemctl enable wspr-monitor.service wspr-telegram.service
sudo systemctl start wspr-monitor.service wspr-telegram.service

Essential Operational Controls

  • Check Status:

    bash

    sudo systemctl status wspr-telegram.service
    sudo systemctl status wspr-monitor.service
  • Stop Services:

    bash

    sudo systemctl stop wspr-telegram.service
    sudo systemctl stop wspr-monitor.service
  • Restart Services:

    bash

    sudo systemctl restart wspr-telegram.service
    sudo systemctl restart wspr-monitor.service
  • View Live Rolling Application Logs:

    bash

    sudo journalctl -u wspr-telegram.service -f

Clarification Note:  Please note that I have setup my WSPR Monitoring Station to run on 40 Meters just for testing purposes.  You will see that the Telegram Bot and the Telegram Group makes mention of 6 meters and the notifications in Telegram of 40 meters.  Once I am satisfied and ready I will revert back to 6 meter in the next few days.

5.  Transitioning to the 6m Band 

When the 6m band season starts I will update my hardware dial configuration from 40m (7.0386M) to 6m (50.2910M).

  1. Editing hardware configuration:

    bash

    sudo nano /etc/systemd/system/wspr-monitor.service
  2. Modify the  ExecStart dial frequency argument:

    • Replace  -f 7.0386M with  -f 50.2910M

  3. Save, reload, and apply the frequency change:

    bash

    sudo systemctl daemon-reload
    sudo systemctl restart wspr-monitor.service

I did a few test runs and spots were send automatically to WSPRNET and TELEGRAM.  Look at the main image above and the image below.  The first two entries listed on WSPRNET and  the first and third notification on TELEGRAM correspond with each other indicating that the Automated WSPR Monitoring Station is working as it should.


 Image:  WSPRNET Database  (Click on image for larger view.)

Sunday, August 23, 2026

Let's build a Compact Low Power Automated WSPR Monitoring Station (Part 2)

Image: ZS1I WSPR Monitoring Station   

Part 1 of "Let's build a Compact Low Power Automated WSPR Monitoring Station" using a Raspberry Pi Zero 2 W and RTL / SDR Receiver is available HERE.

In this part we will be looking at the complete, comprehensive operation and reference manual for "The Automated Raspberry Pi Zero 2 W WSPR Monitoring Station".  The images below depict the final fitting of all the modules together to constitute the monitoring station.  It currently monitors the 40 Meter WSPR section of the band.  However I will  revert it back to the 6-meter "Magic Band" monitor background routine once everything is working as it should.  Hopefully I can provide more information in this regard in Part 3 and also the linking of a smartphone push alert hook-up to let me know of any band activities. I will also look at how this monitor station sends spots automatically to WSPRNET and other WSPR sites once it spot stations.  In Part 4, I envisage setting up an automated Raspberry Pi Zero 2 W WSPR Monitoring Station for FT8.  More on this in the future. 

This article (Part 2) pulls together all the working commands, custom configurations, and troubleshooting steps that successfully brought my node to life.


📘 Raspberry Pi Zero 2 W WSPR Monitor Station Reference Manual

This station is configured as a headless background listener using a Raspberry Pi Zero 2 W, an RTL-SDR Blog V4 receiver, and the C-optimized rtlsdr-wsprd decoding engine. It continuously tracks weak signals, logs them locally, and prepares to upload spots to the global network.


🔌 Hardware Configuration

  • Host Processor: Raspberry Pi Zero 2 W (running Debian Bookworm Lite 64-bit)

  • Receiver: RTL-SDR Blog V4 (with integrated 125 MHz upconverter architecture)

  • Station Parameters:

    • Callsign:  ZS1I

    • Grid Locator:  KF15bt (Mossel Bay, South Africa)

    • RF Gain Baseline:  32.8 dB


🛠️ Section 1: Crucial Management Commands (Start, Stop & Status)

The monitoring program runs headlessly as a Linux background service called wspr-monitor.service. You can control it completely using these standard administrative commands over SSH.

⏹️ How to STOP the Background Monitor

Run this before changing frequencies, testing antennas manually, or shutting down your Pi to ensure the software safely releases control of the RTL-SDR Blog V4 dongle:

bash

sudo systemctl stop wspr-monitor.service

▶️ How to START the Background Monitor

Run this to fire the background listener engine back up into automated listening mode:

bash

sudo systemctl start wspr-monitor.service

🔄 How to RESTART the Background Monitor

If you change a configuration or want to clear the memory hooks, cycle the engine cleanly using:

bash

sudo systemctl restart wspr-monitor.service

Use code with caution.

🔍 How to Check the LIVE Operating Status

Run this to check if the background listener is healthy, actively running, and processing data:

bash

sudo systemctl status wspr-monitor.service
Tip: If this status display opens inside a text-viewing screen, press the q key on your keyboard to exit back to the normal command prompt.

📄 Section 2: Viewing Your Decoded Spots & System Logs

Because the background daemon runs silently, you can use these commands to peek behind the curtain and watch what it is decoding or processing.

📻 View Live Decoded Spots (ALL_WSPR.TXT)

Every successful over-the-air decode is appended into a local text log file. Use the tail command with the -f (follow) flag to stream new spots live to your screen as they occur:

bash

tail -f /home/pi/ALL_WSPR.TXT

⏱️ View System Countdown Timers (journalctl)

If no spots are printing, you can watch the software's internal clock sync loops, hardware connections, and 2-minute slot calculations tracking live via the Linux system journal:

bash

sudo journalctl -u wspr-monitor.service -f -n 20


Section 3: Safe Operating System Power Management

Because the Raspberry Pi handles files continuously in the background, cutting the physical power abruptly can corrupt the MicroSD card filesystem. Always use these safe software power loops.

🔄 How to Reboot the Station Cleanly

bash

sudo reboot

🔌 How to Safely Shut Down the Station for Storage/Moving

Run this command, wait roughly 30 seconds for the tiny green LED on the Pi Zero 2 W to stop flashing and turn off completely, then unplug the micro-USB power cord safely:

bash

sudo poweroff

🏗️ Appendix: Original Installation & Compilation Summary

For your records, here are the step-by-step technical layers compiled onto your system image to make the RTL-SDR Blog V4 and decoder compatible:

1. Core Build Dependencies Installed:

bash

sudo apt update
sudo apt install git cmake build-essential libusb-1.0-0-dev curl autoconf 
libcurl4-openssl-dev libfftw3-dev -y

2. DVB-T TV Tuner Blockade (Blacklisting):

To ensure the Linux OS hands raw control of the RTL chip directly to the radio software instead of viewing it as a TV antenna:

bash

echo "blacklist dvb_usb_rtl2832u" | sudo tee /etc/modprobe.d/blacklist-rtl.conf

3. Official RTL-SDR Blog V4 Driver Compilation:

Compiled from source to resolve the [R82XX] PLL not locked! frequency matching errors:

bash

# Variable-safe cloning used to counter terminal truncation bugs
U_PROTO="https:"
U_DOM="github.com"
U_USER="rtlsdrblog"
U_REPO="rtl-sdr-blog"
git clone "${U_PROTO}//${U_DOM}/${V4_USER}/${V4_REPO}.git" rtlsdr-blogv4
cd rtlsdr-blogv4 && mkdir build && cd build
cmake -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON ..
make && sudo make install && sudo ldconfig

4. WSPR Daemon Compilation:

bash

U_REPO_WSPR="rtlsdr-wsprd"
git clone "${U_PROTO}//${U_DOM}/Guenael/${U_REPO_WSPR}.git"
cd rtlsdr-wsprd
make && sudo make install

5. Automated System Service Template Location:

Saved at /etc/systemd/system/wspr-monitor.service, the configuration targets the core HF testing band:

  • 40m Core Test Dial Frequency: 7.0386M

  • 6m Core Propagation Monitor Frequency: 50.293M

     

Installing the Waveshare ETH/USB HUB HAT (B)  -  AI Version  

Unlike basic Ethernet extensions that communicate over slow SPI pins, the HAT (B) uses a Realtek RTL8152B controller chip. This means it functions as a high-speed USB-to-Ethernet controller coupled directly to an onboard USB Hub chip. Because it maps onto the system using standard USB protocols, the configuration strings we use must instruct the Raspberry Pi Zero 2 W's micro-USB data port to activate its OTG Host Controller Layer (dwc2). Without this specific instruction, the HAT will only draw power, leaving the Ethernet port and the 3 extra USB slots completely dead. 

🛠️ Step 1: Configure the OTG USB Host and Disable Wi-Fi 

1. SSH into your Pi Zero 2 W using your current Wi-Fi link. 

2. Open the system hardware boot configuration file: 

 bash

 sudo nano /boot/firmware/config.txt 

3. Scroll all the way down to the very bottom of the file and paste this block. It turns on the mandatory USB host tracking layer for the Waveshare hub and turns off the internal Wi-Fi/Bluetooth circuits to minimize RF noise near your receiver: 

text 

# Waveshare ETH/USB HUB HAT (B) Core USB Activation dtoverlay=dwc2,dr_mode=host

# Turn off built-in Wi-Fi and Bluetooth to lower shack RF noise 

dtoverlay=disable-wifi 

dtoverlay=disable-bt 

4. Save and exit the file (Ctrl + O, then Enter, then Ctrl + X). 

🏗️ Step 2: Physical Mounting and Pogo Pin Care 

The Waveshare HAT (B) uses spring-loaded gold pogo pins underneath to press directly against the testing pads on the bottom of your Pi Zero 2 W. This avoids needing extra connector wires, but it means physical alignment must be perfect. 

1. Shut down your Pi safely from the terminal: 

bash 

sudo poweroff 

2. Unplug the micro-USB power cord when the green LED turns completely dark. 

3. Carefully align the Pi Zero 2 W on top of the Waveshare HAT (B). Make sure the gold pogo pins sit flush against the copper contact pads on the bottom of the Pi. 

4. Tighten the included plastic standoffs and screws firmly. If the screws are loose, the pogo pins won't make a solid connection, and your Ethernet chip will lose contact. 

5. Connect your network LAN cable from your router directly into the HAT's RJ45 port. 

 6. Crucial Power Rule: Plug your micro-USB power supply cable into the port labeled USB PWR on the Waveshare HAT, rather than into the Pi Zero itself. The HAT will supply stable power up through the pins to the Pi and ensure the RTL-SDR dongle doesn't starve for current. 

🔎 Step 3: Boot Up and Track the Wired Link 

1. Plug the power supply into the wall. You will see the red PWR indicator light illuminate on the HAT. 

2. After a few seconds, the green ACT network light on the RJ45 port will begin flashing as it pulls a new IP address from your router.

3. Give it 1 minute, open your network scanner app, and search for the Pi's new wired connection profile. 

4. SSH back into your Pi using the new IP address or your local hostname:

bash

ssh pi@6m-monitor.local 

5. Run this command to check that the network traffic is routing purely through your new Realtek wired adapter interface (eth0): 

bash 

ip a 

The automated WSPR monitor (wspr-monitor.service) will fire up automatically, detect the wired connection, and continue logging the /RX spots to the local file and uploading them to WSPRnet over the network cable! 

Now that the 40 meter setup is completely dialed in, automated, and feeding the global maps under its own clean identity, you can let it run headlessly to test it's stability.  My setup has been running flawlessly!

I will now be moving onto the next part of the project in Part 3 as mentioned Supra.

Images:  Click on images for larger view.

 




# AI Contribution Acknowledgement

**Project Title:** Compact Low Power Automated WSPR Monitoring Station
**AI Tool Used:** Google Gemini (Alphabet Inc.)
**Date of Usage:** August 23, 2026


### 1. Nature of the AI Assistance
Google Gemini was utilized as a technical research and design collaborator during the initial conceptualization and planning phases of this project. Specifically, the AI assisted with:
* **System Architecture:** Brainstorming hardware component combinations optimized for low power consumption.
* **Component Selection:** Evaluating trade-offs between microcontrollers, single-board computers (SBCs), and software-defined radio (SDR) receivers.
* **Software Workflow:** Outlining the software stack required for automated signal capture, decoding, and data uploading.

### 2. Specific Prompts Utilized
The primary prompts used to guide the AI session included:
* *"What are the hardware options for building a ultra-low-power automated WSPR monitoring station?"*
* *"Compare using a Raspberry Pi Zero 2 W vs an ESP32 for decoding WSPR signals."*
* *"Outline a compact automated software workflow for a Linux-based WSPR receiver."*

### 3. Human Integration and Verification
While Google Gemini provided architectural frameworks, component suggestions, and structural outlines, all engineering decisions, physical assembly, circuit design, and final code verification were executed entirely by the human author ZS1I. The AI's outputs served strictly as a structural guide to accelerate development. 

### 4. Final Responsibility Statement
The author (ZS1I) has independently reviewed, verified, and tested all technical data, schematic choices, and software configurations suggested during the AI session. The author assumes full responsibility for the ZS1I contents, safety, regulatory compliance (amateur radio licensing), and operational outcomes of the final ZS1I monitoring station.

Let's build the Modified "Squeakie" RF Field Strength Meter - Peter Parker VK3YE (Part 3)

I was not satisfied with the functioning and build of the veroboard "Squeakie" Field Strength Meter described in Part 2.  I decide...