mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* ESP32Board: can now download entire log file via OTA webserver (URL: /log)
This commit is contained in:
parent
810fc8b8f0
commit
d8952f3710
1 changed files with 5 additions and 0 deletions
|
|
@ -8,6 +8,8 @@
|
||||||
#include <ESPAsyncWebServer.h>
|
#include <ESPAsyncWebServer.h>
|
||||||
#include <AsyncElegantOTA.h>
|
#include <AsyncElegantOTA.h>
|
||||||
|
|
||||||
|
#include <SPIFFS.h>
|
||||||
|
|
||||||
bool ESP32Board::startOTAUpdate(const char* id, char reply[]) {
|
bool ESP32Board::startOTAUpdate(const char* id, char reply[]) {
|
||||||
WiFi.softAP("MeshCore-OTA", NULL);
|
WiFi.softAP("MeshCore-OTA", NULL);
|
||||||
|
|
||||||
|
|
@ -24,6 +26,9 @@ bool ESP32Board::startOTAUpdate(const char* id, char reply[]) {
|
||||||
server->on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
|
server->on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||||
request->send(200, "text/html", home_buf);
|
request->send(200, "text/html", home_buf);
|
||||||
});
|
});
|
||||||
|
server->on("/log", HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||||
|
request->send(SPIFFS, "/packet_log", "text/plain");
|
||||||
|
});
|
||||||
|
|
||||||
AsyncElegantOTA.setID(id_buf);
|
AsyncElegantOTA.setID(id_buf);
|
||||||
AsyncElegantOTA.begin(server); // Start ElegantOTA
|
AsyncElegantOTA.begin(server); // Start ElegantOTA
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue