Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jrcichra/sim7600g-gps-collector
A GPS collection package to monitor Pis in the wild
https://github.com/jrcichra/sim7600g-gps-collector
collect-metrics golang shell-script sim7600
Last synced: 2 months ago
JSON representation
A GPS collection package to monitor Pis in the wild
- Host: GitHub
- URL: https://github.com/jrcichra/sim7600g-gps-collector
- Owner: jrcichra
- License: mit
- Created: 2020-07-16T03:18:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-07T21:28:15.000Z (about 1 year ago)
- Last Synced: 2024-06-21T18:05:08.240Z (7 months ago)
- Topics: collect-metrics, golang, shell-script, sim7600
- Language: Go
- Homepage:
- Size: 72.3 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sim7600g-gps-collector
- A GPS collection package to monitor Pis in the wild
- Tested on Raspbian using a Raspberry Pi 4B and Raspberry Pi Zero W with this hat: https://www.waveshare.com/wiki/SIM7600G-H_4G_HAT
- Sometimes you lose /dev/ttyUSB1 which is needed for GPS. This program will restart if it detects that /dev/ttyUSB1 is missing.
V3 runs two perl threads - one that monitors the data connection with a ping to Google, and the other checks for `TPV` data in calls to `gpspipe -w`. Each issue will be addressed separately by the responsible thread# Setup
## Server-side
- Create a new database in mysql for this project: i.e `create database gps`
- See `sim7600g.sql`. Create a table with these columns
- Create a database user for the next step: `create user ingest@'%' identified by a_password`
- Grant insert privs on the gps database.table you made earlier `grant insert on gps.gps to ingest@'%'`
- See https://github.com/jrcichra/ingestd. Spin up this docker container on your server, specifying your mysql database as described. This tool ingests data from HTTP POSTS into a database
- `ingestd` should start up and be listening for data## Client-side
- Modify constants at the top of `gps_collector/gps_collector.go` to point to the appropriate URL/database/table
- I've included some simple `make` targets to help installation
- (You'll need a recent version of the Go compiler)
- `sudo make install` compiles the Go code, places binaries/scripts in `/usr/local/bin`, and enables the systemd targets
- `sudo make uninstall` removes what was added to `/usr/local/bin` and instantly disables the systemd targets.
- Modify `/etc/default/gpsd` and set `DEVICES="/dev/ttyUSB1"`
- `sudo systemctl daemon-reload`
- `sudo systemctl restart gpsd`