I have an application running on Photon but sometimes the WiFi is bad and is interrupted for a short while. In the application I detect if the device is connected, and if not I generate a system.reset() and I expected the device to reconnect and smoothly run the application again, similar to when I would push the reset button on the device. This obviously is not the case.
Is there a fundamental difference between pushing the reset button or applying a system.reset in the application software.
Is this a Photon 1 or Photon 2? Which Device OS version?
The device should reconnect automatically without restart. However it is possible that a restart will be required in some cases. Almost always System.reset is sufficient. Sometimes going into hibernate sleep for 30 seconds is better than just resetting on the Photon 1.
Is the device actually resetting and just not reconnecting? Or is it not resetting?
I would try the sleep technique after failure to connect for a few minutes. I have a lot of Photon 1 devices monitoring my house and since I switched to doing that I rarely have to physically reset devices.
Instead of doing System.reset() do System.sleep(SLEEP_MODE_DEEP, 30).
I don't know why this seems to help, but it essentially powers everything down instead of using the reset vector, so it's plausible that it could work slightly differently.