RS-Decoder for Radiosonde's in Windows.


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-Decoders is a free open source radiosonde decoder for Windows/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 Virtual audio piping in Windows, and getting the GPS data to route with perl to into virtual COM port to use with GPS programs.
In this example Windows 10 1909 in VirtualBox is used with GPS-Mouse, RTL-SDR V3 / Airspy R2 SDR radio, SDR#, SDRConsole and APRS-Map Software.
Install x32 Software versionĀ“s for 32 Bit Windows (XP/7 ect) and offcourse x64 for 64 Bit Windows.

A new develop branch is active 'experimental' demodulation chains, which use David Rowe's FSK Demodulator to enable better tracking of drifty sondes.
It is expected that the new experimental demod chain will have a slightly higher CPU usage than the legacy chains,
though the exact impact is minimal.

These demodulators are intended for use in situations where radiosonde frequency drift is encountered, E.g. DFM's.

Refer to these tech-note's for details:

https://github.com/projecthorus/radiosonde_auto_rx/blob/master/auto_rx/test/notes/2019-04-26_fsk_demod.md
https://github.com/projecthorus/radiosonde_auto_rx/blob/master/auto_rx/test/notes/2019-04-23_rs41_highpass.md


Compile Decoders  


Download Decoders and Script

Unzip rs.zip and move to C:

Note:

All scripts are having output to com3 (pos2nmea.pl 2>COM3) <<-- change this if you have another port number!
Audio device is named "CABLE Output" in all script's!

When compiling also put pos2nmea.pl (NMEA perl script) in the decoder folder!
The perl script from GIT in folder RS/tools is only for Linux Usage.
Use the one above linked in rs.zip adapted for Windows NMEA!

And skip this part.


Or create manually, RS-Decoders can be compiled with cygwin.

Download the decoders source files,

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

Unzip
cd build/demod/mod
gcc -DCYGWIN -c demod_mod.c
gcc -DCYGWIN -c bch_ecc_mod.c

For RS-41:
gcc -DCYGWIN rs41mod.c demod_mod.o bch_ecc_mod.o -lm -o rs41mod

DFM:

gcc -DCYGWIN dfm09mod.c demod_mod.o -lm -o dfm09mod

Decoder Scripts


Example  DFM09 Script:

Create new file dfm09.bat with content:

@echo off
SET sox_path="C:\Program Files (x86)\sox-14-4-2\"
SET tail_path="C:\RS\decoders\"
SET perl_path="C:\Strawberry\perl\bin\"
SET dfm_path="C:\RS\decoders\"
%sox_path%sox.exe -q -t waveaudio "CABLE Output" -t wav - 2>nul | %dfm_path%dfm09mod.exe --dist --ptu -vv --auto >> C:\RS\log\dfm09_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt | %tail_path%tail.exe -f C:\RS\log\dfm09_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt | %perl_path%perl.exe pos2nmea.pl 2>COM3

Save it.

Example RS-41 Script:

Create new file rs41.bat with content:

@echo off
SET sox_path="C:\Program Files (x86)\sox-14-4-2\"
SET tail_path="C:\RS\decoders\"
SET perl_path="C:\Strawberry\perl\bin\"
SET rs41_path="C:\RS\decoders\"
%sox_path%sox.exe -q -t waveaudio "CABLE Output" -t wav - 2>nul | %rs41_path%rs41mod.exe --ecc2 --crc -vx --ptu >> C:\RS\log\rs41_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt | %tail_path%tail.exe -f C:\RS\log\rs41_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt | %perl_path%perl.exe pos2nmea.pl 2>COM3

Save it.

What does it all mean.

rs41mod -h
rs41mod [options] audio.wav
options:
 -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
options:
 -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/90

Setting up Virtual Audio/COM ports       


Download the windows version of sox and install.

Download Virtual Audio Cable and install.

Open VB-Audio Control Panel in options change Internal Sampling rate to 48000 Hz and reboot.

Download Com0Com x64 Program.

Install:



Make sure you have a virtual com port, otherwise change the number.
All scripts are having output to com3 (pos2nmea.pl 2>COM3) <<-- change this if you have another port number!



If everything is okay you have 2 new virtual COM ports in Windows Control Panel.



Download Perl x64 and install:

http://strawberryperl.com/releases.html

Needed for NMEA Perl Script for GPS Output.

SDR Radio Programs

      


SDR#:

https://airspy.com/download/



SDR Console:

https://www.sdr-radio.com/Software

GPS Setup

           
Download SAS-Planet GPS or use any favorite program.

http://www.sasgis.org/download/

SAS-Planet is free software with many Maps.
Minor is the city names from only Google Maps are displayed in Russian text.

We can change that, goto SAS.Planet\Maps\sas.maps\Google folder.
Inside each map folder is a params.txt except for the GoogleSat folder.

Find ru in the url link and change it into en example: DefURLBase=http://mt.google.com/vt/lyrs=m@169000000&hl=en
Remove SAS.Planet\cache and the maps are English.
 


Get it all Running!


Start your favorite SDR Software, make sure The [MME]CABLE Input is selected in Audio Options.



Tune into the Radiosonde signal.

Start the shortcut of the Decoder.bat.



Start SAS-Planet, goto GPS Tab and Select the correct serial COM port, Rate is always 4800 Baud.
Change device timeout to 6000 = Max.



Push the sat-icon and GPS should be connected and gives a current position of the radiosonde.



APRS-Map


APRS-Map can also show the current Radiosonde Position and your own position (offcourse a GPS-Mouse is required), or use your Android phone as a GPS.
In Offline Maps, without the need to sent data over the APRS Network.

Download APRS-Map for Windows:

http://wiki.oevsv.at/index.php?title=DXL_-_APRSmap_Download

