Go to file
bert hubert 95f4502928 casual 10-fold speedup of navnexus 2020-01-12 23:17:36 +01:00
.github/workflows add libeigen to github tests 2019-11-10 21:21:04 +01:00
ext update ext/powerblog reference 2020-01-09 09:28:04 -05:00
html Add support for GLONASS ephemeris integration. 2020-01-12 21:32:07 +03:00
sp3 add test file 2019-10-20 21:50:11 +02:00
.gitignore commit the git rm of githash.h and add it to .gitignore 2019-12-29 10:47:31 +01:00
.gitmodules yo 2020-01-10 21:41:49 +01:00
Dockerfile Install git during docker build so update-git-hash-if-necessary works. 2019-12-29 19:48:04 +13:00
Dockerfile-pi Install git during docker build so update-git-hash-if-necessary works. 2019-12-29 19:48:04 +13:00
LICENSE Initial commit 2019-07-21 16:09:11 +02:00
Makefile redo our influxdb schema & logic, split out to separate file, slim down 2020-01-11 20:33:30 +01:00
README.md point to operator.md, influxdb.md 2020-01-12 21:40:28 +01:00
beidou.cc interim 2019-09-03 20:05:40 +02:00
beidou.hh add beidou specifics to sv.json output 2019-10-20 20:34:31 +02:00
bits.cc glonass special sign support 2019-08-26 00:17:41 +02:00
bits.hh glonass special sign support 2019-08-26 00:17:41 +02:00
coverage.cc Merge branch 'experimental' 2019-10-23 10:37:21 +02:00
ephemeris.cc oops ephAge was integer only - potentially messing with doppler measurements 2019-12-20 23:03:52 +01:00
ephemeris.hh improve precision, move away from ESA formula for nu 2019-12-28 13:46:33 +01:00
galileo.cc move to protobuf 2019-08-09 15:58:52 +02:00
galileo.hh comment 2019-12-20 23:04:20 +01:00
galmonmon.cc trkmeas work, plus many other things 2020-01-09 14:33:02 +01:00
githash.cc add githash.cc 2019-12-28 23:26:24 +01:00
glonass.cc ssb supplied fix 2020-01-12 22:48:11 +01:00
glonass.hh Add support for GLONASS ephemeris integration. 2020-01-12 21:32:07 +03:00
gps.cc gps yolo 2019-08-12 15:54:16 +02:00
gps.hh t0c is unsigned 2020-01-11 23:35:37 +01:00
influxdb.md document beidouurai 2020-01-12 21:41:12 +01:00
influxpush.cc redo our influxdb schema & logic, split out to separate file, slim down 2020-01-11 20:33:30 +01:00
influxpush.hh redo our influxdb schema & logic, split out to separate file, slim down 2020-01-11 20:33:30 +01:00
minicurl.cc add 'reporter' for weekly/daily/whatever Galileo statistics, plus additional URL for F9P manual. 2019-11-20 22:45:30 +01:00
minicurl.hh add 'reporter' for weekly/daily/whatever Galileo statistics, plus additional URL for F9P manual. 2019-11-20 22:45:30 +01:00
minivec.hh split out ephemeris ephAge & fix it, add delta-Hz to html, add gps-utc offset to json & show it in html, fix compilation 2019-08-18 10:56:22 +02:00
minread.cc yolo 2019-07-24 13:24:48 +02:00
navcat.cc roughly 10-fold speedup in navcat, plus fix ordering bug 2020-01-12 22:49:08 +01:00
navdisplay.cc interim 2019-09-03 20:05:40 +02:00
navdump.cc make navdump log some more GPS parameters 2020-01-12 21:41:33 +01:00
navmon.cc fix time display, seconds %02 2019-12-28 13:47:48 +01:00
navmon.hh new timeout code, should fix startup for entirely new receivers 2019-11-22 14:32:25 +01:00
navmon.proto add githash and receiver uptime to stream 2019-12-28 23:19:40 +01:00
navnexus.cc casual 10-fold speedup of navnexus 2020-01-12 23:17:36 +01:00
navparse.cc fix up some influxdb naming & add filter on idiotic values 2020-01-12 21:42:36 +01:00
navparse.hh only include this file once 2020-01-11 20:29:10 +01:00
navrecv.cc reuse filedescriptors, massively decreasing fragmentation 2020-01-09 11:53:31 +01:00
operator.md operator instructions 2020-01-08 16:46:18 +01:00
osen.cc move to WGS84 ellipsoid lat/lon calculations, adjust to sources that do not provide a fix, add ground speed, log location/speed in influxdb 2019-11-26 19:12:37 +01:00
reporter.cc trkmeas work, plus many other things 2020-01-09 14:33:02 +01:00
sp3.cc new sp3 2019-09-24 21:20:48 +02:00
sp3.hh new sp3 2019-09-24 21:20:48 +02:00
storage.cc casual 10-fold speedup of navnexus 2020-01-12 23:17:36 +01:00
storage.hh casual 10-fold speedup of navnexus 2020-01-12 23:17:36 +01:00
testrunner.cc add sp3 parser 2019-09-24 21:19:01 +02:00
tle.cc silence some debugging, progress on galcov, rename 'NO SIS' to 'NO SISA' 2019-10-15 18:04:52 +02:00
tle.hh tle: include ctime to make clang on FreeBSD 12 happy 2019-10-30 20:40:25 -04:00
tlecatch.cc tlecatch 2019-09-02 16:56:03 +02:00
trkmeas.cc trkmeas: get rid of 2 unused variable warnings 2020-01-09 09:26:09 -05:00
ubx.cc add primordial SBAS/EGNOS/WAAS/etc payload extraction 2019-11-04 07:52:01 +01:00
ubx.hh trkmeas work, plus many other things 2020-01-09 14:33:02 +01:00
ubxtool.cc trkmeas work, plus many other things 2020-01-09 14:33:02 +01:00
ubxtool.service keep run directory between sessions; auto-create dir if needed 2019-11-21 11:50:56 -09:00
ubxtool.sh refactor to auto-detect interface, cleaner log rotation 2019-11-21 11:51:18 -09:00
update-git-hash-if-necessary add githash and receiver uptime to stream 2019-12-28 23:19:40 +01:00
update-tles Update update-tles 2020-01-04 12:21:15 +02:00

