open the code you want. example for you it will Ethernet shield 5100 (my guess) and arduino mega.
in the code:
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "xxx";
char password[] = "xxx";
char clientID[] = "xxx";
Something that never worked is the humidity.
It works in a void loop and display in serial but when i execute the code in a CAYENNE_OUT cayenne displays -999. Do you have any knowledge of that?
Humidity worked when i used a delay of 1000/2000 milliseconds. So i think it doesn’t work because of the cayenne interval time before executing script and sending data
It’s because you are not checking the DHT results for errors. Use something like this:
do {
WhileLoops++;
//We can't go too long without calling Cayenne.loop() so exit this loop after 2 seconds and set an error flag
if (WhileLoops >= 4){
Serial.println("Sensor Read Error");
ReadError = true;
break;
}
//Read temperature as Fahrenheit
t = dht.readTemperature(true);
//Read humidity (percent)
h = dht.readHumidity();
//Read temperature as Fahrenheit
t = dht.readTemperature(true);
//Calculate Heat Index as Fahrenheit
hif = dht.computeHeatIndex(t, h);
delay(500);
} while (isnan(t) || isnan(h));
unless the humitidy the only problem is the speed. Before my update to MQTT everything was perfect. When i changed colors of my led strip it changed immediately, now it takes 8 seconds.
i checked it out.
he says DHT sensor library by Adafruit version 1.2.3 is being used but when i use that version or any other version it gives errors about his code.
according to this: Sending MQTT messages within rate limits
Cayenne only uses intervals about 15 seconds.
But that should be with actuators so i don’t think that is it