I have a product that is using the Photon for connecting it to WiFi. The firmware is also programmed to light 8 LEDs. I do not want to give consumers access to uploading/changing firmware – just simply plug in the product, set it up using the app to their home WiFi, and that’s it. They should have the ability to change their WiFi network at any point by using the “setup” button, but is there any reason I should expose the “reset” button to them?
You could just have them unplug the unit, should do the same thing. Holding setup while powering it up is what allows you to cycle through the modes.
@Moors7 So the WiFi credentials / connection doesn’t persist when unplugged and plugged back in? The firmware is persistent (setup & loop will run), but the connection isn’t?
If that’s the case, I don’t need to expose any of the buttons, and just instruct users to unplug & plug it back in if WiFi credentials need to be changed?
I see that my explanation was a bit confusing. My comment was regarding whether or not you needed to expose the RESET button. That you don’t, since unplugging is effectively resetting it. The mode button is still necessary for cycling through the modes.
Credentials are persisted through power cycles and shouldn’t disappear until you tell them so. You can do that in code, but also by holding the SETUP button until the LED blinks blue rapidly.
Is that any clearer?
Thanks much clearer! Does the custom app allow you to change networks? I’m basically trying to find the simplest approach in terms of what I expose on the hardware, so if I didn’t have to expose either SETUP or RESET that would be great.
Can you elaborate on this?
That you don’t, since unplugging is effectively resetting it.
I were to unplug, and plug back in the device, what gets reset exactly?
How familiar are you with computers?
When you reset or power-cycle a computer all volatile data gets lost, all persisted data stays (ROM, HDD, SSD, DVD, …)
A micro controler is not much different there. Everything that’s only present in RAM, system registers and such volatile areas gets lost, data in flash (e.g. WiFi credentials and your application firmware) will survive.
As for system maintainability I’d definetly suggest you “expose” the SETUP button.
It doesn’t need to be really exterior, you could use something like a pinhole.
Thanks @ScruffR, that’s what I thought just wanted to be crystal clear!
So I will plan on just exposing the SETUP button and the status LED to consumers (not the RESET, as I don’t want to give them ability to wipe application firmware), through a recessed, small hole that a paper clip (or something of the like) can poke through.
RESET has nothing to do with wiping the firmware.
As @Moors7 said if you push RESET or power-cycle it’s basically just the same.
And on the Photon (I think) you can’t just wipe the application firmware as you did with a Factory Reset on the Core.
Using the RESET button on a Photon:
A factory reset restores the firmware on the device to the default Tinker app and clears all your Wi-Fi credentials.
A “RESET” (tapping the button with that name) and a “Factory Reset” are two completely different kettle of fish.
And the Factory Reset does also not work as described in your quote on the Photon
The correct quote would be from here
(If you look back on your link you’ll see it’s for the Core not Photon)
Ah!!! I was looking at the Core docs this whole time, thanks for clarifying. Wasn’t totally clear, especially when it says this at the top of the page:
Now that we’ve gone over connecting your device, we’re going to review the different modes for your Core or Photon
Thank you, all makes sense now.