Zilog Decoder for Radiosonde's in Ubuntu Linux.


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

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.



Dependencies

      imet 
      Intermet I-Met 1AB             

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

sudo apt-get install sox

sudo apt-get install perl

sudo apt-get install pulseaudio

sudo apt-get install pavucontrol

sudo apt-get install gpsd gpsd-clients


Compile Decoders

                 rs41 
          Vaisala RS-41  SGP                  

Download Decoders and Script

And skip this part.


Or create manually

Download the decoders or just do a git clone

wget https://github.com/rs1729/RS/archive/master.zip

git clone git://github.com/rs1729/RS.git

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

copy file bch_ecc.c from RS/ecc folder to RS/demod

cd RS/demod

gcc -c demod.c

gcc -c demod_dft.c

gcc rs41dm_dft.c demod_dft.o -lm -o rs41dm_dft

gcc dfm09dm_dft.c demod_dft.o -lm -o dfm09dm_dft

put compiled rs41dm_dft and dfm09dm_dft files in a folder decoders or smth.

Also put pos2nmea.pl (NMEA perl script) from folder RS/tools in the folder.


Scripts, Setting up Virtual ports

      rs92 
              Vaisala RS-92             


Know we need to create a bunch of scripts..

First DFM:

Create new file dfm.sh with content:

#!/bin/bash

echo "DFM Log" > /home/decoders/dfm09_`date +%Y%m%d%H`Z.txt

sox -t pulseaudio default -t wav - 2>/dev/null | ./dfm09dm_dft --ecc -v --ptu > /home/decoders/dfm09_`date +%Y%m%d%H`Z.txt | sleep 2 | tail -f /home/decoders/dfm09_`date +%Y%m%d%H`Z.txt | ./pos2nmea.pl > /tmp/virtualcom0

exit

Save it.

Making Virtual COM Port.

Create new file vp1.sh with content:

#!/bin/sh

echo "Creating Virtual Com Port: 0 and 1"

socat -d -d pty,link=/tmp/virtualcom0,raw,echo=0 pty,link=/tmp/virtualcom1,raw,b4800,echo=0

sleep 2

Save it.

vp1

Create new file vp2.sh with content:

#!/bin/sh

echo "Start GPSD on Virtual Com Port"

sleep 2

killall gpsd

gpsd -D2 -b -n -N /tmp/virtualcom1

sleep 3

Save it.

vp2

Create new file vp3.sh with content:

#!/bin/sh

echo "Start GPS Pipe on 2947"

sleep 3

gpspipe -R localhost:2947

sleep 3

vp3

Create new file dfm_gps.sh with content:

#!/bin/sh

xfce4-terminal -T vp1 -e ./vp1.sh --tab -T vp2 -e ./vp2.sh --tab -T vp3 -e ./vp3.sh --tab -T dfm -e ./dfm.sh

Save it.


So much fun, know RS41 !

Create new file rs41.sh with content:

#!/bin/bash

sleep 1

sox -t pulseaudio default -t wav - 2>/dev/null | ./rs41dm_dft --ecc --crc -vx --ptu > /home/decoders/rs41_`date +%Y%m%d%H`Z.txt | sleep 3 | tail -f /home/decoders/rs41_`date +%Y%m%d%H`Z.txt | ./pos2nmea.pl > /tmp/virtualcom0

exit

Save it.


Create new file rs41_gps.sh with content:

#!/bin/sh

xfce4-terminal -T vp1 -e ./vp1.sh --tab -T vp2 -e ./vp2.sh --tab -T vp3 -e ./vp3.sh --tab -T rs41 -e ./rs41.sh

Save it.

         dfm06 
      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 ./vp1.sh so the virtual ports are accesable in /tmp for setting chown permissions.


Note:

This tutorial was written using Ubuntu 16.04, on 18.04 you might have to change:

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

SDR Radio programs

      imet4 
          Intermet I-Met 4             

Assuming RTL-SDR Driver is installed (or any other).

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,

./Gqrx-2.11.5-x86_64.AppImage


CubicSDR, build from source or use Appimage

chmod a+x CubicSDR-0.2.5-x86_64.AppImage

And run,

./CubicSDR-0.2.5-x86_64.AppImage

cubic

Virtual Audio setup

      dfm09 
                     
                        Graw DFM-09                

Some virtual audio can be setup:

Adding these lines to this file ~/.config/pulse/default.pa:

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 default.pa 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 default.pa.


Start SDR App tune in on WX-Station that launches DFM/RS or any Radiosonde you prefer.

audio

audio2

Dont forget PVAControl to setup the Virtual audio!


GPSD Setup

      o3 
             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 ./dfm_gps.sh or ./rs41_gps.sh

It will execute the script in 4 tabs terminals(vp1/2/3 and the chosen decoder).

The sleep commands are inserted so other processes( socat/gpsd) dont 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 in vp2/3 tab 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.



gpsd

Get it all Running


Need some GPS Applications to show Radiosonde position:

sudo apt-get instal foxtrotgps
sudo apt-get instal navit

or

sudo apt-get instal viking

Build from source if you want newer versions FoxtrotGPS or Viking GPS.

Tune in on a Radiosonde, run scripts and,

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

vik

Foxtrot gpsd-port: 2947


fox


fox2


vik2


Porting ports to Wine was not successful for me to use a Windows GPS App for showing position.

Have fun :)