Reset OMG devices

Is it somehow possibe to reset OMG device. Maybe over MQTT or by adding a reset button?

Do you refer beside pressing the physical button the boards (various ESP8266/Arduino flavors) usually have?

If wanting to reset an unresponsive board then you have basically two options:

  • add software instructions to reboot the board case it is not reachable (ie. by periodically testing MQTT broker connection); but if the required process for monitoring crashed too, it won’t be able to reboot;
  • restart the external power source (ie. by using a smart plug); this one will require external intervention (something like: HA monitors the LWT topic for the board and then turns the smart plug off and on again); I use something like this with ESP32 for MiFlora monitoring as I cannot get the damn board to stay online for more than several hours a day (in fact the issue is probably in the firmware not middleware like OMG as none of the other projects I tried with can keep it working for more than several days; once the board losses Wifi connection, it is able to reconnect the first 2 - 3 times for about 2-3 hours, however subsequent tries end up in failure); by restarting the 220 V plug the ESP32 comes online again.

Sry, I wasn’t concrete enough. I didn’t meant to simple restart the device.

I meant reseting to defaults. So deleting wifi and mqtt settings.

very interesting. See my other thread here. So I’m not alone. Could you join the conversation over there?

I see.

MQTT settings get reset each time a new sketch is uploaded; however, for Wifi settings I think that “Erase flash -> All flash contents” option in Arduino IDE Tools needs to be selected when uploading a new sketch as the credentials are written in a protected area (to allow the board connect to same Wifi even after uploading a different sketch). I cannot advise on settings. Maybe @1technophile can update on this.

I kind of gave up on the goal to have the MiFlora readings online all the time. It is sufficient that it reads the settings several times per day (and then HA issues a restart for the plug) as I’m no horticulturist :smile:

@1technophile it would be great being able to rest the device to factory defaults somehow.

When we first set up the device with WiFi Manager there is an option to erase WiFi settings.
Would it be possible to add this somehow in a already configured device (maybe with publishing a message in a certain „reset2factory“ topic.