Skip to content

Commit

Permalink
Fix Restart ESP32 from preferences web page. Change HTTP method from …
Browse files Browse the repository at this point in the history
…POST to GET in restart request
  • Loading branch information
melkati committed Mar 12, 2024
1 parent 2dd7700 commit 82d3df3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions data/preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,10 @@ <h1>CO2 Gadget Preferences</h1>
if (isConfirmed) {
// Send a request to the ESP32 endpoint to trigger a reset
fetch('/restart', {
method: 'POST',
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ reset: true }),
'Content-Type': 'text/plain'
}
})
.then(response => {
if (!response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ build_flags =

-D MQTT_BROKER_SERVER="\"192.168.1.145"\"
-D CO2_GADGET_VERSION="\"0.12."\"
-D CO2_GADGET_REV="\"007"\"
-D CO2_GADGET_REV="\"008"\"
-D CORE_DEBUG_LEVEL=0
-DCACHE_DIR=".pio/build"
-DBUZZER_PIN=2 ; ESP32 pin GPIO13 connected to piezo buzzer
Expand Down

0 comments on commit 82d3df3

Please sign in to comment.