One of my photons is intermittently losing wifi/cloud connection, going from breathing cyan to solid.
After about 30 minutes of data not being received from my photon I get an alert at which time I go outside to unplug it and plug it back in. It reestablishes just fine then a day or two later needs cycling.
Could I test connection in code and kick off a system reset when it loses cloud connection? Like this…
if (Particle.connected()=="false") {
System.reset();
}
I’m guessing that it is losing Wifi because it’s on the edge of my wifi range.
Thank you for the suggestion. Is your approach easier on the Photon than doing a system reset? I’d just like to learn why one method is preferred. Thanks again!
You won’t get to reset the Photon physically in a remote location ya
I use it on my devices to ensure they always get on Wifi and soft reset the wifi module if it doesn’t after some time. With this, I am certain my device is constantly trying to get connected and any failure to do so is most probably related to a broken router or there’s no internet connection.
@kennethlimcp, I'm totally following you on the need to reset via code, but I was proposing this code solution. Would love to know the difference between the two approaches.
My device continue to process and run task while attempting to connect to Wifi periodically.
For a system reset, your device will reboot and start as though it just power up. There are cases that you would not want to do that. eg. while running a motor halfway.
Kenneth, Thank you very much for the explanation. That makes complete sense. Appreciate you taking the time to educate. My loop puts the Photon into Deep Sleep so I needed to add Wifi connect and Particle.Connect into setup. With that minor mod your code is working great.
– I lose connection from time to time as well. Goes from Breathing Cyan to Flashing green. Most times, its able to connect back to the Particle Cloud but what are the reasons it loses connection in the first place?
– How long does the Photon try the Wifi Connection before it resets the Wifi Module again to retry?
– What is the average time it has taken to connect to the Particle cloud based on the data from testing?
I have two Photons that go from breathing cyan to rapidly blinking green, or solid green. A reset or power cycle brings them right back and connected. They have been doing this since I first deployed them. I am hoping that newer firmware due soon will fix this very annoying issue. Sorry I can’t offer a solution, but thought you would want to know you aren’t alone.
There are several possible reasons.
If this happens rather often it's usually related to application code blocking for 10+ seconds starving the cloud houskeeping tasks.
If it's regularely with hours in between, it could be your routers IP lease time running out causing a release.
If it's sporadic an irregular it might be noisy WiFi neighbourhood, noisy power supply, or several other reasons.