make wifi interface a little more friendly
For #5 make wifi interface a little more friendly. * Add an index.html page to the SPIFFS tree * Add a favicon because browsers spam the network for it if they can't find one, and the ~2KB of storage is a small price to pay. * Add some more info to the info page which I have found useful.
This commit is contained in:
BIN
data/favicon.ico
Normal file
BIN
data/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
20
data/index.htm
Normal file
20
data/index.htm
Normal 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>
|
||||||
@@ -78,8 +78,10 @@ void handleUpdate( AsyncWebServerRequest *request, const String& filename, size_
|
|||||||
*/
|
*/
|
||||||
void asyncwebserver_setup(void){
|
void asyncwebserver_setup(void){
|
||||||
|
|
||||||
asyncserver.on("/info", HTTP_GET, [](AsyncWebServerRequest * request) {
|
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) {
|
asyncserver.on("/shot", HTTP_GET, [](AsyncWebServerRequest * request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user