[SOLVED] Photon light stucked on fixed cyan

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) {

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.

Any idea how I could solve my issue?


What are you running on your photon?

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

I think this is the biggest factor. Are you running in manual mode with full control over the WiFi and Cloud connections?

Maybe post your code.

another thing that comes to mind is reliance on String Class…

1 Like

@bko, yes, I’m running in manual mode. Do you have an idea how to solve this DHCP lease issue?

I can simplify my code, and just use my “ping” action to validate the behavior.

I use this: https://github.com/kennethlimcp/particle-examples/blob/master/wifi-auto-reconnect/wifi-auto-reconnect.ino

without having to reset the system…

Hi @bchevallereau

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!

Thanks a lot for all these information! I’ll try to follow the same code as Wifi Auto Reconnect! And I’ll let you know in few days if it worked!

After 6 days, it’s still working. So, I guess that the issue is fixed.
Thanks a lot for your help!