-->
Page 1 of 2

Weather station on ESP-12E - stops working after 2 hours

PostPosted: Sun Nov 13, 2016 6:31 pm
by anichin
Hi all,

Another newbie in need of help here. I built a weather station based on this schematic:

Image

The full instuctable is here:


Instead of nodemcu I used ESP-12E: Image and a break board Image


It runs in deep sleep mode (RESET connected to GPIO16) and wakes up every minute to send the sensor readings to ThingSpeak.

I put it inside a solar light like this one Image and it is power by its 1200mAh 4v battery

Everything works fine but after a couple of hours it stops.

Here is some charts from ThingSpeak that show the measured temperature and the battery level:

Temperature (C)

Battery level

Initially I suspected it was drawing too much current but this is not the case - the battery is not discharged.

I think it is just unstable and cannot wake up from deep sleep at some point. Are there any additional pins that I have to wire to VCC or GND?

For example according this GPIO 0 should be LOW during flashing and HIGH when running. I do not have this connected to anything:

Image

If it has to be connected to VCC do I need a resistor?

Re: Weather station on ESP-12E - stops working after 2 hours

PostPosted: Mon Nov 14, 2016 2:36 pm
by schufti
Hi,
I made something similar from ESP-01, BME-280 (so only temp, hum, press), HT7333 and old LiIon cells.
It is running for over 1/2 year now with one recharge with a reading every 15' ... several reboots and even a change of WiFi-router didn't bring it to a halt (no values to TS, but no restart of ESP needed).

TS-public view

you can see that it is still in "project" status w/o any case and on breadboard, no extra parts on ESP except 1k from gpio16 to rst and 1k for chpd to Vcc. Pullups for gpio0/2 are integrated on bme280 breakout.
No need for pullup on rst (since connected via 1k to gpio16)

Re: Weather station on ESP-12E - stops working after 2 hours

PostPosted: Mon Nov 14, 2016 3:42 pm
by martinayotte
No need for pullup on rst (since connected via 1k to gpio16)

It is a good practice to have one, because GPIO16 is HIGH only during deepSleep() and LOW during WakeUP, the rest of the time, it is left High-Z.

Re: Weather station on ESP-12E - stops working after 2 hours

PostPosted: Mon Nov 14, 2016 5:09 pm
by stavbodik
I can tell I had same problem with my project...My case was very easy to find and fix and similar behavior like yours, fine work sending TCP for about 0.5-1 hour and then stops sending.

I did run it on serial adapter and was waiting for moment when it stops sending(about half-1h),
at this point when stopped working I got exception number 3

exception list :
https://github.com/esp8266/Arduino/blob ... _causes.md

Which means "Processor internal physical address or data error during load or store"

So I have looked in my code and found bug where I was using free() on none allocated memory space with malloc ,

my fix was :
Code: Select all//read data from clients
while ((size = client.available()) > 0) {
        unsigned long msg[size];
        size = client.read((uint8_t *)msg, size);
        //send data to main server
        sendTCP(*msg);
        free(msg); // bug, removed this line
}

this fixed the issue.