ESP factory reset clear NVS too

This commit is contained in:
liquidraver committed 2026-01-02 08:37:22 +01:00
1 parent 8797ec97c6
commit c2d1d02b8e
2 files changed
+8 -1

No files matched your search

+4
View File
@@ -1613,6 +1613,10 @@ void MyMesh::handleCmdFrame(size_t len) {
writeErrFrame(ERR_CODE_ILLEGAL_ARG); // invalid stats sub-type
}
} else if (cmd_frame[0] == CMD_FACTORY_RESET && memcmp(&cmd_frame[1], "reset", 5) == 0) {
if (_serial) {
MESH_DEBUG_PRINTLN("Factory reset: disabling serial interface to prevent reconnects (BLE/WiFi)");
_serial->disable(); // Phone app disconnects before we can send OK frame so it's safe here
}
bool success = _store->formatFileSystem();
if (success) {
writeOKFrame();