btidey wrote:I would put a multimeter (current mode) in the Vdd feed to the circuit to help diagnose the issue.
With mag switch closed (reset low) the current should be lowish but it maybe the internal pull up on the reset line is a low value. Typically this would be about 10K which would amount to 300uA current in addition to the standby current of the ESP8266. Although high for a battery application 300uA should still last 6000 hours with that battery pack
With it open the current should go up to about 80mA for a few seconds until deep sleep kicks in and it drops back down to the same sort of quiescent current as with switch closed. If that doesn't happen then there is some flaw in the program logic preventing the deep sleep kicking in. It sounds like that might be happening in your case.
To avoid the higher quiescent current caused by the reset pull up. I use the CH_PD as the trigger input for the switch. This behaves similarly to the RST but you can put your own high value pull up on that. For example, I leave the RST alone, put a 1M pull up from CH_PD to Vdd and connect the switch to that. Quiescent current is then around 10uA.
Rudy's logic to force hold the CH_PD via another GPIO (via a medium value resistor) is what I do as well using a ESP-12F on my security sensors. Otherwise a short 'open' may not give enough time to report. After reporting the event the code releases the hold GPIO and goes into deep sleep waiting for the next event.
Ok thanks I will try that.
If it is possible do you have some info about your sensors with the esp12?
This could be a good back-up option
Thanks in advance