Following up on my experiments so far.
After adding a large cap (470uf) across the power lines, adding pull up/downs wherever it is recommended and using a capable DC-DC off a USB wall charger, I now have it running in the bedroom since
2015/02/25-09:30:02 (yes, I have the log). I did get a few issues along the way but since
2015/02/27-21:14:25 (so about for days now) it is going uninterrupted.
Interestingly, a few times the
tmr.now() function returned
Infinity, even for the call that is the first line in
The following log columns are: time , run count, times, VDD, temp.
The times are : init start, time to read the ds18b20, time as
dsleep(60) is issued (so the full run time).
20150303092547 8171 times=0.287835,0.035485,1.2434 vdd=3.38 21.1875
20150303092647 8172 times=Infinity,0.035489,1.24346 vdd=3.38 21.25
20150303092747 8173 times=0.292882,0.03549,1.26849 vdd=3.38 21.25
One small change in the program [in response to test (5) above which I encountered again] is that if the WiFi connect is not completed in 15 seconds (it usually takes a fraction of a second) the program issues the full WiFi
setmode/config/connect (but only once). Normally it skips this and just waits for an IP.
An example of a case where (I assume) this was triggered:
20150303081153 8097 times=0.291779,0.035497,1.24335 vdd=3.38 20.375
20150303081256 8098 times=0.285323,0.03549,4.268 vdd=3.38 20.375
20150303081413 8099 times=0.290115,0.03549,19.4173 vdd=3.38 20.375
20150303081511 8100 times=0.286637,0.03549,1.26844 vdd=3.38 20.375
8098 line shows a slow cycle (happened a few times) and the following one is probably a failure followed by a reset.
[much later] The setup has now run for over two weeks, more that 25,000 cycles (60s each). It feels so wrong but I plan to experiment further by reducing the supply voltage (it is using an adjustable DC-DC from a wall USB charger) to see how it affects the operation. Now it reports about 3.39v when active, and I expect that it goes up to at least 3.5v when sleeping.
[way later] After running for over a month I did turn it off and tried a few things. It never worked for more that a few hours at a time since