Best practices when sending GPS location data [HowTo]

Using https://github.com/thesolarnomad/lora-serialization I was able to get a Position, Altitude and HDOP down to 12 bytes. In my case, this was for TTN Mapper.

  • Position (8 bytes) - Using LoraEncoder::writeLatLng
  • Altitude (2 bytes) - Using LoraEncoder::writeUint16 (0-65535m)
  • HDOP (2 bytes) - Using LoraEncoder::writeHumidity (0.00-99.99)

The decode function at the TTN end was just decoder.js with the following added to the end (before the closing brace of decoder.js):

var ll = latLng(bytes.slice(0, 8));
decoded.latitude = ll[0];
decoded.longitude = ll[1];
decoded.altitude = uint16(bytes.slice(8,10));
decoded.hdop = humidity(bytes.slice(10,12));
  return decoded;
1 Like