No description
|
All checks were successful
Build Main Branch / Build Docker Image (push) Successful in 1m27s
MQTT payload is ApplicationUp directly, not wrapped in "data" object like webhook format. Remove the extra nesting level. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| docs/plans | ||
| .gitignore | ||
| .ko.yaml | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| README.md | ||
ttntrackit
A simple Go service that connects to The Things Network via MQTT, receives GPS data from wisnode trackit devices, and forwards locations to Reitti.
Configuration
Environment variables:
| Variable | Description | Example |
|---|---|---|
TTN_MQTT_SERVER |
TTN MQTT broker address | eu1.cloud.thethings.network:8883 |
TTN_APP_ID |
TTN application ID | my-trackit-app |
TTN_API_KEY |
TTN API key for MQTT access | NNSXS.xxxxx |
REITTI_URL |
Reitti instance URL | https://reitti.example.com |
DEVICE_TOKENS |
Device to Reitti token mapping | white1:token-aaa,black1:token-bbb |
LOG_LEVEL |
Log level (debug, info, warn, error) | info (default) |
Build
Requires ko:
# Build locally
ko build ./ --local
# Build and push to registry
KO_DOCKER_REPO=git.tbrnt.ch/tobru/ttntrackit ko build ./ --bare --tags latest
Run
docker run -e TTN_MQTT_SERVER=eu1.cloud.thethings.network:8883 \
-e TTN_APP_ID=my-app \
-e TTN_API_KEY=NNSXS.xxxxx \
-e REITTI_URL=https://reitti.example.com \
-e DEVICE_TOKENS=white1:token-aaa,black1:token-bbb \
git.tbrnt.ch/tobru/ttntrackit:latest
How it works
- Connects to TTN MQTT broker
- Subscribes to uplink messages for configured application
- Parses incoming GPS data from trackit devices
- Filters out messages without GPS fix (
fix != 1) - Forwards locations to Reitti's
/api/v1/ingest/owntracksendpoint - Logs all activity to stdout in JSON format