README.md

galmon

galileo/GPS/GLONASS/BeiDou open source monitoring. GPL3 licensed. (C) AHU Holding BV - bert@hubertnet.nl - https://berthub.eu/

Live website: https://galmon.eu/

Theoretically multi-vendor, although currently only the U-blox 8 and 9 chipsets are supported. Navilock NL-8012U receiver works really well, as does the U-blox evaluation kit for the 8MT. In addition, many stations have reported success with this very cheap AliExpress sourced device. The best and most high-end receiver, which does all bands, all the time, is the Ublox F9P, several of us use the ArdusimpleRTK2B board.

To deliver data to the project, please read The Galmon GNSS Monitoring Project and consult the rules outlined in the operator guidelines.

Highlights

  • Processes raw frames/strings/words from GPS, GLONASS, BeiDou and Galileo
  • All-band support (E1, E5b, B1I, B2I, Glonass L1, Glonass L2, GPS L1C/A) so far, GPS L2C and Galileo E5a pending).
  • Calculate ephemeris positions
  • Comparison of ephemerides to independent SP3 data to determine SISE
    • Globally, locally, worst user location
  • Record discontinuities between subsequent ephemerides (in time and space)
  • Compare doppler shift as reported by receiver with that expected from ephemeris
  • Track atomic clock & report jumps
  • Coverage maps (number of satellites >5, >10, >20 elevation)
  • HDOP/VDOP/PDOP maps
  • Compare orbit to TLE, match up to best matching satellite
  • Tear out every bit that tells us how well an SV is doing
  • Full almanac processing to see what should be transmitting
  • Distributed receivers, combined into a single source of all messages
  • Ready to detect/report spoofing/jamming

