Questions with regards to ESP8266 Basic and hardware interfacing and control via Basic commands

Moderator: Mmiscool

User avatar
By jimlyke
#54735 An earlier post (viewtopic.php?f=39&t=4892), indicates that you can enable a module to start by clicking a field in settings, but that you have up a minute to abort. I know that is a useful feature, since with Lua interpreter you can brick modules by getting hung on the init.lua, and giving a developer up to a minute to abort helps with that problem. However, I was hoping to create modules that actually CAN autorun when disconnected from the built-in development environment. Is there a "best practice" for creating modules that you can field that start right away upon power up (realizing that can be risky if the autostart jumps to buggy code)?
User avatar
By PhilTilson
#54750 I raised the same point a while ago.

What would be ideal is a setting whereby the delay could be the default for program development, but once stable operation had been established, the setting could be changed to do away with the delay.

I am particularly interested in this as a means of saving power by putting the module to sleep for relatively short periods (say 10 - 30 seconds), waking it up to check a condition, then putting it to sleep again.

With the present arrangement, putting it to sleep for 10 seconds then means waiting a minute for it to wake up and run the program, which makes it hardly worthwhile!

I have a project using PICs in which I wake the PIC up every second, perform a check that takes about 5mS, then put it to sleep again. This keeps power consumption very low.

Phil
User avatar
By Oldbod
#54774 The delay is currently 30secs i believe. This comes up once in a while- sure i wasn't the first to ask, for exactly same reasons. I'm not sure how mmiscool can get round it, given that not all modules have easily user accessible switches. The module has more sleep types and iirc wakeup or reboot cause, cant remember which, available, but i dont know if these can be accessed by the compiler that generates the esp8266basic executable. If they could, what i might like would be a setting that ran default program at once except after powerfail. Meanwhile, you can always build your own version of esp8266basic with a reduced delay.
User avatar
By Mmiscool
#54775 You can turn the wifi on and off to save some power.

I will be investigating other options for sleep here soon....