Zilog Decoder for Radiosonde's in Ubuntu Linux.

Here we go:

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


Dowload Decoders and scripts


and skip this part


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.


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.

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.

Create new file vp3.sh with content:

#!/bin/sh

echo "Start GPS Pipe on 2947"

sleep 3

gpspipe -R localhost:2947

sleep 3

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.


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.


SDR-Radio:

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

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.3-x86_64.AppImage

And run,

./CubicSDR-0.2.3-x86_64.AppImage


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.

Dont forget PVAControl to setup the Virtual audio!


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.

Porting ports to Wine was not succesfull for me to use a Windows GPS App.

Need some GPS Applications to show Radiosonde position:

sudo apt-get instal foxtrotgps

or

sudo apt-get instal viking

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


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

Foxtrot gpsd-port: 2947

Viking: GPS-layer, Realtime Tracking Mode, gpsd-port: 2947

Enjoy :)



Thanks fly out to Zilog and Andreas6.


Happysat 2018