RS-Decoder for Radiosonde's in Ubuntu Linux.

Vaisala RS-41

A radiosonde is a small weather sensor package that is typically attached to a weather balloon.
As it rises into the atmosphere it measures parameters such as temperature, humidity, pressure, GPS location etc, and transmits this data back down to a receiver base station using a radio signal.
Zilog's RS-Decoders is a free open source radiosonde decoder for Linux and it supports a wide range of radiosonde protocols.
Together with an RTL-SDR it is possible to receive radiosonde signals, and decode them using RS-Decoders.

This tutorial covers some tricky points like setting up audio piping in Linux CubicSDR or GQRX , and getting the GPS data into a virtual COM port to use with FoxtrotGPS.


      Intermet I-Met 1AB             

Make sure you have sox, perl, gpsd, socat and pulseaudio installed.

sudo apt-get install sox

sudo apt-get install perl

sudo apt-get install socat

sudo apt-get install pulseaudio

sudo apt-get install pavucontrol

sudo apt-get install gpsd gpsd-clients

Compile Decoders

          Vaisala RS-41  SGP                  

Download Decoders and Script

Updated compiled RS-Decoders are overhere.

And skip this part.

Or create manually

Download the decoders or just do a git clone


git clone git://

Compile decoders DFM-09/RS-41/M10, M20 or any other you need.

cd RS/demod/mod
gcc -c demod_mod.c -w -O3
gcc -c bch_ecc_mod.c -w -O3

echo "Compiling Mod RS41"
gcc rs41mod.c demod_mod.o bch_ecc_mod.o -lm -O3 -o rs41mod -w

echo "Compiling Mod DFM09"
gcc dfm09mod.c demod_mod.o -lm -O3 -o dfm09mod -w

echo "Compiling Mod M10/20"
gcc m10mod.c demod_mod.o -lm -O3 -o m10mod -w
gcc mXXmod.c demod_mod.o -lm -O3 -o mXXmod -w

Put compiled rs41mod and dfm09mod files in a folder decoders or smth.
Also put (NMEA perl script) from folder RS/tools in the folder!

Scripts, Setting up Virtual ports

              Vaisala RS-92             
We need to create a few scripts..

Example DFM:

Create new file with content:

echo "DFM Log" > /home/decoders/dfm09_`date +%Y%m%d%H`Z.txt
sox -t pulseaudio default -t wav - 2>/dev/null | ./dfm09mod --dist -vv --ptu --auto 2>&1 | tee -a /home/decoders/dfm09_`date +%Y%m%d%H`Z.txt | ./ > /tmp/virtualcom0

Save it.

Making Virtual COM Port.

Create new file with content:


echo "Creating Virtual Com Port: 0 and 1"

socat -d -d pty,link=${vcpath}/virtualcom0,raw,echo=0 pty,link=${vcpath}/virtualcom1,raw,b4800,echo=0 &
echo "socat pid=$socatpid"
sleep 2

trap "kill $socatpid &>/dev/null; exit 0" INT TERM EXIT

echo "Start GPSD on Virtual Com Ports"
killall -q gpsd
gpsd -D2 -b -n -N ${vcpath}/virtualcom1

Save it.


Create new file with content:


xfce4-terminal -T vp -e ./ --tab -T dfm -e ./

Save it.

Create new file with content:

sleep 1
sox -t pulseaudio default -t wav - 2>/dev/null | ./rs41mod --ecc2 --crc -vx --ptu 2>&1 | tee -a /home/decoders/rs41_`date +%Y%m%d%H`Z.txt  | ./ > /tmp/virtualcom0

Save it.

Create new file with content:

xfce4-terminal -T vp -e ./  --tab -T rs41 -e ./

Save it.

      Graw DFM-06        

chmod 755 all created scripts :)

Add username to dailout Group for COM port access/permissions:

sudo adduser <your_username> dialout

Make permissions for COM ports:

sudo chown -R <your_username:your_username> /tmp/virtualcom0

sudo chown -R <your_username:your_username> /tmp/virtualcom1

When you got errors, run ./ so the virtual ports are accessible in /tmp for setting chown permissions.


This tutorial was written using Ubuntu 16.04, on newer distro's you might have to change:

sox -t pulseaudio default into sox -t alsa default
If a wav error happens.

What does it all mean:

rs41mod -h
rs41mod [options] audio.wav
       -v, -vx, -vv  (info, aux, info/conf)
       -r, --raw
       -i, --invert
       --ths <x>    (peak threshold; default=0.7)
       --iq0,2,3    (IQ data)

