So I am having a pretty basic problem…
I currently have a DHT22 temp/humidity sensor hooked up to my Arduino UNO, with a 5500 Ethernet shield on top. I have it connect and sending both temp and humidity data to my dashboard
However, I cannot get a Line Chart working, at all. I would like to show both the temp and humidity together on the same graph. I have gone through the different tutorials offered on the website, but they tell you to set the data type to either “virtual” or “I/O”…neither of which exist, as a sensor/data type.
Currently, I set my sensor as “Temperature” and the channel to V0. See my (simple) code below:
How do I get this working?
#include "DHT.h"
#include <CayenneMQTTEthernet.h>
//#define CAYENNE_DEBUG // Uncomment to show debug messages
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#define DHTPIN 6 // what digital pin we're connected to
#define DHTTYPE DHT22 // DHT 22
#define VIRTUAL_CHANNEL V0
#define VIRTUAL_humid
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "";
char password[] = "";
char clientID[] = "";
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(115200);
Cayenne.begin(username, password, clientID);
dht.begin();
}
void loop()
{
Cayenne.loop();
}
// Default function for sending sensor data at intervals to Cayenne.
// You can also use functions for specific channels, e.g CAYENNE_OUT(1) for sending channel 1 data.
CAYENNE_OUT(V0)
{
float f = dht.readTemperature(true);
Cayenne.virtualWrite(V0, f);
}
CAYENNE_OUT(V1)
{
float h = dht.readHumidity();
Cayenne.virtualWrite(V1, h);
}