Best Practices for Optimizing Airtime

ALWAYS, ALWAYS, ALWAYS: Use binary encoding to send your data. Below are several examples of how you might send data. The same message could take up to 40 bytes, or just two.

  • Using a simple JSON string takes 40 bytes:

{ “Count”: 1234, "Temperature": 20.635 }

  • Removing the counter (which is already included in the header) and the spaces, as well as compressing names, takes only 11 bytes:

{“t”:20.63}

  • Using a float instead of a string takes five bytes:

20.63 

  • Using a signed 16-bit integer takes just two bytes:

0x080F

  • Finally, using an index from a base value takes just one byte:

  0x17

The interval between messages should be in the range of several minutes, so be smart with your data. You could, for example, transmit a min|avg|max every five minutes, or you could transmit only when a sensor value changes more than a certain threshold amount. Similarly, you could have transmissions be triggered by motion or other events.

The data rate should be as fast as possible, to minimize your airtime. Using SF7 and BW125 (SF7BW125) is usually a good place to start. Using this data rate setting consumes the least amount of power and airtime. If you need more range, you can slowly increase the data rate until your messages can reach the nearest gateway. You can also enable the Adaptive Data Rate (ADR) functionality. When using ADR, the network can automatically optimize your data rate.

Last modified: Monday, August 29, 2022, 11:52 PM