DASHBOARD

For efficient visualisation, we use Cayenne MyDevices. Cayenee displays and stores data from devices and sensors providing visibility to behaviour patterns that support improvements on your IoT projects.

1. Cayenne Low Power Payload (LPP) is a library designed to make packages for LPWAN networks such as LoRa and LoRaWAN. Cayenne LPP has several specific functions for some types of packages, such as humidity, temperature, pressure, GPS, among others, read more about Cayenne LPP.

uint8_t addDigitalInput(uint8_t channel, uint8_t value);
uint8_t addDigitalOutput(uint8_t channel, uint8_t value);
uint8_t addAnalogInput(uint8_t channel, float value);
uint8_t addAnalogOutput(uint8_t channel, float value);
uint8_t addLuminosity(uint8_t channel, uint16_t lux);
uint8_t addPresence(uint8_t channel, uint8_t value);
uint8_t addTemperature(uint8_t channel, float celsius);
uint8_t addRelativeHumidity(uint8_t channel, float rh);
uint8_t addAccelerometer(uint8_t channel, float x, float y, float z);
uint8_t addBarometricPressure(uint8_t channel, float hpa);
uint8_t addGyrometer(uint8_t channel, float x, float y, float z);
uint8_t addGPS(uint8_t channel, float latitude, float longitude, float meters);

Simply load the Cayenee library into your sketch:

#include <CayenneLPP.h>
CayenneLPP lpp(80);

2. Add the following function:

void do_send(osjob_t* j){

if (LMIC.opmode & OP_TXRXPEND) {// Check if there is not a current TX/RX job running
Serial.println(F("OP_TXRXPEND, not sending"));
} else {

float teplota = dht.readTemperature(); 
float hum = dht.readHumidity();

lpp.reset();
lpp.addTemperature(1, teplota); //add the temperature into channel 1
lpp.addRelativeHumidity(2, hum); //add the humidity into channel 2

LMIC_setTxData2(1,lpp.getBuffer(), lpp.getSize(), 0);  

}
}

3. In The Things Network Console change the Payload Format as well as the Integrations to Cayenee.

4. Check the Data.

5. Make your Dashboard, use your DevEUI.