Thanks Peter - that seems to work to a degree. The green light no longer flashes but the red/orange wi-fi connecting light does still flash. Can that be eliminated also?
On a cold boot (power-on), the imp will always try and connect to the servers. On a warm boot (timer or pin1 wakeup), it will only connect if the Squirrel code tells it to, or if there is am uncaught Squirrel runtime error.
By default it will connect on any server.* call, including server.log, plus agent.send.
Have a look at http://electricimp.com/docs/resources/wifistatediagram/ – what you’re asking, in effect, is how to get from “Warm restart” to “Active offline” and then back to “Asleep” without going via either “Active connecting” or “Suspended connecting”. And the answer is, don’t make any Squirrel calls that contact the server.
Yes. Here’s a model for an internet connected button of mine. Whenever the button is pressed, it wakes up, sends a message, then goes back to sleep. The indicator LED does not blink when it connects.
I just realized that my internet-connected sensor is blinking every time it wakes to write data. Even with imp.enableblinkup(false) right after wake from WAKEREASON_TIMER, I’m getting a brief orange flash before the LED goes dark and the imp goes back to sleep. Is there anything I can do to keep it completely dark while capturing a sensor value and sending it to the agent?
So for something like this… if (hardware.wakereason() == WAKEREASON_TIMER) { imp.enableblinkup(false); }
…it won’t work the first time the imp wakes on timer, but it should be remembered and work for subsequent wakes. Are you setting it back to true anywhere else in the code?