Skip to content
Arduino Library to decode CayenneLPP package to a Json format.
Branch: master
Clone or download
ricaun Add isValid
Add isValid function to checks if the buffer is a CayenneLPP valid payload.
Latest commit ed52d30 May 10, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Add isValid May 10, 2019
examples Add isValid May 10, 2019
imgs Initial commit Oct 20, 2018
src Add isValid May 10, 2019
LICENSE Update ricaun Jan 5, 2019
README.md Update ricaun Jan 5, 2019
keywords.txt Add isValid May 10, 2019
library.properties Add isValid May 10, 2019

README.md

CayenneLPPDecode

This is an Arduino Library Compatible to Decoder Cayenne Low Power Payload to Json format (ArduinoJson).

Dependences

This library uses the ArduinoJson library.

Installation

Documentation

Examples

The library comes with examples. After installing the library you need to restart the Arduino IDE before they can be found under File > Examples > CayenneLPPDecode.

Quickstart

CayenneLPP Input

lpp.addDigitalInput(1, 0);
lpp.addDigitalOutput(2, 1);
lpp.addAnalogInput(3, 1.23f);
lpp.addAnalogOutput(4, 3.45f);
lpp.addLuminosity(5, 20304);
lpp.addPresence(6, 1);
lpp.addTemperature(7, 26.5f);
lpp.addRelativeHumidity(8, 86.6f);
lpp.addAccelerometer(9, 1.234f, -1.234f, 0.567f);
lpp.addBarometricPressure(10, 1023.4f);
lpp.addGyrometer(1, -12.34f, 45.56f, 89.01f);
lpp.addGPS(1, -12.34f, 45.56f, 9.01f);

CayenneLPPDecode Json Output

{
  "digital_in_1": 0,
  "digital_out_2": 1,
  "analog_in_3": 1.23,
  "analog_out_4": 3.45,
  "luminosity_5": 20304,
  "presence_6": 1,
  "temperature_7": 26.5,
  "relative_humidity_8": 86.5,
  "accelerometer_9": {
    "x": 1.234,
    "y": -1.234,
    "z": 0.567
  },
  "barometric_pressure_10": 1023.4,
  "gyrometer_1": {
    "x": -12.34,
    "y": 45.56,
    "z": 89.01
  },
  "gps_1": {
    "latitude": -12.34,
    "longitude": 45.56,
    "altitude": 9.01
  }
}

Json Field

The json field name was based on The Things Network payload format Cayenne LPP.

ttn_fields


Do you like this library? Please star this project on GitHub!

You can’t perform that action at this time.