Preventing GPS Tracker from sending position data prior to GPS fix

I’m using the Lilygo T-Beam GPS-Tracker (T-Beam Meshtastic – LILYGO®).
For the software I make use of the MCCI LoRaWAN LMIC library (V4.1.1).
My software is based on the ttn-otaa example provided with the library.

Basically everything works:

  • I get position data
  • the board is connected to TTN
  • the board transmits position data via LoRaWAN

Now I would achieve the following and didn’t find a solution up to now:
I want the board to join TTN, but then send no position data before a gps fix is made and correct position data is available.

If I don’t call the do_send() function (that contains a call to the LMIC_setTxData2() function) no uplink message with position data is sent, but the board does also not join the network.
If I call the do_send() function at least one (wrong) position message is sent after joining prior to the gps fix. I can suppress subsequent uplink message but I can’t get rid of this one 1st message.

Does someone know a way to join but send uplink message only after gps fix (or more general: controlled by the application software)?

This will require some modifications to the internals of LMIC or for you to pick through the various function calls.

Alternatively you could just not join until you get a valid fix.

OK, at least good to know, that there is no easy solution that I have overlooked.
I think it depends on the application, but I also thought about joying only when GPS is ready. In my experience it takes only a few seconds to join.
And since the application for me is currently nothing more than to feed TTN Mapper that should be completely fine.
Thank you very much!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.