Factory-reset a device


Following tutorials for arduino on ESP32. (Arduino 1.8.9)

  1. Ran the Shadow.ino example and it worked after some tweaks (had to use WiFiMulti.addAP() and WiFiMulti.run() since mdash library times out).
  2. I assume credentials are now stored in mdash.cfg.since I entered them via the CLI
  3. I now try to run the SmartLight example. Since the credentials are found in mdash.cfg, the ESP32 will not start up as an AP
  4. In the documentation, it states: “In order to factory-reset a device, the WiFi credentials should be deleted from the mdash.cfg . More on that below.”
  5. Nothing is found “below” int he tutorial
  6. What is your recommended procedure for “factory-resetting” a device?

In a firmware code, call mDashConfigSet("wifi.sta.ssid", NULL) - this should delete the wifi network name setting from mdash.cfg.
For example, it’d make sense to call this function on a long button press. Thus, pressing and holding a button for X seconds, resets a device.