Data is made available as JSON, as a user-friendly website and as a time-series database. This time-series database is easily mated to the industry standard Matplotlib/Pandas/Jupyter combination (details here.

There is also tooling to extract raw frames/strings/words from specific timeframes.

Goals:

  1. Support multiple wildly distributed receivers
  2. Combine these into a forensic archive of all Galileo/GPS NAV messages
  3. Make this archive available, offline and as a stream
  4. Consume this stream and turn it into an attractive live website (https://galmon.eu/). As part of this, perform higher-level calculations to determine ephemeris discontinuities, live gst/gps/galileo time offsets, atomic clock jumps etc.
  5. Populate an InfluxDB timeseries database with raw measurements and higher order calculations

Works on Linux (including Raspbian Buster on Pi Zero W), OSX and OpenBSD.

Build locally

To get started, make sure you have a C++17 compiler (like g++ 8 or higher), git, protobuf-compiler. Then run 'make ubxtool navdump' to build the receiver-only tools.

To build everything, including the webserver, try:

apt-get install protobuf-compiler libh2o-dev libcurl4-openssl-dev libssl-dev libprotobuf-dev \ 
libh2o-evloop-dev libwslay-dev libncurses5-dev libeigen3-dev
git clone https://github.com/ahupowerdns/galmon.git --recursive
cd galmon
make

If this doesn't succeed with an error about h2o, make sure you have this library installed. If you get an error about 'wslay', do the following, and run make again:

echo WSLAY=-lwslay > Makefile.local

Build in Docker

To build it in Docker:

git clone https://github.com/ahupowerdns/galmon.git --recursive
docker build -t galmon --build-arg MAKE_FLAGS=-j2 .

To run a container with a shell in there (this will also expose a port so you can view the UI too and assumes a ublox GPS device too - you may need to tweak as necessary):

docker run -it --rm --device=/dev/ttyACM0 -p 10000:10000 galmon

Running

Once compiled, run for example ./ubxtool --wait --port /dev/ttyACM0 --station 1 --stdout --galileo | ./navparse 127.0.0.1:10000 html null

Next up, browse to http://[::1]:10000 (or try http://localhost:10000/ and you should be in business. ubxtool changes (non-permanently) the configuration of your u-blox receiver so it emits the required frames for GPS and Galileo. If you have a u-blox timing receiver it will also enable the doppler frames.

By default the ublox receiver module will be configured to use the USB port, if you want to use a different interface port on the ublox module then add the --ubxport <id> option using one of the following numeric IDs:

0 : DDC (aka. I2C)
1 : UART[1]
2 : UART2
3 : USB (default)
4 : SPI

To see what is going on, try:

./ubxtool --wait --port /dev/ttyACM0 --station 1 --stdout --galileo | ./navdump

To distribute data to a remote navrecv, use:

./ubxtool --wait --port /dev/ttyACM0 --galileo --station 255 --dest 127.0.0.1

This will send protobuf to 127.0.0.1:29603. You can add as many destinations as you want, they will buffer and automatically reconnect. To also send data to stdout, add --stdout.

Tooling:

  • ubxtool: can configure a u-blox 8 chipset, parses its output & will convert it into a protbuf stream of GNSS NAV frames + metadata Adds 64-bit timestamps plus origin information to each message
  • xtool: if you have another chipset, build something that extracts NAV frames & metadata. Not done yet.
  • navrecv: receives GNSS NAV frames and stores them on disk, split out per sender.
  • navnexus: tails the files stored by navrecv, makes them available over TCP
  • navparse: consumes these ordered nav updates for a nice website and puts "ready to graph" data in influxdb - this is the first step that breaks "store everything in native format". Also does computations on ephemerides.
  • grafana dashboard: makes pretty graphs

Linux Systemd

This is very much a first stab. Do the following at root.

mkdir /run/ubxtool
mkdir /usr/local/ubxtool
cp ubxtool.sh /usr/local/ubxtool/
chmod +x /usr/local/ubxtool/ubxtool.sh
cp ubxtool /usr/local/ubxtool/
cp ubxtool.service /etc/systemd/system/ubxtool.service
touch /usr/local/ubxtool/destination
touch /usr/local/ubxtool/station

Then edit /usr/local/ubxtool/destination with an IP address collected from Bert. Then edit /usr/local/ubxtool/station with a station number collected from Bert.

The start up the service.

sudo systemctl enable ubxtool
sudo systemctl start ubxtool

This will be cleaned up and better packaged sometime soon.

Distributed setup

Run navrecv :: ./storage to receive frames on port 29603 of ::, aka all your IPv6 addresses (and IPv4 too on Linux). This allows anyone to send you frames, so be aware.

Next up, run navnexus ./storage ::, which will serve your recorded data from port 29601. It will merge messages coming in from all sources and serve them in time order.

Finally, you can do nc 127.0.0.1 29601 | ./navdump, which will give you all messages over the past 24 hours, and stream you more. This also works for navparse for the pretty website and influx storage, nc 127.0.0.1 29601 | ./navparse 127.0.0.0:10000 html galileo, if you have an influxdb running on localhost with a galileo database in there.

Internals

The transport format consists of repeats of:

  1. Four byte magic value
  2. Two-byte frame length
  3. A protobuf frame

The magic value is there to help us resync from partially written data.

The whole goal is that we can continue to rebuild the database by rerunning 'navstore' and 'navinflux'.

Documents

Data sources

The software can interpret SP3 files, good sources:

  • ESA/ESOC: http://navigation-office.esa.int/products/gnss-products/ - pick the relevant GPS week number, and then a series (.sp3 extension):
    • ESU = ultra rapid, 2-8h delay, only GPS and GLONASS
    • ESR = rapid, 2-26h delay, only GPS and GLONASS
    • ESM = finals, 6-13d delay, GPS, GLONASS, Galileo, BeiDou, QZSS
    • File format is esXWWWWD.sp3 - where X is U, R or M, WWWW is the (non-wrapping) GPS week number and D is day of week, Sunday is 0.
    • Further description: http://navigation-office.esa.int/GNSS_based_products.html
  • GFZ Potsdam: ftp://ftp.gfz-potsdam.de/GNSS/products/mgnss
    • The GBM series covers GPS, GLONASS, Galileo, BeiDou, QZSS and appears to have less of a delay than the ESA ESM series.
    • GBU = ultra rapid, still a few days delay, but much more recent.

Uncompress and concatenate all downloaded files into 'all.sp3' and run 'navdump' on collected protobuf, and it will output 'sp3.csv' with fit data.

Big TODO

  • Dual goals: completeness, liveness, not the same For forensics, great if the packet is there For display, not that bad if we missed a message

  • In general, consider refeed strategy Raw serial Protobuf Influxdb ".csv files"

  • Delivery needs to be bit more stateful (queue)

  • Semantics definition for output of Navnexus "we'll never surprise you with old data"

Global coverage (via volunteers)

In alphabetical order:

  • Austria (Vienna area)
  • Brazil
  • Holland (Nootdorp, Hilversum, etc)
  • India (New Delhi area)
  • Israel (Jerusalem)
  • New Zealand (Auckland area)
  • Rusia (Moscow area)
  • Singapore
  • South Africa (Cape Town area)
  • Spain
  • Tonga
  • USA
    • Alaska (Anchorage)
    • California (Santa Cruz, Los Angeles area, etc)
    • Massachusetts (Boston area)
  • Uruguay

Additional sites are welcome (and encouraged) as the more data receiving sites that exist, then more accurate data and absolute coverage of each constellation can be had.

The galmon project is very grateful to all its volunteering receiving stations.

ubxtool

  • Will also spool raw serial data to disk (in a filename that includes the start date)
  • Can also read from disk
  • Careful to add the right timestamps