Ubidots client(TOKEN);
DHT dht(DHTPIN, DHTTYPE);
void setup(){
Serial.begin(115200);
delay(10000);
dht.begin();
delay(1000);
// client.wifiConnection(WIFISSID, PASSWORD);
WiFi.begin(WIFISSID,PASSWORD);
Serial.println(WIFISSID);
delay(5000);
Serial.print("WiFi.status=");
Serial.println(WiFi.status());
}
void loop(){
float value = dht.readTemperature(true);
float value2 = dht.readHumidity();
client.add("temperature1", value);
client.add("humidity1", value2);
client.sendAll(true);
Serial.println("Ubidots data");
Serial.println("temperature: "+String(value));
Serial.println("humidity: "+String(value2));
Serial.println(" Going to Sleep for a while !" );
delay(30000);
}
This code connects fine but does not update the variables in Ubidots.
Here is the serial monitor response:
=>temperature1:75.20000,humidity1:34.00000,
POSTING YOUR VARIABLES
Ubidots data
temperature: 75.20
humidity: 34.00
Going to Sleep for a while !