Photon response to a Low WiFi signal

I have configured my device with SYSTEM_THREAD(ENABLED); and left it in the default AUTOMATIC state, I think this is the simplest way of making sure my device functions regardless of a cloud connection and to make sure it behaves I also use if (Particle.connected) before any Particle functions to make sure I don’t jam the system up attempting a Particle connection that is not possible.

I walked my unit of of range today and then as it located located a weak trace of the WiFi AP again the unit attempted to reconnect. However for whatever reason this signal was apparently too weak to properly negotiate with the cloud so I had a rapidly flashing cyan led and my code wasn’t running. I moved the unit back to where a strong signal would exist (right next to the router) but the Photon remained stuck in this rapidly flashing cyan mode. I had to reset it to restore function, this is quite difficult to replicate but I’m pretty sure weak signal was at the root of it.

So the question is how do I best handle that potential fringe case where the unit gets located in an area of very weak just about WiFi signal and ensure my code stays running?

What type of WiFi antenna are you using to communicate with your AP ?

This uses the onboard one currently

That’s your problem.
The internal antenna is good for development and some short distance application, but as soon as you exceed that range, an external antenna is necessary.
It’s cheap and very easy to use.
You also need a good antenna on your WiFi access point gateway.

I would say it should gracefully reconnect once he got closer to the strong signal again regardless of using the chip antenna or an external antenna.

How long did you wait once you got closer to the router and had the good signal before you reset the Photon? If you wait long enough it will auto reset and try to reconnect again if I remember correctly.
My guess is that you did not wait it out for a reset to happen.

I know this connection reset happens with the Electron if it does not connect in a certain amount of time.

@ScruffR What do you know about the Photons Wifi connection process timing out and starting over again?

It should try to auto-reconnect, but this process depends on the number of stored credentials (needs to check a while for each set) and the code running (e.g. manual calls to WiFi.connect() - and other instructions - will interfere).

1 Like

One thing I noticed slow down the reconnect process, is the default AUTO mode setup on the antenna. It tends to try both internal and external. I believe it recalls the last successful mode though, but that’s pure speculation from my side.

What I do, is lock the antenna mode to the proper selection: internal or external so to reduce the sequence.

As for my reference to using an external antenna was just to reduce the time it takes to reconnect. The on-board antenna is not very powerful, very sensitive to noises and external electromagnetic shields.
The use of an external antenna tends to considerably reduce these effects and speeds up the reconnect process. That’s at least my observation, at least for indoor deployment where typical WiFi coverage is terrible.

About 10 minutes....