Merge branch 'master' of github.com:ahupowerdns/galmon

pull/58/head
bert hubert 2019-12-27 20:38:11 +01:00
commit ad79d87b21
4 changed files with 69 additions and 24 deletions

18
Dockerfile-pi 100644
View File

@ -0,0 +1,18 @@
#FROM ubuntu:disco
FROM arm32v7/debian:unstable
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
# Update packages and install dependencies
RUN apt-get update && apt-get -y upgrade && apt-get -y clean
RUN apt-get install -y protobuf-compiler libh2o-dev libcurl4-openssl-dev \
libssl-dev libprotobuf-dev libh2o-evloop-dev libwslay-dev libeigen3-dev \
make clang-9 build-essential curl autoconf automake libfmt-dev libncurses5-dev \
&& apt-get -y clean
# Build
ADD . /galmon/
WORKDIR /galmon/
RUN make
ENV PATH=/galmon:${PATH}

View File

@ -88,10 +88,10 @@ 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:
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 galmon
docker run -it --rm --device=/dev/ttyACM0 -p 10000:10000 galmon
```
@ -99,7 +99,7 @@ Running
-------
Once compiled, run for example `./ubxtool --wait --port /dev/ttyACM0
--station 1 --stdout | ./navparse 127.0.0.1:10000 html null`
--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
@ -120,13 +120,13 @@ the `--ubxport <id>` option using one of the following numeric IDs:
To see what is going on, try:
```
./ubxtool --wait --port /dev/ttyACM0 --station 1 --stdout | ./navdump
./ubxtool --wait --port /dev/ttyACM0 --station 1 --stdout --galileo | ./navdump
```
To distribute data to a remote `navrecv`, use:
```
./ubxtool --wait --port /dev/ttyACM0 --station 255 --dest 127.0.0.1
./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
@ -182,7 +182,7 @@ 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.
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.
@ -267,13 +267,14 @@ In alphabetical order:
* 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 it's volunteering receiving stations.
The galmon project is very grateful to all its volunteering receiving stations.
ubxtool
-------

View File

@ -7,10 +7,11 @@ StartLimitIntervalSec=0
Type=simple
Restart=always
RestartSec=1
# uncomment User and Group to not run as root
#User=ubxtool
#Group=ubxtool
#DynamicUser=yes
#RuntimeDirectory=ubxtool
RuntimeDirectory=ubxtool
RuntimeDirectoryPreserve=yes
WorkingDirectory=/run/ubxtool
ExecStart=/usr/local/ubxtool/ubxtool.sh

View File

@ -1,21 +1,46 @@
#!/bin/bash
runDir="/run/ubxtool"
DEVICE="/dev/ttyACM0"
DESTINATION="`cat /usr/local/ubxtool/destination`"
CONSTELLATIONS="--galileo --gps --glonass"
# CONSTELLATIONS="--galileo --gps --beidou"
# CONSTELLATIONS="--galileo --gps --glonass --beidou" # only on the F9P
DIR="/run/ubxtool"
# DEVICE="/dev/ttyACM0" # comment out or leave blank to auto-search
STATION="`cat /usr/local/ubxtool/station`"
CONSTELLATIONS="--galileo --gps --beidou"
#########################################################################
rotate() {
logt=$1
cd ${runDir}
if [ -r ${logt}.log ]; # only rotate if there's a current logfile
then
if [ -r ${logt}.log.4 ]; then mv ${logt}.log.4 ${logt}.log.5 ; fi;
if [ -r ${logt}.log.3 ]; then mv ${logt}.log.3 ${logt}.log.4 ; fi;
if [ -r ${logt}.log.2 ]; then mv ${logt}.log.2 ${logt}.log.3 ; fi;
if [ -r ${logt}.log.1 ]; then mv ${logt}.log.1 ${logt}.log.2 ; fi;
if [ -r ${logt}.log ]; then mv ${logt}.log ${logt}.log.1 ; fi;
fi
}
(
mkdir ${DIR}
cd ${DIR}
mv stdout.log.4 stdout.log.5 ; mv stderr.log.4 stderr.log.5 ; mv logfile.4 logfile.5
mv stdout.log.3 stdout.log.4 ; mv stderr.log.3 stderr.log.4 ; mv logfile.3 logfile.4
mv stdout.log.2 stdout.log.3 ; mv stderr.log.2 stderr.log.3 ; mv logfile.2 logfile.3
mv stdout.log.1 stdout.log.2 ; mv stderr.log.1 stderr.log.2 ; mv logfile.1 logfile.2
mv stdout.log stdout.log.1 ; mv stderr.log stderr.log.1 ; mv logfile logfile.1
) 2> /dev/null
if [ -z "${DEVICE}" ];
then
# programmatically find the interface
SYSD=$(grep -il u-blox /sys/bus/usb/devices/*/manufacturer)
SYSD=${SYSD//manufacturer/}
DEVD=$(find ${SYSD} -type d -iname 'ttyACM*')
DEVICE="/dev/${DEVD##*/}"
fi
exec /usr/local/ubxtool/ubxtool --wait ${CONSTELLATIONS} --port ${DEVICE} --station ${STATION} --destination ${DESTINATION} >> stdout.log 2>> stderr.log < /dev/null
DESTINATION=$(cat /usr/local/ubxtool/destination)
STATION=$(cat /usr/local/ubxtool/station)
# systemctl script will do this, but if you don't use systemctl, we need to take care of it
[[ -d ${runDir} ]] || mkdir -p ${runDir}
[[ -e ${runDir}/gps.sock ]] || mkfifo ${runDir}/gps.sock
for logFile in stdout stderr logfile
do
rotate ${logFile}
done
exec /usr/local/ubxtool/ubxtool --wait ${CONSTELLATIONS} --port ${DEVICE} --station ${STATION} --destination ${DESTINATION} >> ${runDir}/stdout.log 2>> ${runDir}/stderr.log < /dev/null