By using DeepSleep and connecting the Hall Effect Sensor to the Reset pin I was able to wake the ESP at each pulse.
Code: Select all
on System#Wake do
If [Variable#DSAllowed]=0
TimerSet,1,30
GPIO,2,0
else
TaskValueSet,1,2,1
endif
TaskValueSet,1,1,[Variable#Total]+1
endon
on Rules#Timer=1 do
GPIO,2,1
TaskValueSet,1,2,1
endon
On WiFi#Connected do
SendToHTTP,xxxxxxx.co.uk,80,/gas/xxxxx.asp?[Variable#Total]
if [Variable#DSAllowed]>0 AND [Variable#ManDSBlock]=0
Pulse,2,0,10
DeepSleep,0
endif
endon
In order to catch the device when it is momentarily awake:
Code: Select all
#!/bin/bash
c=0
while [ $c -ne 1 ]; do
ping -c 1 -i 0.1 -W 0.1 192.168.1.62
if [ $? -eq 0 ]; then
open http://192.168.1.62/control?cmd=taskvalueset,1,3,1
c=1;
fi
done
3144 Hall sensor is connected to 3.3v / Reset /GND and uses 2ma continuously. Power supply is 3 x Alkaline D cells.