From 4a67b9cc1ce774344886ceba0e836697878f8f0c Mon Sep 17 00:00:00 2001 From: RaffaelW Date: Mon, 4 Nov 2024 21:10:39 +0100 Subject: [PATCH] reset esp when config changes --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index e57c155..39356c7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -90,12 +90,15 @@ void setup() config.clear(); config.end(); // respond with default config - onGetConfig(config, request); }); + onGetConfig(config, request); + + ESP.restart(); }); server.onRequestBody([](AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) { if (request->url() == "/config" && request->method() == HTTP_PUT) { onPutConfig(request, data, len, index, total); + ESP.restart(); } }); delay(1000);