I am using a ESP8266 SP12E devkit V2 and want to transmit values from my AM2302 DHT22 temp. and humid. sensor.
The sketch itself works fine (output to serial), but as soon as I add one additional line (that has nothing to do with DHT22 or the humidity var) its getting crazy ...
This is how it works:
void loop()
{
delay(dht.getMinimumSamplingPeriod());
float humidity = dht.getHumidity();
float temperature = dht.getTemperature();
Serial.println(String(millis()));
// Serial.println("Uptime: " + String(millis()/60000) +" min " + String(millis()/1000) + " sec");
Serial.print(humidity, 1);
Serial.print("\t\t");
Serial.println(temperature, 1);
In this case the output looks like:
........
WiFi connected
Server started
10.0.0.29
6811
45.2 24.2
8816
45.2 24.2
You can see this one line that is commented out.
As soon as I comment it in:
void loop()
{
delay(dht.getMinimumSamplingPeriod());
float humidity = dht.getHumidity();
float temperature = dht.getTemperature();
Serial.println(String(millis()));
Serial.println("Uptime: " + String(millis()/60000) +" min " + String(millis()/1000) + " sec");
Serial.print(humidity, 1);
Serial.print("\t\t");
Serial.println(temperature, 1);
this is what I get:
........
WiFi connected
Server started
10.0.0.29
6811
Uptime: 0 min 6 sec
6553649.0 24.2
8816
Uptime: 0 min 8 sec
6553649.0 24.2
The humidity value is just scrap.
I have no idea how this can happen ...
Does anyone have a hint for me ?
BR
Gawan