diff --git a/Software/USER_SETTINGS.cpp b/Software/USER_SETTINGS.cpp index 7ddeb02c..d0b9c028 100644 --- a/Software/USER_SETTINGS.cpp +++ b/Software/USER_SETTINGS.cpp @@ -26,6 +26,7 @@ std::string password = WIFI_PASSWORD; // Set in USER_SECRETS.h const char* ssidAP = "Battery Emulator"; // Maximum of 63 characters, also used for device name on web interface const char* passwordAP = AP_PASSWORD; // Set in USER_SECRETS.h const uint8_t wifi_channel = 0; // Set to 0 for automatic channel selection +const char* hostname = "battery-emulator"; // Hostname for the device, needs to be enabled in USER_SETTINGS.h #ifdef WEBSERVER const char* http_username = HTTP_USERNAME; // Set in USER_SECRETS.h diff --git a/Software/USER_SETTINGS.h b/Software/USER_SETTINGS.h index b888f4b8..c2141747 100644 --- a/Software/USER_SETTINGS.h +++ b/Software/USER_SETTINGS.h @@ -118,6 +118,7 @@ /* Connectivity options */ #define WIFI //#define WIFICONFIG //Enable this line to set a static IP address / gateway /subnet mask for the device. see USER_SETTINGS.cpp for the settings +//#define HOSTNAME //Enable this line to use a custom hostname for the device, hostname is set in USER_SETTINGS.cpp #define WEBSERVER //Enable this line to enable WiFi, and to run the webserver. See USER_SETTINGS.cpp for the Wifi settings. #define WIFIAP //When enabled, the emulator will broadcast its own access point Wifi. Can be used at the same time as a normal Wifi connection to a router. #define MDNSRESPONDER //Enable this line to enable MDNS, allows battery monitor te be found by .local address. Requires WEBSERVER to be enabled. diff --git a/Software/src/devboard/webserver/webserver.cpp b/Software/src/devboard/webserver/webserver.cpp index 09b6db98..0e3517b6 100644 --- a/Software/src/devboard/webserver/webserver.cpp +++ b/Software/src/devboard/webserver/webserver.cpp @@ -1008,6 +1008,7 @@ String processor(const String& var) { } content += ""; if (status == WL_CONNECTED) { + content += "