hello
i am having a problem with my seeeduino board , am trying tho send data to the cayenne dashboard but nothing it showing to the cayenne dashboard
- i did register my devices to the ttn
- i did add cayenne as integration
- to the cayenne side (https://cayenne.mydevices.com/cayenne/dashboard/lora/cf74fce0-d563-11e9-b49d-5f4b6757b1bf)
4 .and am using this code
#include <LoRaWan.h>
#include <DHT.h>
#include <TheThingsNetwork.h>
#include <CayenneLPP.h>
#define DHTPIN A0 // the pin we’re connected the temperature and humidity sensor
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
#define moisture A2 // the pin we’re connected the moisture sensor
int moistureval;
// Set your AppEUI and AppKey
const char *appEui = “xxxxxxxxxxxxxx”;
const char *appKey = “xxxxxxxxxxxxxxxxxxxxxxxxxxx”;
#define loraSerial SerialUSB
#define debugSerial SerialUSB
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
#define freqPlan TTN_FP_EU868
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
CayenneLPP lpp(51);
//define and int variables
//unit16_t induval = 0;
uint16_t induVal = 0;
bool induState = false;
//uint16_t lightVal = 0;
//bool errorState = false;
uint16_t humidity = 0;
uint16_t temperature = 0;
//uint8_t addTemperature(uint8_t channel, float celsius);
//uint8_t addRelativeHumidity(uint8_t channel, float rh);
void setup()
{
//loraSerial.begin(57600);
//while(!SerialUSB);
debugSerial.begin(115200);
pinMode(moisture,INPUT);
// Wait a maximum of 10s for Serial Monitor
while (!debugSerial && millis() < 1000)
;
debugSerial.println("-- STATUS");
ttn.showStatus();
debugSerial.println("-- JOIN");
ttn.join(appEui, appKey);
dht.begin();
}
void loop()
{
debugSerial.println("-- LOOP");
debugSerial.println("----------------------------------");
//ttn.showStatus();
debugSerial.println();
debugSerial.println(“sensor information”);
debugSerial.println("----------------------------------");
debugSerial.println(“DATA”);
debugSerial.println();
temperature =dht.readTemperature()*100 ;
humidity =dht.readHumidity()*100;
moistureval = analogRead(moisture);
debugSerial.print(“Temperature”);
debugSerial.println(“Temperature”);
debugSerial.print(“Humidity”);
debugSerial.println(“Humidity”);
debugSerial.print(“moisture”);
debugSerial.println(“moisture”);
//
float t = temperature;
float h = humidity;
lpp.reset();
lpp.addTemperature(1, t);
lpp.addRelativeHumidity(2,h );
// lpp.addmoisture(3, m);
//lpp.addBarometricPressure(2, 1073.21);
//lpp.addGPS(3, 52.37365, 4.88650, 2);
debugSerial.println(“payload”);
byte payload[4]={0};
payload[0] = highByte(temperature);
payload[1] = lowByte(temperature);
payload[2] = highByte(humidity);
payload[3] = lowByte(humidity);
// payload[4] = highByte(moistureval);
// payload[5] = lowByte(moistureval);
int loop;
for(loop=0; loop < 4; loop++)
debugSerial.println(payload[loop]);
// Send it off
// ttn.sendBytes(lpp.getBuffer(), lpp.getSize());
// SerialUSB.print("Temperature: "+String (temperature));
//SerialUSB.print("humidity: "+String (humidity));
ttn.sendBytes(payload, sizeof(payload));
debugSerial.println();
delay(10000);
}
please help me how to fix this problem