Hi
I’m trying to solve an issue that I have for the last few weeks. But without any success!
Sometimes, my Photon is completely blocked and the light color is cyan fixed.
I found some blogs online that recommends to restart the board to avoid this kind of issue. So, I’m resetting the board every 6h:
// Reset the system after 6 hours
if (millis() > 6 * 60 * 60 * 1000) {
System.reset();
Serial.println("!!!Resetting!!!");
}
I don’t believe that it comes from my code, because the same code was working on Arduino Uno without any issue. Now, on Photon, it runs a maximum of 48hours, and then stops.
It maybe related to my Wifi network that stops working sometimes.
To explain it simply, I have 4 sensors connected to my board: temperature (dht22), gas sensor (mq2), microphone and a photoresistor. I read the values every minute and I send a POST request to one of my servers.
I would say something in your user code might cause the issue. @bko would say maybe your DHCP lease on your router expires after 24 hours, causing the issue.
I have a DHT22 + oled photon sitting on my desk to tell me the ambient temperature and publishes every 1 minutes. It has been running for almost a month now without any hiccup
You will have to investigate your router’s settings to change the lease time or assign a “static dynamic” address to your device for that problem. I know in my case, my devices all disconnect from the cloud for approximately 1 minute every 24 hours, but they reconnect just fine.
I am glad that @kennethlimcp pointed you to his code, since that is the best example we have!