I decided to re-fly a Vaisala RS41 radiosonde on an upcoming SF-HAB high-altitude balloon launch. The radiosonde must be reprogrammed on amateur radio frequencies, and I decided to use the RS41ng project by Mikael Nousiainen OH3BHX. This post is a companion post to setting up a Horus Binary receiving station.
Radiosonde Hardware
The radiosonde I randomly pulled out of my box was V1920305, launched over a year ago from Oakland on 8 August 2023. I picked it up the next morning from a construction zone in South San Francisco, and the construction guys just gave it to me after I asked about a balloon.
Building the firmware
On Linux, building the RS41ng firmware is ridiculously easy. You build a local docker container with the build environment, which takes up about 2.2 GBytes of storage (!?). After editing the configuration file, one command builds the firmware inside the docker container.
Here are the commands I ran, stolen from the detailed linux docker procedures:
~$ git clone https://github.com/mikaelnousiainen/RS41ng
~$ cd RS41ng
~/RS41ng$ vim src/config.h (edit with your configuration)
~/RS41ng$ docker build -t rs41ng_compiler . (this takes a while, creates rs41ng_complier docker container)
~/RS41ng$ docker run --rm -it -v $(pwd):/usr/local/src/RS41ng rs41ng_compiler (this generates the firmware)
The configuration file config.h
is pretty self-explanatory and well documented. The only things I changed were:
#define RS41
to tell it I was using a RS41.#define CALLSIGN "KF6ZEO"
to set my TX callsign.- Turned off APRS with
#define RADIO_SI4032_TX_APRS false
- Changed the TX frequency to
#define RADIO_SI4032_TX_FREQUENCY_HORUS_V2 431051000
. This frequency is the tone transmission frequency, not the dial frequency of 431.05 MHz. The tones are 1 kHz higher than the dial frequency to fit in the Upper-sideband passband of the receive radio. - Added my Horus v2 Payload ID to
#define HORUS_V2_PAYLOAD_ID
- Changed the TX time to 10 seconds with
#define HORUS_V2_TIME_SYNC_SECONDS 10
The RS41 firmware gets built into the build/src/RS41ng.elf
file. If you ever change any of the configurations in config.h
, just re-run the docker run
command above to generate a new firmware .elf file.
Hooking up the Radiosonde to the Programmer
The only hardware required (besides a radiosonde) is a ST-Link STM8/STM32 v2 Compatible Programmer. I'm using a cheap knockoff that works pretty well, and has a regulated 3.3v output for powering the STM chip while programming it.
Connect the programmer to the radiosonde:
- GND -> Radiosonde pin 1 (GND)
- SWDIO -> Radiosonde pin 9 (SWDIO)
- SWCLK -> Radiosonde pin 8 (SWCLK)
- 3.3V -> Radiosonde pin 5 (3.3V)
If the connections are successful, you should see the Red light on the bottom of the radiosonde light up. If your programmer doesn't have a 3.3v output, you can hook the batteries up and push the button.
Unlock the Radiosonde Flash
The first time you connect a radiosonde to the programmer, you gotta unlock the flash protection on the STM chip before programming. You'll probably need to sudo apt install openocd
first on your host system.
openocd -f ./openocd_rs41.cfg -c "init; halt; flash protect 0 0 63 off; exit"
Check the output of this command, it might fail. If you get a ERROR: last block must be <= 31
, use that number instead of 63. On two of my radiosondes, the magic number was 31. Note that this command must also be done from the ~/RS41ng directory.
Programming the Radiosonde
Make sure the ST-Link V2 programmer is still connected to the radiosonde, and the red LED is still lit. Program the radiosonde with this command in the ~/RS41ng directory:
openocd -f ./openocd_rs41.cfg -c "program build/src/RS41ng.elf verify reset exit"
After successful programming, unplug the ST-Link v2 programmer. Turn on the radiosonde by installing the batteries (negative goes nearest the sensor stalk connector) and pressing the button.
Ensure the radiosonde GPS antenna (above the Ublox G6010) has a clear view of the sky. The radiosonde will transmit every HORUS_V2_TIME_SYNC_SECONDS
even without a GPS lock, but the packets will not get uploaded to Sondehub (a warning will show in the . The red LED by the antenna will light when transmitting.
Receiving the Radiosonde
Always attenuate the receiver when transmitting nearby. This is to protect the receiver, as any RTL-SDR dongle with the Rafael R820T chip has a maximum input of +10 dBm. I typically use 90 dB of attenuation, as free-space path loss at 10 km at 430 MHz is about 105 dB.
I recommend using Horus-GUI to demodulate the signal when testing the radiosonde. It will show you signal strength and transmission period, and tell you the contents of the packet.
Unfortunately it's a bit of a kludge because you need SDR++ running in the background as the audio source. For more information, see my other blog post about receiving the Horus Binary signal.