Cayenne Low Power Payload
#
Cayenne Low Power Payload#
OverviewmyDevices created the Cayenne Low Power Payload (LPP) which 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.
Additionally, the Cayenne LPP allows the device to send different sensor data in different frames. In order to do that, each sensor data must be prefixed with two bytes:
- Data Channel: Uniquely identifies each sensor in the device across frames, eg. “indoor sensor”
- Data Type: Identifies the data type in the frame, eg. “temperature”.
#
Libraries#
Payload structure1 Byte | 1 Byte | N Bytes | 1 Byte | 1 Byte | M Bytes | ... |
---|---|---|---|---|---|---|
Data1 Ch. | Data1 Type | Data1 | Data2 Ch. | Data2 Type | Data 2 | ... |
#
Data TypesData Types conform to the IPSO Alliance Smart Objects Guidelines, which identifies each data type with an “Object ID”. However, as shown below, a conversion is made to fit the Object ID into a single byte.
Each data type can use 1 or more bytes to send the data according to the following table.
Type | IPSO | LPP | Hex | Data Size | Data Resolution per bit |
---|---|---|---|---|---|
Digital Input | 3200 | 0 | 0 | 1 | 1 |
Digital Output | 3201 | 1 | 1 | 1 | 1 |
Analog Input | 3202 | 2 | 2 | 2 | 0.01 |
Analog Output | 3203 | 3 | 3 | 2 | 0.01 |
Illuminance Sensor | 3301 | 101 | 65 | 2 | 1 |
Presence Sensor | 3302 | 102 | 66 | 1 | 1 |
Temperature Sensor | 3303 | 103 | 67 | 2 | 0.1°C Signed MSB |
Humidity Sensor | 3304 | 104 | 68 | 1 | 0.5 % Unsigned |
Accelerometer | 3313 | 113 | 71 | 6 | 0.001 G Signed MSB per axis |
Barometer | 3315 | 115 | 73 | 2 | 0.1 hPa Unsigned MSB |
Gyrometer | 3334 | 134 | 86 | 6 | 0.01 °/s Signed MSB per axis |
GPS Location | 3336 | 136 | 88 | 9 | Latitude : 0.0001 ° Signed MSB |
GPS Location | 3336 | 136 | 88 | 9 | Longitude : 0.0001 ° Signed MSB |
GPS Location | 3336 | 136 | 88 | 9 | Altitude : 0.01 meter Signed MSB |
#
Examples#
Device with 2 temperature sensorsPayload (Hex) | 03 67 01 10 05 67 00 FF | |
---|---|---|
Data Channel | Type | Value |
03 ⇒ 3 | 67 ⇒ Temperature | 0110 = 272 ⇒ 27.2°C |
05 ⇒ 5 | 67 ⇒ Temperature | 00FF = 255 ⇒ 25.5°C |
#
Device with temperature and acceleration sensorsFrame N
Payload (Hex) | 01 67 FF D7 | |
---|---|---|
Data Channel | Type | Value |
01 ⇒ 1 | 67 ⇒ Temperature | FFD7 = -41 ⇒ -4.1°C |
Frame N+1
Payload (Hex) | 06 71 04 D2 FB 2E 00 00 | |
---|---|---|
Data Channel | Type | Value |
06 ⇒ 6 | 71 ⇒ Accelerometer | X: 04D2 = +1234 => + 1.234G |
06 ⇒ 6 | 71 ⇒ Accelerometer | Y: FB2E = -1234 => - 1.234G |
06 ⇒ 6 | 71 ⇒ Accelerometer | Z: 0000 = 0 => 0G |
#
Device with GPSPayload (Hex) | 01 88 06 76 5f f2 96 0a 00 03 e8 | |
---|---|---|
Data Channel | Type | Value |
01 ⇒ 1 | 88 ⇒ GPS | Latitude: 06765f ⇒ 42.3519 |
01 ⇒ 1 | 88 ⇒ GPS | Longitude: F2960a ⇒ -87.9094 |
01 ⇒ 1 | 88 ⇒ GPS | Altitude: 0003E8 ⇒ 10 meters |
#
IPSO Smart Objects ReferenceFor full information about IPSO Smart Objects, see http://www.ipso-alliance.org/.
IPSO Smart Objects Guideline - Starter Pack - Version 1.0 ©2014 IPSO Alliance
The following section provides information extracted from the IPSO Smart Objects specifications. It includes all of the Data Types (object ID) that can be used with Cayenne LPP. Therefore, the current implementation is limited to the data types listed in the Data Types section.
#
Starter Pack Data TypesFor full specification, see http://www.ipso-alliance.org/so-starter-pack/.
#
Expansion Pack Data TypesFor full specification, see http://www.ipso-alliance.org/so-expansion-pack/.
#
Reference Implementation#
Cayenne LPP C/C++ constants definitions#
Cayenne LPP C++ payload builderThis chapter describes the C++ class definition of the reference myDevices implementation, followed with by the implementation details.
CayenneLPP::CayenneLPP(uint8_t size) : maxsize(size)
CayenneLPP::~CayenneLPP(void)
void CayenneLPP::reset(void)
uint8_t CayenneLPP::getSize(void)
uint8_t* CayenneLPP::getBuffer(void)
uint8_t CayenneLPP::copy(uint8_t* dst)
uint8_t CayenneLPP::addDigitalInput(uint8_t channel, uint8_t value)
uint8_t CayenneLPP::addDigitalOutput(uint8_t channel, uint8_t value)
uint8_t CayenneLPP::addAnalogInput(uint8_t channel, float value)
uint8_t CayenneLPP::addAnalogOutput(uint8_t channel, float value)
uint8_t CayenneLPP::addLuminosity(uint8_t channel, uint16_t lux)
uint8_t CayenneLPP::addPresence(uint8_t channel, uint8_t value)
uint8_t CayenneLPP::addTemperature(uint8_t channel, float celsius)
uint8_t CayenneLPP::addRelativeHumidity(uint8_t channel, float rh)
uint8_t CayenneLPP::addAccelerometer(uint8_t channel, float x, float y, float z)
uint8_t CayenneLPP::addBarometricPressure(uint8_t channel, float hpa)
uint8_t CayenneLPP::addGyrometer(uint8_t channel, float x, float y, float z)
uint8_t CayenneLPP::addGPS(uint8_t channel, float latitude, float longitude, float meters)