Skip to content
/ gnss-rcv Public

Sofware defined GNSS receiver in Rust: GPS L1 C/A

License

Notifications You must be signed in to change notification settings

mx4/gnss-rcv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux MacOS

gnss-rcv: GNSS receiver for GPS L1 signal in Rust

This app takes as input:

  • an SDR IQ recording
  • or an rtl-sdr device

It performs signal acquisition, tracking and ephemeris decoding. Finally it attempts to get a position fix.

Note that this is still a WIP.

Diagnostic output

As the gnss receiver processes the IQ data it periodically updates a web page (index.html + pics) that helps explain the inner state of the decoder. Cf plots/index.html.

diagnostic output

Dependencies

You need to install librtlsdr:

$ sudo apt install librtlsdr-dev

or

$ brew install librtlsdr

Run with IQ recording of L1 signal sampled at 2046MHz

$ RUST_LOG=info cargo run --release -- -f path/to/recording.bin

Note that the app supports multiple IQ file formats: i8, 2xf16, 2xf32, etc. This can be specified via the cmd-line option -t.

Download an existing IQ recording with GPS L1 signal

The one I used for most of the development: https://github.com/codyd51/gypsum/releases/download/1.0/nov_3_time_18_48_st_ives.zip .. unzip and move the file under resources/. Use "-t 2xf32".

A few online SDR recordings at 1575,42 MHz are available online:

The info required to download/generate samples data: README.md

Simulate a GPS L1 SDR recording

Cf GPS-SDR-SIM

 ./gps-sdr-sim -b 16 -d 60 -t 2022/01/01,01:02:03 -l 35.681298,139.766247,10.0 -e brdc0010.22n -s 2046000

This generates an IQ recording w/ 2 int16 per I and Q sample. You can use this using the cmd-line option "-t 2xf16".

RTLSDR

Use rtlsdr dongle w/ L1 antenna as input

If you have an rtlsdr dongle with a GPS L1 antenna you can try to run the receiver directly off of the IQ sampled by the device:

$ RUST_LOG=warn cargo run --release -- -d

WIP: I haven't been able to identify satellites by using rtlsdr directly with my h/w setup. Not sure it's due to a bug or my setup.

Use rtl_tcp

If you have a device w/ an rtlsdr dongle, you can use rtl_tcp on that host to stream the IQ data to a gnss-rcv instance running on a different host. Run rtl_tcp on host w/ rtlsdr device:

$ rtl_tcp -a

and connect to it w/ gnss-rcv:

$ RUST_LOG=warn cargo run --release -- -h <hostname>

gnss-rcv will automatically configure the sampling rate, center frequency, etc. WIP: same caveat

Record from rtl-sdr to file

You can use your rtlsdr device to capture a set of IQ samples that can then be fed to gnss-rcv.

  • you need to activate bias-t and power the gps/lna antenna:
$ rtl_biast -d 0 -b 1
  • command to sample L1 at 2046KHz for 10 sec:
$ rtl_sdr -f 1575420000 -s 2046000 -n 20460000 output.bin

WIP: same caveat

Resources:

General info about GNSS

TODO

  • finish position fix computation
  • test + fix rtlsdr support
  • support: SBAS, Galileo, QZSS, Beidu.
  • handle different sampling frequencies
  • add a minimal UI: ratatui/egui