Script to track your Teltonika (RutOS / OpenWrt) device using NMEA and log the data to your private Nextcloud (via the PhoneTrack app). This script survives firmware updates and requires no manual terminal interaction.
- rc.local is a small bootstrapper: it seeds
/root/gps.confwith your values on first boot, downloads gps_nextcloud.sh from this repo on every boot (keeping the local copy if the download fails) and starts the tracker. - Position changes are sent to the PhoneTrack
gpsloggerendpoint. While no uplink is available, updates are buffered in/tmp/offline.logand replayed once the connection is back.
- Copy the content of rc.local into System → Custom Scripts
in the WebUI (
/etc/rc.local). - Fill in the configuration block at the top:
NEXTCLOUD_URL- your Nextcloud base URLPHONETRACK_SESSION- the PhoneTrack session tokenGPS_NAME- the device name shown in PhoneTrackGPS_DELAY- update interval in seconds
- Reboot.
To change the configuration later, edit /root/gps.conf on the device -
the block in rc.local is only used to seed it once.
- RUTX-DYNDNS-HETZNER - DynDNS (A + AAAA) via the Hetzner Cloud DNS API
- RUTX-SSL - Let's Encrypt certificates via acme.sh and the Hetzner Cloud DNS API
- Combined rc.local example (DynDNS + SSL + GPS)
| Device | Firmware Version |
|---|---|
| RUTX11 | RUTX_R_00.07.24.1 |
| RUTX11 | RUTX_R_00.07.16.3 |
| RUTX11 | RUTX_R_00.07.12 |
| RUTX50 | RUTX_R_00.07.06.3 |
2026-07-29
- Script is now downloaded from this repo, configuration moved to
/root/gps.conf(seeded once byrc.local).
2025-08-02
- Detect LTE via
qmimux0(required by recent modem firmware).
2025-02-11
- Added iteration over multiple interfaces (multi-WAN setup support).
Based on G4Cab/TeltonikaNMEAlogger.