WiFi.setHostname("Name"); not working (Core Basic)
-
I don't get an error message from the compiler, but the new name doesn't appear in the router
WiFi.mode(WIFI_STA);
WiFi.disconnect(); //Turn off all wifi connections.
delay(100);
WiFi.setHostname("M5StackCoreZaehler");
WiFi.begin(ssid, password);
M5.Lcd.print("Call to " + String(ssid));
while (WiFi.status() != WL_CONNECTED) {
M5.Lcd.print('.');
delay(1000);
}
M5.Lcd.println(" ");
M5.Lcd.println(WiFi.localIP());
M5.Lcd.print("Signalstearke: ");
M5.Lcd.println(WiFi.RSSI());
server.begin();
delay(4000);
M5.Lcd.clear(); -
-
Unfortunately this doesn't work for me. I am doing something wrong?
......
String hostname = "newName";
......void initWiFi() {
WiFi.mode(WIFI_STA);
//WiFi.disconnect(); //Turn off all wifi connections.
//delay(100);
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE);
WiFi.setHostname(hostname.c_str()); //define hostname (wifi.config muss davor stehen
WiFi.begin(ssid, password);
M5.Lcd.print("Call to " + String(ssid));
while (WiFi.status() != WL_CONNECTED) {
M5.Lcd.print('.');
delay(1000);
}
M5.Lcd.println(" ");
M5.Lcd.println(WiFi.localIP());
M5.Lcd.print("Signalstearke: ");
M5.Lcd.println(WiFi.RSSI());
server.begin();
delay(4000);
M5.Lcd.clear();
} -
Hello @Stoni99
have you tried to reboot your router? From above linked article:
Important: you may need to restart your router for the changes to take effect.
Thanks
Felix -
Unfortunately, a restart doesn't help either. maybe it's because of my older router.