Setup GPS:

Make sure you have the right COM Port number the GPS is connected to.
And replace this by the com1 example.

Make a gps.bat file and insert:

gps2aprs.exe -t com1:4800 -I CAR -i /k -D -0 30 -b 2 -v -r 127.0.0.1:9002

gps2aprs -h

 -t <tty>:<baud>            (com1:4800)
 -I <mycall>                   Mycall with SSID like NOCALL-15
 -D                                DAO Extension on for 20cm Resolution
 -b <s>                          Driving Beacon Time in Seconds (15)
 -r <x.x.x.x:destport>      Use AXUDP (to Soundmodem)
 -v                                  Verbous-Mode
 -i                                  Ballon /O, Car /> -i /k

Start gps.bat and NMEA data from your local GPS-Mouse should roll in:



Start SDR, decoder on the Radiosonde and APRS-Map.

Goto Config / Rf-Ports Tab:

  

Check RF-Port 1 and make sure its UDP1(ip:send:listen)|1|127.0.0.1:9001:9002



Check Serial Interface for the COM Port from the decoder in Example COM3:

Serial Task|1|gps2aprs.exe -t com3:4800 -I Sonde -D -0 30 -b 2 -v -r 127.0.0.1:9002

Press Okay and a new cmd window will popup like this:



The Radiosonde position should be Visible and every 30 Seconds the CAR Position will be updated.



All stuff running (SDR#, RS-Decoder, APRS-Map, RadioSonde output and Own GPS Position plotted on the Map:



Note's:

Fill in a callsign with optional SSID and QTH Location from the Online Menu.
Zoom to your QTH as far as you can 100% identify your home (zoom level <16).

Then open ONLINE - MY POSITION and point to your home.
While push and hold the SHIFT key click on your home.
The coordinates will be copied into the MY POSITION field, Just click OK to save them.

Aprsmap has a setting that should not be used. Config, Map Parameter, Trackfilter - please leave out!

Change start view:

Set the target area on the map.
Then click Zoom and with the Shift key pressed, left-click on this button:



The button is then called as the level (here: 11) and is used as a view at program start.
This view can also be called up with the "1" key.

In the same way, the three buttons on the right work next to it.
With Shift and click on the respective button the current view is saved, only the click (or the digit) calls up this view.

In response to these actions, there are brief messages at the top left. "View stored!" after saving and "Show One Symbol Off" after invoking a saved view.


Its possible to use other map sources, open and edit getosm.ini and change/insert:

1|0|http://tile.memomaps.de/tilegen/*.png|tiles_topo2|

For example OSM Map.

This must be changed in aprsmap.cfg also!

Map Names|1|tiles_topo2 0.25 25

The Map listed above will be the first one to show up.

Maps can be changed in Tools / Change Maps.

All Maps can be saved for Offline usage.

Howto about the regular functions and options from APRS-Map read the Wiki:

http://wiki.oevsv.at/index.php?title=DXL_-_APRSmap_englisch

ADB Android USB GPS


Com0com needs to be installed.

Add another pair of com ports, as the other com port is needed for RS-Decoder output.

Download ADB Android SDK.

Ensure the USB drivers for your mobile are installed on the PC.
Ensure that USB debugging is enabled on the mobile device.

Download ShareGPSPlaystore or APK4FUN

In Share GPS, create a new connection for NMEA USB.
With port 7777.
Connect your phone to a computer with the USB data cable.

Download ADB.bat
Move the batchfile into ADB Android SDK Folder.

Double click adb.bat
Ensure ADB detects the mobile.



The mobile may need to authorize access.
Check the phone screen.
You can close the adb screen.

Start the connection in Share GPS.



You should see USB listening in the status.

Download NmeaRouter

Install and select Configure/Profile/New
Name Profile Android USB
Configure/Connection/New



Ok.



Port: 7777 Like in ShareGPS.

Again Configure/Connection/New



Ok.



Select First Virtual Com Port (take care with the ones used for RS-Decoders!), check Windows - Control Panel Devices.



Now we see this, but there is not Route between our local ip and the com port..

Select Configure/Route/New



Enable and Ok.



Click Start, You also see on the phone in ShareGPS, USB Connected.
GPS NMEA Data Rolling in :)

Repeat Steps overhere but make sure to select second virtual com port for GPS Out!

Whenever done sending NMEA data, long press the connection in Share GPS and select Disconnect.
Kill ADB.exe in taskmanager, Stop Nmea-Router and Exit APRS-Map.

Android WiFi GPS


Com0com needs to be installed.

Add another pair of com ports, as the other com port is needed for RS-Decoder output.

Download Windows 7 GPS Sharing:  Playstore or APKPure



In Windows 7 GPS Sharing, Tap on Listing port change to port 7777.

Download NmeaRouter

Install and select Configure/Profile/New



Name Profile Android WiFi
Configure/Connection/New



Ok.



Port: 7777 and Ip adres of the Phone.

Again Configure/Connection/New



Ok.



Select First Virtual Com Port, check Windows - Control Panel Devices.

We need a route between the ip and com connection.
Select Configure/Route/New



Enable and Ok.



Click Start, You also see on the phone Client Connected.
GPS NMEA Data Rolling in :)

Repeat Steps overhere but make sure to select second virtual com port for GPS Out!

WSL And DxlAPRS

DxlAPRS is a free open source radiosonde decoder for Linux.
It supports Vaisala RS92, RS41, Graw DFM06/DFM09/DFM17/PS-15, and Meteomodem M10 Radiosondes.

Together with an RTL-SDR and RTL_TCP it is possible to receive radiosonde signals, and decode them using DxlAPRS and WSL in Windows.
This tutorial explains howto install WSL and DxlAPRS in Windows.