Imp006 Development Board wifi to cellular switch over

I am intrigued by the new Imp006 board having onboard cellular, wifi, and bluetooth. If you have the board configured for wifi and the wifi router goes down can you program it to automatically switch over to cellular and then back when wifi resumes? Where would this code reside and what would it generally might look like?

Thanks.

That’s doable. You would use a combination of server.onunexpecteddisconnect() and the imp’s network interface management in manual mode.

I haven’t yet updated it for multiple network interfaces, but my disconnection manager code should help you get started.

Thanks for the reply!

I monitor temperature in my house with a couple of ElectrIc Imp Env Tails. They really work well and if I am away and the temperature gets too low in the house (possible HVAC failure) I get a text. I have a generator so that is not an issue but if the WiFi goes down and I am not at home I have no way of knowing what’s going with temperature in the house.

I don’t currently own an imp006 Breakout Board but I was thinking it would be a great upgrade. First I was thinking just have it always run as a Cellular device but if I could switch between WiFi and Cellular would be great to save on data usage.

When the power goes out it takes the generator 20 seconds to kick on so the imp would lose power and then reboot trying to connect to WiFi but if it is out too (usually when the power goes down cable goes out too, downed line etc.) it would switch over to Cellular. When the WiFi signal is back I would like it to drop cellular and back to WiFi.

So do you think the above scenario is doable? I need to order an imp006 Breakout Board to get started.

Thanks for listening and hopefully I can reach out to you once I get started if I hit any snags. I am hoping to reuse a lot of the tails code I have already.

Charlie

You should be able to do that. You’ll have to tweak the code a tiny bit — the imp006 has different pin names from the old imp001 — but that’s about it for the basic app. You can even wire the tail’s pins to header soldered onto the imp006 Breakout Board and continue to use the hardware. Your code will tell you what the function of the tail’s key pins are — just match them up to equivalent pins on the imp006.

For the generator restart, you’d code to connect first to WiFi and fail over to cellular. You’d also need some logic to periodically attempt to reconnect back to WiFi.

Thanks for the feedback.