From e058b693822cac52db35703c5a148a9170f4b4fa Mon Sep 17 00:00:00 2001 From: Rene Zeldenthuis Date: Sat, 7 Oct 2023 21:54:58 +0200 Subject: [PATCH] - Removed code for buttons - Added unique ID in SSID --- platformio.ini | 7 +++---- src/main.cpp | 8 ++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/platformio.ini b/platformio.ini index 74eb4fc..19d66f6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -50,11 +50,10 @@ build_flags = lib_deps = # Using a library name - bodmer/TFT_eSPI @ ^2.4.75 - bblanchon/ArduinoJson @ ^6.19.4 - lennarthennigs/Button2 @ ^2.0.3 + bodmer/TFT_eSPI @ ^2.5.31 + bblanchon/ArduinoJson @ ^6.21.3 prampec/IotWebConf @ ^3.2.1 - rzeldent/micro-http-status @ ^1.0.1 + rzeldent/micro-http-status @ ^1.0.2 rzeldent/micro-miniz @ ^1.0.0 rzeldent/micro-moustache @ ^1.0.0 rzeldent/micro-timezonedb @ ^1.0.2 \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 6ac66ae..2e4c0fc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,8 +7,6 @@ // Setting for the display are defined in platformio.ini #include -#include - #include #include #include @@ -43,13 +41,11 @@ constexpr auto font_48pt = 6; // Font 6. Large 48 pixel font, needs ~2666 bytes auto tft = TFT_eSPI(TFT_WIDTH, TFT_HEIGHT); auto clock_sprite = TFT_eSprite(&tft); -Button2 button1(GPIO_BUTTON_TOP); -Button2 button2(GPIO_BUTTON_BOTTOM); - // Web server DNSServer dnsServer; WebServer server(80); -IotWebConf iotWebConf(WIFI_SSID, &dnsServer, &server, WIFI_PASSWORD, CONFIG_VERSION); +auto deviceName = String(WIFI_SSID) + "-" + String(ESP.getEfuseMac(), 16); +IotWebConf iotWebConf(deviceName.c_str(), &dnsServer, &server, WIFI_PASSWORD, CONFIG_VERSION); auto param_group = iotwebconf::ParameterGroup("openweather", "Open Weather"); auto iotWebParamOpenWeatherApiKey = iotwebconf::Builder>("apikey").label("Open Weather API key").defaultValue(DEFAULT_OPENWEATHER_API_KEY).build();