diff --git a/WifiControlSensor/WebServer.ino b/WifiControlSensor/WebServer.ino index 8b9301b..1068291 100644 --- a/WifiControlSensor/WebServer.ino +++ b/WifiControlSensor/WebServer.ino @@ -1,7 +1,7 @@ void WebHandleRoot() { server.send(200, "text/html", "" - "

You are connected


" + "

You are connected on " + String(hostName) +"


" "Current temperature " + String(temp, 2) + "C
" "Current pressure " + String(pressure, 2) + "mB
" "MQTT Status: " + (MqttIsConnected() ? "Connected" : "Disconnected") + "
" diff --git a/WifiControlSensor/WifiControlSensor.ino b/WifiControlSensor/WifiControlSensor.ino index 9714731..bc9ef1d 100644 --- a/WifiControlSensor/WifiControlSensor.ino +++ b/WifiControlSensor/WifiControlSensor.ino @@ -44,6 +44,7 @@ char eeprom[EEPROM_SIZE]; double temp, pressure; uint8_t mode; +char *hostName = ""; /* Set these to your desired credentials. */ const char *ssid = "ESPConfigurator"; @@ -174,6 +175,8 @@ void setup() { EEPROM.begin(EEPROM_SIZE); EepromReadConfig(mode, &confSsid, &confPassword, &confHost, &mqttServer, &mqttUser, &mqttPasswd, mqttPort); + + hostName = confHost; if (mode == BOOTMODE_NORMAL || mode == BOOTMODE_OTA) { Serial.println("Configuration Found !:"); Serial.println(mode);