Hello,
I’ve been struggling with this issue for too many hours at this point and finally have a good summary of what’s happening:
IF I provide a bad SSID (fake network) to the imp and allow it to go to sleep, when i reawaken it with a button press it does (almost) no blinking and is unresponsive to button presses (including power off). By almost no blinking I mean it blinks amber for a millisecond and then after 10 seconds I see another extremely short blink, THEN it runs my code. I have set my timeout policy how I want, first two lines of my code are:
const TIMEOUT_SERVER_S = 20; // timeout for wifi connect and send server.setsendtimeoutpolicy(RETURN_ON_ERROR, WAIT_TIL_SENT, TIMEOUT_SERVER_S);
so I know it’s not an issue with that.
and the first real code that runs is to configure an LED and then turn it on so I know the exact time that my code begins to run (offline debugging is a pain). Just to be clear: I am NOT trying to connect to the server first, I am switching on an LED before ANY OTHER CODE except my constatnts that I set at the top.
If it has a good SSID it seems to work fine, I press the button and it begins running code immediately.
So my question is this:
Is it my code? I find that hard to believe since it takes 10 seconds to get to the first line. Is this something built into the imp? If it is, is there a way to disable it?
First few lines of code:
function main() { hardware.pin5.configure(PWM_OUT, 1.0/400.0, 0.0); hardware.pin5.write(1.0); imp.enableblinkup(true); blueLed.on(); <---takes 10 seconds to get to here imp.sleep(15); blueLed.off(); imp.enableblinkup(false);
Any help is greatly appreciated!