Imp cannot start without WiFi

imp based device are placed un the WiFi range border - sometimes WiFi - yes, more - no.
Code is stored.
Imp is about 8-10 month old, so I don’t no initial Release.
After I turn it on, everything show that the latest Release are installed.
But - no possibility to star on “cold boot” without WiFi.
I cannot understand what I have missed…

So, depends what you’re attempting to do without wifi, and what your timeout policy is set to. eg, a server.log with the default policy will cause the imp to block and wait for wifi to come up.

See here for more info

Thanks Hugo! Works! Very cool advantage!

I have a related but slightly different conundrum. I would like to power down my imp in one location and then move the imp to another. It needs to connect to a different wifi at the new location. When the imp powers on the first thing it does is try to connect to wifi. It seems it will never go beyond that to run any squirrel.

I have some code that is very closely based on that of @MikeyDK from this thread.

thread for changing wifi config

I can get that code to switch wifi networks and it seems to work during debug but as soon as the real deal comes up it fails. Has anyone been able to get an imp to switch to an available wifi network on cold boot?

As has been noted, it will try to connect for 10 seconds, and then it will run the stored code.

You can definitely do what you’re trying to do - but if you aren’t using RETURN_ON_ERROR then you could get blocked on any code that assumes a server is available.

It is good to know this can be done and I am using RETURN_ON_ERROR. I think I’ll just have to keep scrubbing my code and perhaps take out everything that does not belong to the wifi switch code. For now, I have placed the code for connecting wifi at the top of the device code and I do not call server.log

The wifi state diagram does not have anything written about trying to connect for 10 seconds. It says if it fails to connect to wifi within 1 minute it snoozes for 9 minutes before trying again. ?? From this wifi state diagram there are not any blue lines coming out of the Booting state.

Ah yes, sorry about that. That diagram needs updating a bit for the new “run Squirrel on cold boot” feature that was in release-27.


ok, got it to work. I had not realized before that so much time would go by and I was silly and did not have log messages in the IDE to help me out. It takes about 1 minute and 10 seconds for the imp to power on and switch networks.

maybe there is a 60 second wait for one thing and 10 seconds for another? In any case I just need to be patient.