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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login