2019-07-21 08:09:11 -06:00
|
|
|
# galmon
|
2019-09-05 03:12:15 -06:00
|
|
|
galileo/GPS/GLONASS/BeiDou open source monitoring. GPL3 licensed.
|
|
|
|
(C) AHU Holding BV - bert@hubertnet.nl - https://ds9a.nl/
|
|
|
|
|
|
|
|
Live website: https://galmon.eu/
|
2019-08-15 14:08:59 -06:00
|
|
|
|
|
|
|
Theoretically multi-vendor, although currently only the U-blox 8 chipset is
|
2019-09-05 03:12:15 -06:00
|
|
|
supported. Navilock NL-8012U receiver works really well, as does the U-blox evaluation kit for the 8MT.
|
|
|
|
|
|
|
|
Highlights:
|
|
|
|
* Processes raw frames/strings/words from GPS, GLONASS, BeiDou and Galileo
|
|
|
|
* Calculate ephemeris positions
|
|
|
|
* Record discontinuities between subsequent ephemerides
|
|
|
|
* Compare doppler shift as reported by receiver with that expected from ephemeris
|
|
|
|
* Track atomic clock & report jumps
|
|
|
|
* 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
|
2019-08-15 14:08:59 -06:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2019-09-05 03:12:15 -06:00
|
|
|
Works on Linux (including Raspbian on Pi Zero W), OSX and OpenBSD.
|
|
|
|
|
2019-09-27 02:31:38 -06:00
|
|
|
|
|
|
|
|
|
|
|
Build locally
|
|
|
|
-------------
|
|
|
|
|
2019-09-16 05:55:47 -06:00
|
|
|
To get started, make sure you have a C++17 compiler, git, protobuf-compiler.
|
|
|
|
Then run 'make ubxtool navdump' to build the receiver-only tools.
|
|
|
|
|
2019-10-23 02:58:48 -06:00
|
|
|
To build everything, including the webserver, try:
|
2019-08-15 14:08:59 -06:00
|
|
|
|
|
|
|
```
|
2019-10-23 02:58:48 -06:00
|
|
|
apt-get install protobuf-compiler libh2o-dev libcurl4-openssl-dev libssl-dev libprotobuf-dev \
|
|
|
|
libh2o-evloop-dev libwslay-dev libncurses5-dev libeigen3-dev
|
2019-08-15 14:08:59 -06:00
|
|
|
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
|
2019-09-05 03:12:15 -06:00
|
|
|
library installed. If you get an error about 'wslay', do the following, and run make again:
|
|
|
|
|
|
|
|
```
|
|
|
|
echo WSLAY=-lwslay > Makefile.local
|
|
|
|
```
|
2019-08-15 14:08:59 -06:00
|
|
|
|
2019-09-28 13:29:34 -06:00
|
|
|
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:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker run -it --rm galmon
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2019-09-27 02:31:38 -06:00
|
|
|
Running
|
|
|
|
-------
|
|
|
|
|
2019-09-25 03:29:14 -06:00
|
|
|
Once compiled, run for example `./ubxtool --wait --port /dev/ttyACM0
|
2019-10-09 23:34:11 -06:00
|
|
|
--station 1 --stdout | ./navparse 10000 html null`
|
2019-08-15 14:08:59 -06:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
To see what is going on, try:
|
|
|
|
|
|
|
|
```
|
2019-09-25 03:29:14 -06:00
|
|
|
./ubxtool --wait --port /dev/ttyACM0 --station 1 --stdout | ./navdump
|
2019-08-15 14:08:59 -06:00
|
|
|
```
|
|
|
|
|
2019-09-25 03:29:14 -06:00
|
|
|
To distribute data to a remote `navrecv`, use:
|
|
|
|
|
|
|
|
```
|
|
|
|
./ubxtool --wait --port /dev/ttyACM0 --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`.
|
2019-08-15 14:08:59 -06:00
|
|
|
|
2019-08-06 11:13:25 -06:00
|
|
|
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
|
2019-08-15 14:08:59 -06:00
|
|
|
frames & metadata. Not done yet.
|
2019-08-06 11:13:25 -06:00
|
|
|
* navrecv: receives GNSS NAV frames and stores them on disk, split out per
|
2019-08-11 02:43:29 -06:00
|
|
|
sender.
|
2019-08-15 14:08:59 -06:00
|
|
|
* navnexus: tails the files stored by navrecv, makes them available over
|
|
|
|
TCP
|
2019-09-05 03:12:15 -06:00
|
|
|
* navparse: consumes these ordered nav updates for a nice website
|
2019-08-15 14:08:59 -06:00
|
|
|
and puts "ready to graph" data in influxdb - this is the first
|
2019-08-06 11:13:25 -06:00
|
|
|
step that breaks "store everything in native format". Also does
|
|
|
|
computations on ephemerides.
|
|
|
|
* grafana dashboard: makes pretty graphs
|
|
|
|
|
2019-10-09 19:40:54 -06:00
|
|
|
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/
|
2019-10-17 01:14:34 -06:00
|
|
|
chmod +x /usr/local/ubxtool/ubxtool.sh
|
2019-10-09 19:40:54 -06:00
|
|
|
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.
|
|
|
|
|
2019-09-05 03:12:15 -06:00
|
|
|
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 `nv 127.0.0.1 29601 | ./navdump`, which will give you all messages over the past 24 hours, and stream you more.
|
2019-09-06 15:07:59 -06:00
|
|
|
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`,
|
2019-09-05 03:12:15 -06:00
|
|
|
if you have an influxdb running on localhost with a galileo database in there.
|
|
|
|
|
|
|
|
Internals
|
|
|
|
---------
|
2019-08-06 11:13:25 -06:00
|
|
|
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'.
|
|
|
|
|
2019-09-06 15:07:59 -06:00
|
|
|
Documents
|
|
|
|
---------
|
|
|
|
|
|
|
|
* [BeiDou](http://m.beidou.gov.cn/xt/gfxz/201902/P020190227593621142475.pdf)
|
2019-09-16 05:55:47 -06:00
|
|
|
* [Galileo](https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo-OS-SIS-ICD.pdf)
|
2019-09-06 15:07:59 -06:00
|
|
|
* [GLONASS](https://www.unavco.org/help/glossary/docs/ICD_GLONASS_4.0_(1998)_en.pdf),
|
|
|
|
old 1998 version, but unlike newer versions, this one is not full of
|
|
|
|
mistakes. [New version](http://gauss.gge.unb.ca/GLONASS.ICD.pdf) is more complete but is worryingly messy.
|
|
|
|
* [GLONASS CDMA](http://russianspacesystems.ru/wp-content/uploads/2016/08/ICD-GLONASS-CDMA-General.-Edition-1.0-2016.pdf)
|
|
|
|
not actually relevant for the CDMA aspects, but has appendices on more
|
|
|
|
precise orbit determinations.
|
|
|
|
* [GPS](https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf)
|
2019-09-25 16:25:10 -06:00
|
|
|
* [U-blox 8 interface specification](https://www.u-blox.com/sites/default/files/products/documents/u-blox8-M8_ReceiverDescrProtSpec_%28UBX-13003221%29_Public.pdf)
|
2019-09-16 05:55:47 -06:00
|
|
|
* [U-blox 9 interface specification](https://www.u-blox.com/sites/default/files/u-blox_ZED-F9P_InterfaceDescription_%28UBX-18010854%29.pdf)
|
|
|
|
|
2019-09-06 15:07:59 -06:00
|
|
|
|
2019-08-10 08:03:45 -06:00
|
|
|
Big TODO
|
|
|
|
--------
|
|
|
|
|
2019-08-11 02:43:29 -06:00
|
|
|
* 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)
|
|
|
|
|
2019-08-10 08:03:45 -06:00
|
|
|
* Semantics definition for output of Navnexus
|
2019-08-11 02:43:29 -06:00
|
|
|
"we'll never surprise you with old data"
|
|
|
|
|
2019-08-09 07:58:52 -06:00
|
|
|
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
|
|
|
|
|