Not sure if there is a thread addressing this already, but I couldn’t find one, so decided to start my own. I want to push and hold a button to put the photon in listening mode, or safe mode or basically any other mode than plain running, in order to upload new firmware without access to the reset and mode buttons on the photon itself. Is this at all possible? Reason I ask is because the photon is going to be built into an enclosure or a box, but I still may need to change the firmware, or at least parts of it.
You can always use an IO pin, set it as an INPUT and whenever there’s a change, you will call System.enterSafeMode().
It can be made into a function as well so when you call the function, the device resets and enter safe mode. This does not require a button but having a physical button makes it (more) reliable and failsafe.
ok perfect, I see.
Also one advantage of the button is that it covers the case where the user changed their router’s ssid (or its credentials).
question: is there another way of addressing the scenario where a customer/user changes their router’s settings besides either dedicating a pin for this (as described in this thread now) or just telling the user/customer to open the enclosure and hitting the mode/reset buttons?
(sorry @batmanish hope I’m not hijacking your thread)
Another way might be to have the device expose a softAP that the user can connect to and set the new WiFI credentials via WiFi. Some great work has been done to make this possible in firmware v0.5.0 but still requires some user side coding to get this working.
I see some pros and cons with this approach of not using a button. Having a user button reduces any second guessing when the device stops connecting to wifi and the customer forgets that there’s a softAP exposed for updating settings. It is more likely that they go, why isn’t it working compared to them explicitly hitting a button to show intent of updating wifi credentials.