Setting unique hostname with chipID

This commit is contained in:
Sébastien Vallée 2017-12-26 07:26:17 +01:00
parent 3ba1dad518
commit 709706c2d1

View File

@ -17,6 +17,7 @@
#include "d_helper.h" #include "d_helper.h"
#include "FS.h" #include "FS.h"
#define HOSTNAME "LibreMetric-"
//################# DISPLAY CONNECTIONS ################ //################# DISPLAY CONNECTIONS ################
// LED Matrix Pin -> ESP8266 Pin // LED Matrix Pin -> ESP8266 Pin
@ -66,10 +67,11 @@ void setup() {
} }
display_message("Wi-Fi"); display_message("Wi-Fi");
WiFiManager wifiManager; WiFiManager wifiManager;
// reset saved settings String hostname(HOSTNAME);
// wifiManager.resetSettings(); hostname += String(ESP.getChipId(), HEX);
WiFi.hostname(hostname);
if (!MDNS.begin("ESP8266")) { if (!MDNS.begin("ESP8266")) {
DEBUG_PRINTLN("Error setting up MDNS responder!"); DEBUG_PRINTLN("Error setting up MDNS responder!");
while(1) { while(1) {