Skip to content

Commit

Permalink
esp32 deep sleep support
Browse files Browse the repository at this point in the history
  • Loading branch information
jjwbruijn committed Aug 10, 2023
1 parent 9dfb37b commit 0cbb9e7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 1 deletion.
Binary file modified ESP32_AP-Flasher/data/www/content_cards.json.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/index.html.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/main.js.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions ESP32_AP-Flasher/src/web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ void init_web() {
if (strcmp(cmdValue, "reset") == 0) {
sendTagCommand(mac, CMD_DO_RESET_SETTINGS, !taginfo->isExternal);
}
if (strcmp(cmdValue, "deepsleep") == 0) {
sendTagCommand(mac, CMD_DO_DEEPSLEEP, !taginfo->isExternal);
}
request->send(200, "text/plain", "Ok, done");
} else {
request->send(200, "text/plain", "Error: mac not found");
Expand Down
4 changes: 3 additions & 1 deletion ESP32_AP-Flasher/wwwroot/content_cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,9 @@
"options": {
"0": "Reboot",
"1": "Scan Channels",
"2": "Clear settings"
"2": "Clear settings",
"3": "Enter Deep Sleep"

}
}
]
Expand Down
1 change: 1 addition & 0 deletions ESP32_AP-Flasher/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ <h3 id="cfgmac">00000000</h3>
<button id="cfgclrpending">clear pending</button>
<button id="cfgtagreboot">reboot</button>
<button id="cfgscan">scan</button>
<button id="cfgdeepsleep">deep sleep</button>
<button id="cfgreset">reset settings</button>
<button id="cfgdelete" title="remove"><img src="data:image/gif;base64,R0lGODlhEAAQAPMAANXV1e3t7d/f39HR0dvb2/Hx8dTU1OLi4urq6mZmZpmZmf///wAAAAAAAAAAAAAAACH5BAEAAAwALAAAAAAQABAAAARBkMlJq71Yrp3ZXkr4WWCYnOZSgQVyEMYwJCq1nHhe20qgCAoA7QLyAYU7njE4JPV+zOSkCEUSFbmTVPPpbjvgTAQAOw== "></button>
</p>
Expand Down
4 changes: 4 additions & 0 deletions ESP32_AP-Flasher/wwwroot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,10 @@ $('#cfgscan').onclick = function () {
sendCmd($('#cfgmac').dataset.mac, "scan");
}

$('#cfgdeepsleep').onclick = function () {
sendCmd($('#cfgmac').dataset.mac, "deepsleep");
}

$('#cfgreset').onclick = function () {
sendCmd($('#cfgmac').dataset.mac, "reset");
}
Expand Down

0 comments on commit 0cbb9e7

Please sign in to comment.