dfm09mod -h
dfm09mod [options] audio.wav
       -v, -vv
       -r, --raw
       -i, --invert
       --ecc        (Hamming ECC)
       --ths <x>    (peak threshold; default=0.6)
       --json       (JSON output)

--ecc2 now also gives the output after each block how many bits the error correction has corrected. 
--ptu temperature Info
--dist is like ecc, but only blocks that belong to the same frame are taken, i. if errors occur, the frame is discarded / Inversed used for DFM06/09.

Install Driver         

Install RTL-SDR-Blog Driver (or any other):

git clone git://
cd rtl-sdr-blog/
mkdir build
cd build
sudo make install
sudo ldconfig
sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
echo blacklist dvb_usb_rtl28xxu >> blacklist-rtl.conf
echo blacklist rtl2832 >> blacklist-rtl.conf
echo blacklist rtl2830 >> blacklist-rtl.conf
sudo cp blacklist-rtl.conf /etc/modprobe.d/

For list of improvements visit:

SDR Radio programs

          Intermet I-Met 4             

Install Gqrx, 3 options:

sudo apt-get install gqrx
You get an old Gqrx version in Ubuntu 16.04 and no updates.

Follow Install Gqrx SDR on Ubuntu Linux and add PPA for install.

Or fast way (without GNU Radio setup) Download Gqrx Appimage:
chmod a+x Gqrx-2.11.5-x86_64.AppImage
And run,


CubicSDR, build from source or use Appimage
chmod a+x CubicSDR-0.2.5-x86_64.AppImage
And run,



Virtual Audio setup

                        Graw DFM-09                

Some virtual audio can be setup:

Adding these lines to this file ~/.config/pulse/ on Ubuntu 16.04, newer distro's have to change /etc/pulse/

load-module module-null-sink sink_name=VBCable_A sink_properties=device.description="VBCable_A"
load-module module-null-sink sink_name=VBCable_B sink_properties=device.description="VBCable_B"

Will always load the desired NULL sinks on starting the pulseaudio sound server.
Removing sinks that had been loaded by pactl or pacmd, i.e. without settings in our can most quickly done by pulseaudio -k

This command will kill the running pulseaudio instance, to instantaneaously respawn it (in a default set up) using values defined in the
Start SDR App tune in on WX-Station that launches DFM/RS or any Radiosonde you prefer.

It is recommend disabling PulseAudio logging, as this seems to be a large user of CPU cycles.

Edit /etc/pulse/daemon.conf
Now find "log-level" and change it to "log-level = error".
Remove the semi-colon on the log-level line too. Save and exit.

; log-target = auto
log-level = error
; log-meta = no
You can now reload pulseaudio either by rebooting, or running "pulseaudio -k" at a command line.



Dont forget PVAControl to setup the Virtual audio!

GPSD Setup

             Vaisala RS-92 Ozon                  

In order to use gpsd with the decoder, we have to disable the service.

So it can be manually started:

sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket

Should you ever want to enable the default gpsd systemd service you can run these commands to restore it:

sudo systemctl enable gpsd.socket
sudo systemctl start gpsd.socket

Start script ./ or ./

It will execute the script in 4 tabs terminals(vp and the chosen decoder).
The sleep commands are inserted so other processes( socat/gpsd) do not start before the decoder.

It will create with socat 2 pairs of Virtual Com Ports, 1 out other in, execute binary file.
NMEA data will be shown and the decoder.

As long as the socat (Terminal vp) is running, you have a pair of VPs open.

They are named virtualcom 0 and 1 so they stay static and no dev/pts/ number change.

Get it all Running

Need some GPS Applications to show Radiosonde position:

sudo apt-get instal foxtrotgps

Will install older FoxtrotGPS version from feed.

For newer versions build from source:
Dependencies -
Download source on FoxtrotGPS website.


Insert extra Maps for FoxtrotGPS.
Open FoxtrotGPS, goto Info Icon 3th screen, Map type's New:

For Thunderforest maps sign up free at their website to get api-key and insert it into the links below:


thunderforest_api_key = 123

Install Navit.
sudo apt-get install navit

It's recommended to follow this excellent guide about navit:

Download Offline Navit OSM Map's:

Tune in on a Radiosonde, run scripts.

Start FoxtrotGPS or Viking GPS to show Radiosonde current location and track.


Foxtrot gpsd-port: 2947