diff --git a/platformio.ini b/platformio.ini index 04a3abf..18e12b5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -24,4 +24,5 @@ lib_deps = TTGO TWatch Library@>=1.2.0 ESP Async WebServer@>=1.2.0 AsyncTCP@>=1.1.1 - ArduinoJson@>=6.15.2 \ No newline at end of file + ArduinoJson@>=6.15.2 + ESP32SSPD@>=1.1.0 \ No newline at end of file diff --git a/src/app/weather/weather_forecast.cpp b/src/app/weather/weather_forecast.cpp index a5c8f02..0c220db 100644 --- a/src/app/weather/weather_forecast.cpp +++ b/src/app/weather/weather_forecast.cpp @@ -226,11 +226,7 @@ void weather_forecast_sync_Task( void * pvParameters ) { localtime_r( &now, &info ); strftime( buf, sizeof(buf), "updated: %d.%b %H:%M", &info ); lv_label_set_text( weather_forecast_update_label, buf ); - } - else { - char buf[64]; - snprintf( buf, sizeof(buf), "Error: %d", retval ); - lv_label_set_text( weather_forecast_update_label, buf ); + lv_obj_invalidate( lv_scr_act() ); } } } diff --git a/src/config.h b/src/config.h index 733d12f..901daa4 100644 --- a/src/config.h +++ b/src/config.h @@ -31,6 +31,6 @@ /* * firmeware version string */ - #define __FIRMWARE__ "2020080701" + #define __FIRMWARE__ "2020080702" #endif // _CONFIG_H diff --git a/src/hardware/wifictl.h b/src/hardware/wifictl.h index 018520d..c0cd58a 100644 --- a/src/hardware/wifictl.h +++ b/src/hardware/wifictl.h @@ -30,7 +30,7 @@ #define ESP_WPS_MODE WPS_TYPE_PBC #define ESP_MANUFACTURER "ESPRESSIF" #define ESP_MODEL_NUMBER "ESP32" - #define ESP_MODEL_NAME "ESPRESSIF IOT" + #define ESP_MODEL_NAME "LILYGO T-WATCH2020 V1" #define ESP_DEVICE_NAME "ESP STATION" struct networklist { diff --git a/src/webserver/webserver.cpp b/src/webserver/webserver.cpp index bac658f..a32f80b 100644 --- a/src/webserver/webserver.cpp +++ b/src/webserver/webserver.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "webserver.h" #include "config.h" @@ -168,5 +169,52 @@ void asyncwebserver_setup(void){ [](AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) { handleUpdate(request, filename, index, data, len, final); } ); + asyncserver.on("/description.xml", HTTP_GET, [](AsyncWebServerRequest *request) { + byte mac[6]; + WiFi.macAddress(mac); + char tmp[12 + 1]; + snprintf(tmp, sizeof(tmp), "%02X%02X%02X%02X%02X%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + String MacStrPart = String(tmp).substring(6); + + String xmltext = String("\n") + + "\n" + "\n" + "\t1\n" + "\t0\n" + "\n" + "http://" + WiFi.localIP().toString() + "/\n" + "\n" + "\tupnp:rootdevice\n" + + /*this is the icon name in Windows*/ + /*"\t" + WiFi.getHostname() + "\n"*/ + "\t" + DEV_NAME + " " + MacStrPart + "\n" /*because the hostename is 'Espressif' */ + + "\t/\n" + "\t" + "Dirk Broßwick (sharandac)" + "\n" + "\thttps://github.com/sharandac/My-TTGO-Watch\n" + "\t" + DEV_INFO + "\n" + + "\t" + WiFi.getHostname() + "\n" + "\t" + + "/" + "\n" + + "\tBuild: " + __FIRMWARE__ + "\n" + //The last six bytes of the UUID are the hardware address of the first Ethernet adapter in the system the UUID was generated on. + "\tuuid:38323636-4558-4DDA-9188-CDA0E6" + MacStrPart + "\n" + "\n" + "\r\n" + "\r\n"; + + request->send(200, "text/xml", xmltext); + }); + + //Upnp / SSDP presentation - Multicast - link to description.xml + SSDP.setSchemaURL("description.xml"); + SSDP.setHTTPPort( UPNPPORT ); + SSDP.setURL("/"); + SSDP.setDeviceType("upnp:rootdevice"); + SSDP.begin(); + asyncserver.begin(); } \ No newline at end of file diff --git a/src/webserver/webserver.h b/src/webserver/webserver.h index 3c92434..4e0c855 100644 --- a/src/webserver/webserver.h +++ b/src/webserver/webserver.h @@ -24,7 +24,11 @@ #define _ASYNCWEBSERVER_H - #define WEBSERVERPORT 80 + #define WEBSERVERPORT 80 + #define UPNPPORT 80 + + #define DEV_NAME "My-Watch" + #define DEV_INFO "Watch based on ESP32 from Espressif Systems" /* * @brief setup builtin webserver, call after first wifi-connection. otherwise esp32 will crash diff --git a/ttgo-t-watch2020_v1.ino.bin b/ttgo-t-watch2020_v1.ino.bin index 79e69e2..d9b71f1 100644 Binary files a/ttgo-t-watch2020_v1.ino.bin and b/ttgo-t-watch2020_v1.ino.bin differ diff --git a/ttgo-t-watch2020_v1.version.json b/ttgo-t-watch2020_v1.version.json index 50aa0cd..df38553 100644 --- a/ttgo-t-watch2020_v1.version.json +++ b/ttgo-t-watch2020_v1.version.json @@ -1 +1 @@ -{"version":"2020080701","host":"http://www.neo-guerillaz.de","file":"ttgo-t-watch2020_v1.ino.bin"} +{"version":"2020080702","host":"http://www.neo-guerillaz.de","file":"ttgo-t-watch2020_v1.ino.bin"}