Battery Powered ESP8266 Temperature/Humidity Monitor with DHT11

Uhha, blasts my serial monior:

0‚~?–4“Ò¶£ÿOCAZþûSetup[253] Connecting to networxSAVE2
[3256] Connected to WiFi
[3256] My IP: 192.168.200.68
Cayenne setupBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loop[5058] Connecting to arduino.mydevices.com:8442
End Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loop[5554] Ready (ping: 201ms).
End Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.run

So did you get the wdt error that time? also, lets clean that up a bit with some serial.println lol

void setup()
{
  Serial.begin(9600);
  Serial.println("Setup");
  Cayenne.begin(token, ssid, password);
  Serial.println("Cayenne setup");

  Humidity = false;
  Temperature = false;
  //HeatIndex = false;
}

void loop()
{
  //Run Cayenne Functions
  Serial.println("Begin loop");
  Cayenne.run();
  Serial.println("End Cayenne.run");
  delay(100);
  //Check if we got all values we wanted and sleep for 10 minutes if we did
  // if (Humidity && Temperature && HeatIndex){
    if (Humidity && Temperature){
    Serial.println("Got all values - sleeping");
    delay(100);
    ESP.deepSleep(60000000, WAKE_RF_DEFAULT);
    delay(100);
  }
  Serial.println("End loop");
}

hmmm for me no hints …

0‚~?–4“Ò¶£ÿOCAZþûSetup
[251] Connecting to networxSAVE2
[4253] Connected to WiFi
[4253] My IP: 192.168.200.68
Cayenne setup
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
[5054] Connecting to arduino.mydevices.com:8442
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
[10360] Connecting to arduino.mydevices.com:8442
End Cayenne.run
End loop
Begin loop
[10697] Connecting to arduino.mydevices.com:8442
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
[11142] Ready (ping: 200ms).
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run

looking back at your first posts it’s probably something to do in the temp read function since you have:

[2264] Connected to WiFi
[2264] My IP: 192.168.200.37
[5065] Connecting to arduino.mydevices.com:8442
[5438] Ready (ping: 100ms).
Entered Temperature

Exception (28):

Try wiping out the code in your temperature read function and your humidity read function and put in the code you have in your other script that works, then just send that variable with Cayenne.virtualWrite(V0, variablenamehere);

1 Like

My guess is it’s something with your HTU21D driver that isn’t compatible with ESP.

Ok. Ok. I’ll sit back down.

Craig

So no values are send when i integrate virtualWrite to the sample script …

What about CAYENNE_OUT(V0) or/and #define VIRTUAL_PIN V0 ?

@kreggly Why it should not compatible? As i mentioned HTU sample sketch works and i used ESP+HTU in other projects.

Alrighty then :slight_smile:

I think what @adam is saying is, try something like this:

It might be that you are getting stuck too long waiting for a non NAN return. I don’t have a Sparkfun device, so can’t test myself.

Craig

@kreggly’s test will work fine to eliminate errors in the CAYENNE_OUT(V1) function.

I was actually saying wipe out what you currently have in the CAYENNE_OUT(V1) function and put in the code you have that you know works and then send that value with Cayenne.virtualWrite(V1, variable);.

Best practice is to eliminate bits until your program is running reliably, then add back.

If the above works, un-comment the function read and try that.

Next, add back nan check loop, and try that.

Ad nauseum.

It is tedious, but it is one of those skills that gets better with practice :wink:

Craig

Only works when set both hum and temp by hand. :rage:

We’re getting a bit off topic haha. Why don’t you start a new thread in the help with projects category and we’ll respond there. One way or another we’ll get you squared away…

Maybe we can follow up here: http://community.mydevices.com/t/esp8266-temperature-humidity-monitor-with-htu21d/1596/3

Inserting my working function into CAYENNE_OUT(V1) will also not work, i still get an reboot. Sorry but i have absolutely no idea what causes the problem.
I think it is cayenne problem as HTU21d i not such an exotic sensor…

Next upgrade to this project is solar charging:

Update:

After not getting any values on my dashboard since February I thought it was about time to update my sketch and give everyone an update to the MQTT version of this project. You can find the new sketch and modified library file in the first post.

Also, the solar panel went to another project so no update there :frowning:

Could you summarize your conclusions on battery powered sensor - maybe in a new topic.

I’ve tried esp-01 with separate AMS1117, but soldering that reset pin for deepsleep was beyond my skills, so that stuff is only for usb for AC power.

I’ve tried the esp-12e with builtin power regulator (and convenient usb) with 2-3 NiMH or Alkaline AA using the deepsleep mode, and also some cheap 5v usb recharge batteries, but have been having trouble with the usb recharge battery shutting off because it thought the phone was recharged.

Not sure on the ideal combination.

If you want the best battery life you need a setup like I have posted above, a bare ESP module and super low drop out voltage regulator. The NodeMCU modules will drain your batteries more in deep sleep and will cut out when the battery reaches about 4 volts vs mine that cuts out around 3v.

Hello Adam,
Thanks for the project. The topic is great and gives you many opportunities to use your knowledge. My project is ESP32 based and I used part of your code to put ESP32 into deep sleep mode, reading the data every 15 minutes. It works great.
Тhanks

2 Likes