mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #578] Webconfiguration - HOSTNAME - new feature request #481
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#481
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sorriso93 on GitHub (Mar 28, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/578
Basic Infos
NEW FEATURE REQUEST
Hello in addition to webserver ip address & MQTT configuration it would be useful to add hostname, also to be saved as persistent information together with remaining network configuration
@tablatronix commented on GitHub (Mar 28, 2018):
You can implement this now in development branch using
custom parameters, spiffs, and WiFiManager.setHostname()
@sorriso93 commented on GitHub (Mar 29, 2018):
Thanks, I will try but I don't think to be capable of such implementation... Anyway, can you point me to similar addition, if any available on examples or dev branches?
Thank you in advance
@tablatronix commented on GitHub (Mar 29, 2018):
The fsparameters examples are pretty much already there
@sorriso93 commented on GitHub (Apr 5, 2018):
Many thanks, copied each occurence of mqtt_server and added the same row with new string variable host_name.
Before starting WiFiManager in the example, I added:
wifi_station_set_hostname (host_name);
WiFi.hostname(host_name);
Then, important to have the host name set, in the initial section of the sketch
extern "C" { // needed to set hostname
#include "user_interface.h"
}
@tablatronix commented on GitHub (Apr 5, 2018):
hostname is already included in wifimanager as I mentioned above.
@sorriso93 commented on GitHub (Apr 5, 2018):
Using the WiFiManager.setHostname didn't get any change on hostname...
@tablatronix commented on GitHub (Apr 5, 2018):
hmm, yeah that makes sense, it only sets hostname for wifimanager, so if not calling autoconnect, it does not get set.
are you not using autoconnect?
@sorriso93 commented on GitHub (Apr 5, 2018):
Yes I used autoconnect and the fsparameter example (I also integrated in my sketch the OTA part in another setup procedure).
After a lot of trial this is the code doing the job...
@tablatronix commented on GitHub (Apr 5, 2018):
so you tried
what did logs say ?
@sorriso93 commented on GitHub (Apr 5, 2018):
I must admit I don't know how to see log... you mean log of the ESP8266 program execution I imagine...
@tablatronix commented on GitHub (Apr 5, 2018):
the serial output
@sorriso93 commented on GitHub (Apr 5, 2018):
Ah ok, printing WiFi.hostname() I did get ESP*** hostname, not what I set from the ap's web interface
@tablatronix commented on GitHub (Apr 5, 2018):
That is the default.
Paste the wm: debug logging if you can test again please, thanks
@tablatronix commented on GitHub (Jun 29, 2018):
is this still an issue?
@DaleSchultz commented on GitHub (Apr 21, 2019):
using Wifimanage 0.14.0 on ESP8266 NodeMCU
results in:
@tablatronix commented on GitHub (Apr 21, 2019):
Development branch!
@DaleSchultz commented on GitHub (Apr 21, 2019):
ah duh!
There seems to be an underlying problem setting hostname() sometimes it works and sometimes not. I suspect it is not a WifiManager issue but numerous people are having the problem. I am giving up.
Thanks.
@tablatronix commented on GitHub (Apr 21, 2019):
do you have a reference to problems?
@DaleSchultz commented on GitHub (Apr 21, 2019):
there are many threads and issues on it, some of which get confused by looking at what the router sees and reports etc. and many are closed when some workaround is found.
https://github.com/esp8266/Arduino/issues/2826
https://www.esp8266.com/viewtopic.php?f=160&t=15590
https://www.esp8266.com/viewtopic.php?f=29&t=11124
https://www.esp8266.com/viewtopic.php?f=32&t=11306
https://forum.arduino.cc/index.php?topic=558635.0
On Friday this was working fine for me on multiple ESP8266 NodeMCU units:
Then suddenly it no longer works and new downloads produce an empty string. Note if the call to hostname() works, the reading it back with hostname(); should return the name, so there should be no need to restart routers or load DNS systems etc., those all just confuse and obscure the issue that WiFi.hostname("abcd"); is demonstratively failing on some occasions.
It is erratic, which probably explains why there are so many threads online complaining that it does not work, and it works for others. Some people also report it stopped working after it was working.
In wading through all these threads I came across this thread suggesting to use WiFiManager.setHostname() as a workaround. It should not be needed.
https://github.com/esp8266/Arduino/issues/2826
has a statement from d-a-v saying
but it also fails with LwIP 1.4 for me.
@tablatronix commented on GitHub (Apr 21, 2019):
Those threads are very old, dns was broken until like 2.4