From 96a577f0a2fb7c6715f3874034fcef08dba26d88 Mon Sep 17 00:00:00 2001 From: Rene Zeldenthuis Date: Sat, 7 Oct 2023 21:25:07 +0200 Subject: [PATCH] - Fixed const for moustache - Added unique MAC to SSID --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8433f3e..33cde91 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -36,7 +36,8 @@ auto tft = TFT_eSPI(TFT_WIDTH, TFT_HEIGHT); // 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("flightradar", "Flight radar"); auto iotWebParamLocation = iotwebconf::Builder>("location").label("Location").defaultValue(DEFAULT_LOCATION).build(); @@ -146,7 +147,7 @@ void handleRoot() auto latRange = String(iotWebParamLatitudeRange.value()) + "° (" + (iotWebParamMetric.value() ? String(iotWebParamLatitudeRange.value() * DEGREES_TO_KM) + " km" : String(iotWebParamLatitudeRange.value() * DEGREES_TO_MI) + " mi") + ")"; auto lonRange = String(iotWebParamLongitudeRange.value()) + "° (" + (iotWebParamMetric.value() ? String(iotWebParamLongitudeRange.value() * DEGREES_TO_KM) + " km" : String(iotWebParamLongitudeRange.value() * DEGREES_TO_MI) + " mi") + ")"; - const moustache_variable_t substitutions[] = { + moustache_variable_t substitutions[] = { // Version / CPU {"AppTitle", APP_TITLE}, {"AppVersion", APP_VERSION},