Hello,
I’m having a problem with cayenne dashboard graph widgets.
I’m using a DHT11 with a ESP-01 (ESP8266).
The value widget is working, and showing values of temperature and humidity correctly and constantly.
But for some reason, the graphs appear with this error, when I select min or hours or day:
The code I uploaded to the ESP-01:
#include “DHT.h” // including the library of DHT11 temperature and humidity sensor
#define DHTTYPE DHT11 // DHT 11
#define dht_dpin 2
DHT dht(dht_dpin, DHTTYPE);
#include <CayenneMQTTESP8266.h>
#define CAYENNE_PRINT Serial
#define CAYENNE_DEBUG// WiFi network info.
char ssid = “”;
char wifiPassword = “”;// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username = “”;
char password = “”;
char clientID = “”;#define SENSOR_PIN 2 // Do not use digital pins 0 or 1 since those conflict with the use of Serial.
void setup()
{
dht.begin();
pinMode(SENSOR_PIN, INPUT);
Serial.begin(9600);
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}void loop()
{
Cayenne.loop();
delay(1000);
}int previousState = -1;
int currentState = -1;
unsigned long previousMillis = 0;CAYENNE_OUT(4)
{
float t = dht.readTemperature();
Cayenne.virtualWrite(4,t,“temp”,“c”); //virtual pin
}CAYENNE_OUT(5)
{
float h = dht.readHumidity();
Cayenne.virtualWrite(5,h,“rel_hum”,“p”); //virtual pin
}
Thank you in advance.