This will probably only serve my terrible memory in a couple of months when I revisit the topic and I have forgotten how I made it work, but I've heard AI guys are running out of training material so...
What is GNSS-SDR
From their ownrepo:
GNSS-SDR This program is a software-defined receiver which is able to process (that is, to perform detection, synchronization, demodulation and decoding of the navigation message, computation of observables, and, finally, computation of position fixes) Global Navigation Satellite System's signals
Necessary materials for this tutorial
- LNA GNSS Antenna (in my case this)
- RTLSDR V3-V4 recommended since they have software enabled Bias Tee
- Computer running Debian based system (Debian 9, Ubuntu 14.10 or above, in my case Ubuntu 24.04).
Prerequisites
From the README.md we can just follow along and install:
$ sudo apt install build-essential cmake git pkg-config libboost-dev libboost-date-time-dev \
libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \
libboost-serialization-dev liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr \
libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev \
libssl-dev libpcap-dev libmatio-dev libpugixml-dev libgtest-dev \
libprotobuf-dev libcpu-features-dev protobuf-compiler python3-mako
Install OsmoSDR
This library is necessary to run the RTLSDR dongle:
$ git clone git://git.osmocom.org/osmo-sdr.git
$ cd osmo-sdr/software/libosmosdr
$ mkdir build
$ cd build/
$ cmake ..
$ make
$ sudo make install
$ sudo ldconfig
$ cd ../..
$ git clone git://git.osmocom.org/gr-osmosdr
$ cd gr-osmosdr
$ mkdir build
$ cd build
$ cmake .. -Wno-dev
$ make
$ sudo make install
$ sudo ldconfig
Install GNSS-SDR
By default master contains the latest stable version, so just clone the repository and change into the directory. However, we'll enable OsmoSDR before running cmake:
$ git clone https://github.com/gnss-sdr/gnss-sdr.git
$ cd gnss-sdr
# Now, enable
$ cmake -S . -B build -DENABLE_OSMOSDR=ON
$ cmake --build build
At the time of writing, some tests are failing to build. These are being built after the library so th error does not affect this tutorial. Once built, check that the binary has been generated in gnss-sdr/build/src/main/gnss-sdr, and feel free to install system-wide. Otherwise you can just execute from within the folder. My recommendation is that if you are going to work heavily with this library, it makes sense to install it systemwide, but if you are just casual testing it, it's not worth it.
$ sudo cmake --install build
Now, let's add the configuration
In the this link we can find several configuration files. We are interested in the final result, but we are going to enable the line that activates the Bias Tee. I'd recommend create a new folder and copy paste this configuration on it. Running the program will generate a big amount of files wherever you are running it so this will contain the spread.
[GNSS-SDR]
;######### GLOBAL OPTIONS ##################
GNSS-SDR.internal_fs_sps=2000000
;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=Osmosdr_Signal_Source
SignalSource.item_type=gr_complex
SignalSource.sampling_frequency=2000000
SignalSource.freq=1575420000
SignalSource.gain=50
SignalSource.rf_gain=40
SignalSource.if_gain=30
SignalSource.AGC_enabled=true
SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
;# Please note that the new RTL-SDR Blog V3 dongles ship a < 1 PPM
;# temperature compensated oscillator (TCXO), which is well suited for GNSS
;# signal processing, and a 4.5 V powered bias-tee to feed an active antenna.
;# Whether the bias-tee is turned off before reception depends on which version
;# of gr-osmosdr was used when compiling GNSS-SDR. With an old version
;# (for example, v0.1.4-8), the utility rtl_biast may be used to switch the
;# bias-tee, and then call gnss-sdr.
;# See https://github.com/rtlsdrblog/rtl_biast
;# After reception the bias-tee is switched off automatically by the program.
;# With newer versions of gr-osmosdr (>= 0.1.4-13), the bias-tee can be
;# activated by uncommenting the following line:
SignalSource.osmosdr_args=rtl,bias=1
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Pass_Through
;######### CHANNELS GLOBAL CONFIG ############
Channels_1C.count=8
Channels_1B.count=0
Channels.in_acquisition=1
Channel.signal=1C
;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition_1C.item_type=gr_complex
Acquisition_1C.coherent_integration_time_ms=1
Acquisition_1C.pfa=0.01
Acquisition_1C.doppler_max=5000
Acquisition_1C.doppler_step=250
Acquisition_1C.dump=false
Acquisition_1C.dump_filename=./acq_dump.dat
;######### TRACKING GPS CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.dump=false
Tracking_1C.dump_filename=./tracking_ch_
Tracking_1C.pll_bw_hz=35.0;
Tracking_1C.dll_bw_hz=1.5;
Tracking_1C.pll_bw_narrow_hz=2.5;
Tracking_1C.dll_bw_narrow_hz=0.5;
Tracking_1C.extend_correlation_symbols=1;
Tracking_1C.dll_filter_order=2;
Tracking_1C.pll_filter_order=3;
Tracking_1C.early_late_space_chips=0.5;
Tracking_1C.early_late_space_narrow_chips=0.25
;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder_1C.dump=false
;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables
Observables.dump=false
Observables.dump_filename=./observables.dat
Observables.enable_carrier_smoothing=false
Observables.smoothing_factor=200
;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX
PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad
PVT.enable_rx_clock_correction=false
PVT.output_rate_ms=100
PVT.rinexobs_rate_ms=100
PVT.display_rate_ms=500
PVT.dump_filename=./PVT
PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea;
PVT.flag_nmea_tty_port=false;
PVT.nmea_dump_devname=/dev/pts/4
PVT.dump=false
PVT.flag_rtcm_server=true
PVT.flag_rtcm_tty_port=false
PVT.rtcm_dump_devname=/dev/pts/1
Turn on Bias Tee
Bias tee: electronic component used to inject DC power into a coaxial cable carrying radio RF signals, without interference. We'll use it to power the LNA in our active GNSS antenna.
How to turn on Bias Tee in RTLSDR
V3 and V4 introduces a 4.5V bias tee that can be toggled entirely in software.
Our configuration file is telling gnss-sdr to activate the Bias Tee but sometimes it doesn't work, so you can always enable it manually. If it is enabled and it is asked to be enabled again nothing will happen.
To manually activate the Bias Tee, you need to install the drivers (which is anyway necessary to uset he dongle) and just run the tool.
$ rtl_biast -b0
Found 1 device(s):
0: RTLSDRBlog, Blog V4, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R828D tuner
RTL-SDR Blog V4 Detected
You can find more information scrolling to "Software Selectable Bias Tee" in the following link: https://www.rtl-sdr.com/v4/
Run!
Now let's just run the program with the configuration file, and wait for it to get a fix!
$ gnss-sdr -config-file gnss-rtl.conf
Troubleshooting
After some seconds you should start seeing connections with satellites in the logs.
...
Current receiver time: 17 s
Tracking of GPS L1 C/A signal started on channel 5 for satellite GPS PRN 21 (Block IIR)
Current receiver time: 18 s
Tracking of GPS L1 C/A signal started on channel 0 for satellite GPS PRN 20 (Block IIR)
Tracking of GPS L1 C/A signal started on channel 1 for satellite GPS PRN 22 (Block IIR)
Current receiver time: 19 s
Current receiver time: 20 s
Tracking of GPS L1 C/A signal started on channel 3 for satellite GPS PRN 05 (Block IIR-M)
...
If this is not happening:
- Try to get a better sky-view for your antenna
- Check that your Bias Tee is enabled: RTLSDR V4 has a red light that iluminates when it is enabled. Try to enable-disable it manually couple of times to make sure it starts (an internal fuse can be burnt if it's not working) and verity it also starts when you run
gnss-sdr
Fix!
If everything goes well, after some minutes you'll get a fix and finally you'll know where the heck you are! Congrats!
New GPS NAV message received in channel 3: subframe 2 from satellite GPS PRN 05 (Block IIR-M) with CN0=46 dB-Hz
New GPS NAV message received in channel 0: subframe 2 from satellite GPS PRN 20 (Block IIR) with CN0=47 dB-Hz
New GPS NAV message received in channel 5: subframe 2 from satellite GPS PRN 21 (Block IIR) with CN0=New GPS NAV message received in channel 1: subframe 242 from satellite dB-Hz
GPS PRN 22 (Block IIR) with CN0=47 dB-Hz
First position fix at 2025-Nov-09 10:33:24.121088 UTC is Lat = XX [deg], Long = XX [deg], Height= XX [m]
Current receiver time: 1 min 5 s
Position at 2025-Nov-09 10:33:24.481088 UTC using 4 observations is Lat = XXXXXXXX [deg], Long = XXXXXXX[deg], Height = XXXXX [m]
Velocity: East: XXXX [m/s], North: XXXX [m/s], Up = XXXX [m/s]
Top comments (0)