openeew / openeew-firmware

Firmware for an OpenEEW sensor.
Apache License 2.0
8 stars 8 forks source link

Create a MQTT topic to "reset to factory defaults" #12

Closed johnwalicki closed 3 years ago

johnwalicki commented 3 years ago

The dashboard will implement a "Remove your sensor from the OpenEEW network" button. It promises that your sensor will no longer contribute data.

johnwalicki commented 3 years ago

Todos:

johnwalicki commented 3 years ago

The topic will be iot-2/cmd/factoryreset/fmt/json There will be no stringified json key/value pair passed as part of this topic. {}

johnwalicki commented 3 years ago

Once the device is in SmartConfig Provisioning mode, the mobile app can be used to connect it to a different WiFi network and register it again (potentially under a different email address / user)

johnwalicki commented 3 years ago

In addition to clearing the NVM of WiFi networks, a Factory Reset implies a restart. The device will clear NVM, restart, boot to SmartConfig.

johnwalicki commented 3 years ago
Message arrived [iot-2/cmd/factoryreset/fmt/json] : {}
Remote message received to factory reset the device.
Clear all stored networks from NVM
All networks have been erased
Restarting Device...
WiFi Stopped
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8

OpenEEW Sensor Application
ESP32 WiFi interface ready
Stored networks : 0
ESP32 WiFi started
Completed scan for access points
WiFi Network scan done
5 network(s) found
1: ssidlisthere
ESP32 WiFi interface ready
Found no matches for saved networks
ESP32 WiFi interface ready
ESP32 WiFi started
WiFi Stopped
Waiting for SmartConfig.
johnwalicki commented 3 years ago

This issue will be closed by https://github.com/openeew/openeew-firmware/commit/0d4e200078b28b9a8e727cee42526c12327be16a

neilh10 commented 3 years ago

Thats excellent addition.