[GH-ISSUE #1300] Hostname does not work #1116

Closed
opened 2026-02-28 01:28:35 +03:00 by kerem · 8 comments
Owner

Originally created by @VladimirVecera on GitHub (Oct 5, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1300

I'm trying to set a hostname, but it doesn't work. I still have esp32-987C40 on my wifi despite CTRL + F5.
What am I doing wrong?

wm.setHostname("WifiName");

ESP32 core 2.0.0
Version wifimanager: 2.0.4

Originally created by @VladimirVecera on GitHub (Oct 5, 2021). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1300 I'm trying to set a hostname, but it doesn't work. I still have esp32-987C40 on my wifi despite CTRL + F5. What am I doing wrong? `wm.setHostname("WifiName");` ESP32 core 2.0.0 Version wifimanager: 2.0.4
kerem 2026-02-28 01:28:35 +03:00
  • closed this issue
  • added the
    Question
    label
Author
Owner

@tablatronix commented on GitHub (Oct 5, 2021):

Which hostname are you looking at?

<!-- gh-comment-id:934809281 --> @tablatronix commented on GitHub (Oct 5, 2021): Which hostname are you looking at?
Author
Owner

@VladimirVecera commented on GitHub (Oct 5, 2021):

I want to have my own hostname, ie "WifiName", but the hostname cannot be set, wifimanager ignores the settings and if I look in the router, the name remains the same, ie esp32-987C40

<!-- gh-comment-id:934820407 --> @VladimirVecera commented on GitHub (Oct 5, 2021): I want to have my own hostname, ie "WifiName", but the hostname cannot be set, wifimanager ignores the settings and if I look in the router, the name remains the same, ie esp32-987C40
Author
Owner

@tablatronix commented on GitHub (Oct 5, 2021):

I mean there is like 3 hostnames, wifi, softap, mdns, what exactly are you looking at?

<!-- gh-comment-id:934823011 --> @tablatronix commented on GitHub (Oct 5, 2021): I mean there is like 3 hostnames, wifi, softap, mdns, what exactly are you looking at?
Author
Owner

@VladimirVecera commented on GitHub (Oct 5, 2021):

Wifi.

<!-- gh-comment-id:934824421 --> @VladimirVecera commented on GitHub (Oct 5, 2021): Wifi.
Author
Owner

@tablatronix commented on GitHub (Oct 6, 2021):

Its all wifi ...

Are you using autoconnect?

<!-- gh-comment-id:935108617 --> @tablatronix commented on GitHub (Oct 6, 2021): Its all wifi ... Are you using autoconnect?
Author
Owner

@tablatronix commented on GitHub (Oct 6, 2021):

Perhaps you are not calling autoconnect, either way mine works fine..

Screen Shot 2021-10-05 at 7 17 52 PM
Screen Shot 2021-10-05 at 7 19 29 PM
Screen Shot 2021-10-05 at 7 20 08 PM

<!-- gh-comment-id:935134543 --> @tablatronix commented on GitHub (Oct 6, 2021): Perhaps you are not calling autoconnect, either way mine works fine.. ![Screen Shot 2021-10-05 at 7 17 52 PM](https://user-images.githubusercontent.com/807787/136121373-7e89a353-2e22-4b61-8145-93f9672fee41.png) ![Screen Shot 2021-10-05 at 7 19 29 PM](https://user-images.githubusercontent.com/807787/136121376-248f38a0-9894-4197-9fd0-4facaae2be58.png) ![Screen Shot 2021-10-05 at 7 20 08 PM](https://user-images.githubusercontent.com/807787/136121382-e8b9852e-db02-423e-bcd0-a6c413f21c2d.png)
Author
Owner

@VladimirVecera commented on GitHub (Oct 6, 2021):

WiFiManager wm;
std::vector<const char *> menu = {"wifi","exit"}; // menu wifimanager 

   //wm.setCountry("US"); 
    wm.setHostname("WifiTest");
    wm.setConnectTimeout(60);
    wm.setTimeout(120);
    wm.setConfigPortalTimeout(120);
    wm.setMenu(menu);
    wm.setClass("invert"); // dark theme
    wm.setScanDispPerc(true); // display percentages instead of graphs for RSSI
    wm.setAPCallback(configModeCallback); // callbacks
    wm.setSaveConfigCallback(saveWifiCallback); // callbacks
    wm.setSaveParamsCallback(saveParamCallback); // callbacks
    wm.setBreakAfterConfig(true); // callbacks Wifi

    bool res;
    res = wm.autoConnect(ssid, password); // defaultni pripojeni do wifimanager ssid, password
    delay(300);
    Serial.println("--------------------------------------------");

And on my router is name esp32-987C40 and I wanted to WifiTest (setHostname)
router

<!-- gh-comment-id:935562820 --> @VladimirVecera commented on GitHub (Oct 6, 2021): ``` WiFiManager wm; std::vector<const char *> menu = {"wifi","exit"}; // menu wifimanager //wm.setCountry("US"); wm.setHostname("WifiTest"); wm.setConnectTimeout(60); wm.setTimeout(120); wm.setConfigPortalTimeout(120); wm.setMenu(menu); wm.setClass("invert"); // dark theme wm.setScanDispPerc(true); // display percentages instead of graphs for RSSI wm.setAPCallback(configModeCallback); // callbacks wm.setSaveConfigCallback(saveWifiCallback); // callbacks wm.setSaveParamsCallback(saveParamCallback); // callbacks wm.setBreakAfterConfig(true); // callbacks Wifi bool res; res = wm.autoConnect(ssid, password); // defaultni pripojeni do wifimanager ssid, password delay(300); Serial.println("--------------------------------------------"); ``` And on my router is name esp32-987C40 and I wanted to WifiTest (setHostname) ![router](https://user-images.githubusercontent.com/64955913/136151107-076e44d7-a743-4270-b146-01ac245a898f.png)
Author
Owner

@tablatronix commented on GitHub (Oct 6, 2021):

Interesting, perhaps its holding onto an old name? Can you ping the new hostname?

<!-- gh-comment-id:936662488 --> @tablatronix commented on GitHub (Oct 6, 2021): Interesting, perhaps its holding onto an old name? Can you ping the new hostname?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1116
No description provided.