TTN version: | TTNv3 / TTS SANDBOX |
Last revision: | December 14, 2024 |
The Cayenne Low Power Payload (LPP) provides a convenient and easy way to send data over LPWAN networks such as LoRaWAN. The Cayenne LPP is compliant with the payload size restriction, which can be lowered down to 11 bytes, and allows the device to send multiple sensor data at one time. Cayenne LPP has several specific functions for some types of data, such as humidity, temperature, pressure, GPS and more.
More information can be found in the Cayenne LPP documentation.
Download and example usage
- Download as ZIP this CayenneLPP.
- There is an example.py in the CayenneLPP folder that you can use.
Example usage in your script
- Import downloaded cayenneLPP.py to your script:
import src.cayenneLPP as cayenneLPP
- Create lpp array:
lpp = []
- Append your data to the array (for example add temperature 25.5 °C to channel 1):
lpp.append([1, "addTemperature", 25.5])
- Call the cayenneLPP.encodeCayenneLPP(lpp) function, where lpp is array with your data. The function returns encoded data:
payload = cayenneLPP.encodeCayenneLPP(lpp)
- The whole code will look like this:
import src.cayenneLPP as cayenneLPP lpp = [] lpp.append([1, "addTemperature", 25.5]) payload = cayenneLPP.encodeCayenneLPP(lpp) print(payload)
- The printed output (payload) will look like this:
016700ff
Data types
All data types can be found in this table.