Owntracks Integration

Hi there,

I’m working on getting my Meshtastic nodes used on the farm I work on in New Zealand as trackers to put on our quad bikes and tractor so I can see where they are. Would be quite handy if we can’t raise someone on the radio or in an emergency situation. It’s hill country with very patchy cell coverage, but with 1 or 2 relay nodes in strategic locations I think I can quite easily blanket the farm with Meshtastic coverage.

To that end I’m currently working on getting the Meshtastic location data ingested into an Owntracks instance I just installed on my server in the garage. In order to get decrypted data onto my MQTT Broker I modified the code on my gateway node to send the MQTT payload before it is encrypted, bit of a bodge but it was easier than trying to learn about aes-ctr at the same time as figuring out python. That modification is in src/Router.cpp, I moved the MQTT fragment in Router::send to just before the perhapsEncode() call.

See below for my hacky python script that translates the resulting MQTT messages to something owntracks-recorder can understand. It’s a work in progress but there might be other people interested in it.

Also, massive thanks to @geeksville and everyone else who’s made this such an awesome project. I’m really loving it so far!

https://github.com/joshpirihi/meshtastic-mqtt-owntracks

3 Likes

Hey another Kiwi!
Looking forward to seeing how you get on.

Hey there Dave. Where abouts are you? I’m 20 minutes out of Taumarunui.

I’ve gotten it working with owntracks-frontend using the farm map that I drew up in QGIS, it’s pretty cool actually. Now just waiting for a solar panel for my relay node to arrive then to work on getting the T-Beams into a box and wired up to be mounted in the bikes.

2 Likes

Nice work looks like it could provide some very useful utility for many farms out of cell signal across nz particularly as Vodafone is shutting down sure signal.

I’m in Hamilton, have been messing around with some 1w LoRa modules for some potentially better nlos connections.

Hi, I’ve just discovered Meshtastic and I’m doing a proof of concept for a comms network for voluntary SAR and Civil Defence. As money is tight, OS is the way to go. I’m interested in operations with small units out of mobile coverage but being able to send to GSM repeater or relay for integration and RX/TX with Base. I need SMS, PNT photo TX functionality and your project looks very similar. Making up essential hardware list and drawing network topography today. What a great project. Regards, from Spain

Sounds like a cool project! You might struggle to send pictures out via the Meshtastic devices, as the data rates are pretty low (the units are bps, not kbps) text messaging and location tracking are doable though

Thanks for that, will keep you posted.

Regards,

Kieran

Looks cool! wouldnt an integration with Traccar be more universal?

Yea Traccar works way better. I’ve got a solar powered repeater node duct taped to a fence at the top of a hill on the farm, and have a tbeam in a nice sealed box stuffed under a panel on my quad bike, it’s working pretty well. I modified the firmware to send position updates more slowly when external power is disconnected, and to shutdown completely after 30 minutes - the whole deep sleep thing never worked that well for me. This way, when the bike switched on and the tbeam gets 5v on the USB, it just powers straight up. I had a lot of trouble getting the node to wake from deep sleep nicely.

This way the tbeam battery never runs out but the I’m able to bluetooth to the node for half an hour after I turn the bike off. Still tweaking for now, and need to get a few more tbeams and cases for the other bikes. Oh boy meshtastic makes this easy!

Cool! have you been able to make a traccar integration?

Yep, the code is on my GitHub. I haven’t worked out the encryption thing yet so for now I had to modify the device firmware to publish decrypted payloads to MQTT, then this python script subscribes to that and does the translation to a traccar request.