Post your best Lua script examples here

User avatar
By StefanL38
#27198 Hi,

has anybody written a script that integrates deep sleep mode?

I mean something like reading a digital temperature-sensor like the DS1820 and sending the data via WiFi in this way:

ESP8266-module go sleeping for 1 minute. Then wake up do one measuring of temperature send temperature-data
via WiFi (to whatever) fall asleep again

repeat until special useraction

I'm wondering how long it takes the ESP8266 module to be connected to the WiFi-Network again after sleeping.
Will it be online within one second?

Does anybody have a script-example that demonstrates fall into deep sleep mode wake up up
sned data fall asleep again?

best regards

Stefan
User avatar
By Aeprox
#27219 I've made a little project that measures temperature and other sensors, sends them to a server, then goes to sleep for x seconds. Source is available on here. I hope this helps. Mine currently sleeps for 10 minutes, then wakes for about 5 seconds to do it's sensing/sending. One second might be a bit fast for connecting, but it certainly connects under 3 seconds.