How to connect seeeduino board with cayenne dashboard

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

  1. i did register my devices to the ttn
  2. i did add cayenne as integration
  3. 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

I don’t see a ‘normal’ cayenne dashboard … did you make that , with widgets ect.

probably you placed the wrong link

for the cayenne dashboard i did created it like this
step 1. click to new devices\ widgets
step 2. click to lora
step 3. click to the things network
step 4 select the board (see technology seeeduino LORAWAN)

you can generate an external dashboard link So we may see it

https://cayenne.mydevices.com/cayenne/dashboard/lora/cf74fce0-d563-11e9-b49d-5f4b6757b1bf

but i think it gonna ask my detail before to log in

i did also try this code but it does not want to connect to the ttn (+KEY: NWKSKEY 3FB33E70EECACFB206D4589FFD44980E
+KEY: APPSKEY 3FB33E70EECACFB206D4589FFD44980E
+KEY: APPKEY 3FB33E70EECACFB206D4589FFD44980E
+MODE: LWOTAA
+DR: EU868
+DR: DR0
+DR: EU868 DR0 SF12 BW125K
+CH: 0,867700000,DR0:DR5
+CH: 1,867900000,DR0:DR5
+CH: 2,868800000,DR0:DR5
+RXWIN1: 0,867700000
+RXWIN2: 869500000,DR3
+LW: DC, OFF, 0
+LW: JDC, OFF
+POWER: 14
+MSGHEX: Please join network first

code

#include <LoRaWan.h>

#include <DHT.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);

unsigned char data[2] = {1, 2};
char buffer[256];
CayenneLPP lpp(51);

void setup(void)
{
dht.begin();

SerialUSB.begin(115200);
//while(!SerialUSB);

lora.init();

memset(buffer, 0, 256);
lora.getVersion(buffer, 256, 1);
SerialUSB.print(buffer);

memset(buffer, 0, 256);
lora.getId(buffer, 256, 1);
SerialUSB.print(buffer);

// void setID( char *DevAddr, char *DevEUI, char *AppEUI);
// lora.setId(NULL, “xxxxxxxxxxxx” , “xxxxxxxxxxxxxxxxxxx”);
//setKey(char *NwKSKey, char *AppSKey, char *AppKey);
// lora.setKey(NULL, NULL, “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”);

lora.setKey(“2B7E151628AED2A6ABF7158809CF4F3C”, “2B7E151628AED2A6ABF7158809CF4F3C”, “2B7E151628AED2A6ABF7158809CF4F3C”);

lora.setDeciveMode(LWOTAA);
lora.setDataRate(DR0, EU868);

lora.setChannel(0, 867.7);
lora.setChannel(1, 867.9);
lora.setChannel(2, 868.8);

lora.setReceiceWindowFirst(0, 867.7);
lora.setReceiceWindowSecond(869.5, DR3);

lora.setDutyCycle(false);
lora.setJoinDutyCycle(false);

lora.setPower(14);
}

void loop(void)
{
bool result = false;

delay(10000);
int h = dht.readHumidity();
int t = dht.readTemperature();
lpp.reset();
lpp.addTemperature(1, t);
lpp.addBarometricPressure(2, h);

result = lora.transferPacket(lpp.getBuffer(), lpp.getSize(), 10);

if (result)
{
short length;
short rssi;

memset(buffer, 0, 256);
length = lora.receivePacket(buffer, 256, &rssi);

if (length)
{
  SerialUSB.print("Length is: ");
  SerialUSB.println(length);
  SerialUSB.print("RSSI is: ");
  SerialUSB.println(rssi);
  SerialUSB.print("Data is: ");
  for (unsigned char i = 0; i < length; i ++)
  {
    SerialUSB.print("0x");
    SerialUSB.print(buffer[i], HEX);
    SerialUSB.print(" ");
  }
  SerialUSB.println();
}

}
}

You can ‘share’ a dashboard you’ve created. (search docs)

I don’t want your 'log in ’ page :sunglasses:
just want to make sure your Cayenne setup is ok before looking at codes&nodes

but you have more ‘problems’

1 - your gateway, is it connected to TTN and is it lorawan compatible
2 - your node(s) … can they connect OTAA to TTN and you see their data coming in
3 - Cayenne integration… do you receive data in Cayenne

1 yes my gateway running on the ttn (working nicely)

  1. yes i am bale to send data to the ttn ( temeperature , humidity and moisture)

3 i did add cayenne to the integration but am not able to receive data to cayenne dashboard

https://cayenne.mydevices.com/shared/5d7b5a4633ed91791a67ad39

@BoRRoZ did i well set up the cayenne dashboard?

Hi sorry… bit busy
I see an empty dashboard with no widgets

https://cayenne.mydevices.com/shared/5d7b5a4633ed91791a67ad39

I’m missing some widgets ?

lpp.reset();
lpp.addTemperature(1, t);
lpp.addRelativeHumidity(2,h );
lpp.addmoisture(3, m);

lpp.addBarometricPressure](https://lpp.addBarometricPressure)(2, 1073.21);
lpp.addGPS](https://lpp.addGPS)(3, 52.37365, 4.88650, 2);

anyway in your live dashboard you can exactly see what data is received (in this case from ttn)
see some tab … sorry, I don’t have time to look everthing up for you now, haven’t worked in a long time with Cayenne So maybe things changed :wink:

@BoRRoZ thank you … its working now :sunglasses: