This is:
- a sketch for the Sparkfun Thing (ESP8266 board) that posts the state of a door (when it changes) to <data.sparkfun.com>
- a webpage that reads the data from <data.sparkfun.com> 1x/second and updates the page text/color when it's changed.
- Wake up from sleep
- Read last state from EEPROM
- Read new state from door sensor
- If they are different:
- flash onboard LED 1x
- connect WIFI
- post new state to data.sparkfun.com
- flash onboard LED 2x
- disconnect WIFI
- go to sleep for specified # of seconds
GOTO
1
- read new status from data.sparkfun.com 1x/second
- If it's different, update page
- connect
DTR
toXPD
to utilizedeepSleep
. If you do not, your thing will not wake up from sleep 'til it's manually reset - on wakeup, sketch starts from the top so state can only be preserved across sleep by writing to EEPROM before sleep & reading from it after