Merge pull request #21 from bwagstaff/5-Enable-wifi-file-interface

make wifi interface a little more friendly
This commit is contained in:
Dirk Broßwick
2020-08-07 09:24:33 +02:00
committed by GitHub
3 changed files with 24 additions and 2 deletions

BIN
data/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

20
data/index.htm Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Web Interface</title>
</head>
<body>
<h1>TTGo Watch Web Server</h1>
<p>This is your device, program it as you see fit.
<p>Here are some URLs the device already supports, which you might find helpful:
<ul><li><a href="/info">/info</a> - Display info about the device
<li><a href="/shot">/shot</a> - Capture a screen shot
<li><a href="/screen.565">/screen.565</a> - Retrieve the image in RGB565 format
<li><a href="/edit">/edit</a> - View, edit, upload, and delete files
</ul>
<p><div style="color:red;">Caution:</div> Use these with care:
<ul><li><a href="/reset">/reset</a> Reboot the device
<li><a href="/update">/update</a> Transmit a firmware update through POST request
</body>
</html>

View File

@@ -79,7 +79,9 @@ void handleUpdate( AsyncWebServerRequest *request, const String& filename, size_
void asyncwebserver_setup(void){
asyncserver.on("/info", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(200, "text/plain", "Firmwarestand: " __DATE__ " " __TIME__ "\r\nGCC-Version: " __VERSION__ "\r\n" );
String message("Firmwarestand: " __DATE__ " " __TIME__ "\nGCC-Version: " __VERSION__ "\n");
message = message + "Heap: " + ESP.getFreeHeap() + " bytes used of " + ESP.getHeapSize() + " bytes total\nHeap low water mark: " + ESP.getMinFreeHeap() + " bytes available\nPsram: " + ESP.getFreePsram() + " bytes used of " + ESP.getPsramSize() + " bytes available\nCurrent battery voltage: " + TTGOClass::getWatch()->power->getBattVoltage() / 1000 + " Volts";
request->send(200, "text/plain", message.c_str());
});
asyncserver.on("/shot", HTTP_GET, [](AsyncWebServerRequest * request) {