Best practice for reliability
Posted: Mon Jun 22, 2015 1:02 am
I built a dht22 interface that posts data to thingspeak and for the first time I have it powered by 2 D cells.
A plug pack test version ran for several days happily but this one had a boot failure this morning (after 8 hours operation) but recovered after 4 hours, it dropped the battery voltage in that time however, so I suspect it was in the ubiquitous 'zombie mode'.
This one is using an ESP12e board soldered onto a http://www.banggood.com/banggood breadboard friendly board carrier, the ones with the reset and flash switch push buttons already on there along with a regulator (currently bypassed for 3v battery operation).
I have not tied GPIO2 or 15 high, from memory GPIO2 has a pullup but GPIO15 does not. Like I said, it worked for few days previously.
I am using a static IP,as I found the dhcp request crashing on occasions. I wish to have the same IP anyway.
The code ..
WiFi.begin failure .. ESP.deepSleep(SLEEPTIME, WAKE_RFRFCAL);
WiFi not connecting in 20 seconds ESP.deepSleep(SLEEPTIME, WAKE_RFRFCAL);
after successful data posts .. ESP.deepSleep(SLEEPTIME, WAKE_RF_DEFAULT);
where SLEEPTIME is 300000000 (5 minutes)
I use yield() anywhere it may take some time that is not covered by a delay(xxxx)
I did have previous version a 680uF capacitor soldered between vcc and ground, though the carrier board has an SMD electrolytic on the rail (220u .. seems a bit small for that size) I have found the esp8266 never complains about more supply bypassing. even considering adding a supercap for battery operation as it may help a flat battery 'get over the hump' for peak current times. when I start getting unreliable operation I will add a cap and see if it can still function.
I wish to somehow recover from failed boots .. I was considering adding a hardware reset device, RC network on an NPN transistor base, collector to reset line.
pullup to vcc, cap to ground, GPIO via resistor can discharge the cap and hold the transistor off. code sets the GPIO to output,low. If the code fails to initialise then the transistor can turn on within a hundred mS or so and reset the micro.
Instead of that is there either a hardware wdt I can get to function (via configuration) without running any code, I am assuming that boot failure is a complete lack of running external rom code.
Just wondering if anyone has a completely reliable low voltage operating device that can recover from any issues ..
Here is the thingspeak channel.. http://thingspeak.com/channels/36227
If you check soon you can see the dead zone this morning and the drop in battery voltage.
This channel is always going to be running if you want to know the temp and humidity in queensland
if not, here is the historical data for the period, you can see the battery drop with no reports
http://api.thingspeak.com/channels/36227/charts/3?start=2015-06-21%0500:00:00&end=2015-06-23%0000:00:00
and heres the hardware .. dead bug style except I soldered components to the top of the module to leave the pins unscathed.
A plug pack test version ran for several days happily but this one had a boot failure this morning (after 8 hours operation) but recovered after 4 hours, it dropped the battery voltage in that time however, so I suspect it was in the ubiquitous 'zombie mode'.
This one is using an ESP12e board soldered onto a http://www.banggood.com/banggood breadboard friendly board carrier, the ones with the reset and flash switch push buttons already on there along with a regulator (currently bypassed for 3v battery operation).
I have not tied GPIO2 or 15 high, from memory GPIO2 has a pullup but GPIO15 does not. Like I said, it worked for few days previously.
I am using a static IP,as I found the dhcp request crashing on occasions. I wish to have the same IP anyway.
The code ..
WiFi.begin failure .. ESP.deepSleep(SLEEPTIME, WAKE_RFRFCAL);
WiFi not connecting in 20 seconds ESP.deepSleep(SLEEPTIME, WAKE_RFRFCAL);
after successful data posts .. ESP.deepSleep(SLEEPTIME, WAKE_RF_DEFAULT);
where SLEEPTIME is 300000000 (5 minutes)
I use yield() anywhere it may take some time that is not covered by a delay(xxxx)
I did have previous version a 680uF capacitor soldered between vcc and ground, though the carrier board has an SMD electrolytic on the rail (220u .. seems a bit small for that size) I have found the esp8266 never complains about more supply bypassing. even considering adding a supercap for battery operation as it may help a flat battery 'get over the hump' for peak current times. when I start getting unreliable operation I will add a cap and see if it can still function.
I wish to somehow recover from failed boots .. I was considering adding a hardware reset device, RC network on an NPN transistor base, collector to reset line.
pullup to vcc, cap to ground, GPIO via resistor can discharge the cap and hold the transistor off. code sets the GPIO to output,low. If the code fails to initialise then the transistor can turn on within a hundred mS or so and reset the micro.
Instead of that is there either a hardware wdt I can get to function (via configuration) without running any code, I am assuming that boot failure is a complete lack of running external rom code.
Just wondering if anyone has a completely reliable low voltage operating device that can recover from any issues ..
Here is the thingspeak channel.. http://thingspeak.com/channels/36227
If you check soon you can see the dead zone this morning and the drop in battery voltage.
This channel is always going to be running if you want to know the temp and humidity in queensland
if not, here is the historical data for the period, you can see the battery drop with no reports
http://api.thingspeak.com/channels/36227/charts/3?start=2015-06-21%0500:00:00&end=2015-06-23%0000:00:00
and heres the hardware .. dead bug style except I soldered components to the top of the module to leave the pins unscathed.