-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dhcp hostname issue in 2.4.0 #3970
Comments
I think this is related to the dhcp client in lwip2. |
Selecting "v1.4 Prebuilt(gcc)" does indeed fix THIS problem, but as you know I had other troubles using the old lwip in my sketches, specifically with my telnet server. Thanks for the quick response, let me know if you want me to test a fix or anything. |
Can you please try to update lwip2 like this:
then retry your sketch and check for hostname set by dhcp client ? |
apps/sntp/sntp.c:728:1: error: stray '\' in program
\n\n\n#if LWIP_UDP\nvoid sntp_force_request
(void)\n{\n\tsntp_request(NULL);\n}\n#endif\n
^
…On Thu, Dec 14, 2017 at 4:44 PM, david gauchard ***@***.***> wrote:
Can you please try to update lwip2 like this:
cd tools/sdk/lwip2
make
cd builder
git checkout master
git pull origin master
cd ..
make install
then retry your sketch and check for hostname set by dhcp client ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3970 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AZnTPkoWjpnjhhPTbBsxeUtB0OP5nf-rks5tAbL5gaJpZM4RCUGn>
.
--
david denney
dragondaud AT gmail DOT com
719-821-8900
|
after manually fixing the src error, it compiles and installs fine. And it
does fix the dhcp hostname issue. I'll let you know if I see anything else,
thanks!
…On Thu, Dec 14, 2017 at 5:58 PM, David Denney ***@***.***> wrote:
apps/sntp/sntp.c:728:1: error: stray '\' in program
\n\n\n#if LWIP_UDP\nvoid sntp_force_request (void)\n{\n\tsntp_request(
NULL);\n}\n#endif\n
^
On Thu, Dec 14, 2017 at 4:44 PM, david gauchard ***@***.***>
wrote:
> Can you please try to update lwip2 like this:
>
> cd tools/sdk/lwip2
> make
> cd builder
> git checkout master
> git pull origin master
> cd ..
> make install
>
> then retry your sketch and check for hostname set by dhcp client ?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#3970 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AZnTPkoWjpnjhhPTbBsxeUtB0OP5nf-rks5tAbL5gaJpZM4RCUGn>
> .
>
--
david denney
dragondaud AT gmail DOT com
719-821-8900 <(719)%20821-8900>
--
david denney
dragondaud AT gmail DOT com
719-821-8900
|
@d-a-v this sounds like a simple fix. Will you be making a PR? |
@devyte will be included in the next lwip2 update |
…ates and fixes lwip2 updates: > multi-mss makefile > forwardported espconn (no multicast yet) > restore max 3 ntp servers for configTime() coherency > unchain seldom chained pbufs > dns cache name length back to (256->48->) 128 > use sntp_stop/start() when dhcp address got > fix netif's hostname glue-handling > forwardported ping from lwip1.4 fix esp8266#3970 fix maybe esp8266#3963
…ates and fixes (#4039) lwip2 updates: > multi-mss makefile > forwardported espconn (no multicast yet) > restore max 3 ntp servers for configTime() coherency > unchain seldom chained pbufs > dns cache name length back to (256->48->) 128 > use sntp_stop/start() when dhcp address got > fix netif's hostname glue-handling > forwardported ping from lwip1.4 fix #3970 fix maybe #3963
DHCP hostname stopped working, again. Did this change not make it into master? I recently sync'd, but am not sure exactly when it stopped working. I tried the instructions above, again, and it didn't help. |
Noticed that dhcp hostname works normally if I enable WiFi debugging in the build. Stops working again when I disable debugging. |
It is currently working with master and you sketch above, no debug option enabled. |
I will try to isolate the problem further, but here are some packet captures that demonstrate the problem. The first one is successful, with debugging enabled, and you can see the requested hostname. The second capture, running the same exact code, but with debugging disabled, and it either doesn't have a hostname request, at all, or it is garbage as in this sample. Something is getting overwritten... 15:44:23.280937 60:01:94:34:52:20 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 350: (tos 0x0, ttl 255, id 1, offset 0, flags [none], proto UDP (17), length 336) 15:50:36.939437 60:01:94:34:52:20 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 350: (tos 0x0, ttl 255, id 1, offset 0, flags [none], proto UDP (17), length 336) |
Thanks for this finding! |
FYI, switching to lwip1.4 makes the problem disappear. |
Thanks a lot for highlighting this issue here. Same experience at my end. I am quite happy with stability of my lwip v2 webinterface by now, but I am desperately missing hostname feature. Any idea when this is going to be tackled? |
@caipifrosch @dragondaud So the first dhcp request is always good and the second one (after the delay defined by the dhcp server) can be (or is always) garbage ? |
As dragondaud's description perfectly matched my experience, there were no further investigations into this at my end. Just tested again with lwip 1.4prebuild and V2prebuild MCC=536.... Hostname just wont work on lwipV2. V1.4 hostname seems to be fine, but mobile access with my Android7 is very slow, no matter what browser I use. Nevertheless, I can not confirm that wifi debug option sets the hostname correctly. |
So I need help with a live patch to try. Can you
edit
then recompile
and relink your sketch (by rebuilding it). Reason: I have the DHCP hostname with the commented line above, do you ? @dragondaud @caipifrosch edit: |
OK, tried it without real background knowledge here... no success. Manually downloaded lwip2 from git as make download was not working. Make install then gave another error message. Any idea how to get around this? A link to a guide how to compile lwip would be highly appreciated. Error message: C:\develop\Arduino\hardware\ESP8266com\ESP8266\tools\sdk\lwip2>make install |
Can you replace your |
@caipifrosch you would need to use GNU make and gcc to build, looks like you have a commercial tool in your path. If you install GNU Make, and put it in your path before Embarcadero's then it will work. @d-a-v I'm testing the change now. |
@dragondaud I updated the test as follow.
|
My device can be accessed by hostname now. Thanks a lot! Webpages seem to load ok, but without any excessive testing my feeling is that it got somehow slower on android 7 device when using hostname. A website Logo of just 2kB does appear pretty late. Speed is good on android 7 IP access or win10 notebook. Have there been any other changes in the stack? @dragondaud: yes, I am indeed using a commercial tool here at my end for other stuff. Funny, when seeing this error I thought these make tool guys would use same toolchain... hahaha - Will have a look into the GNU make tool though... |
DHCPREQUEST for 10.10.10.195 (10.10.10.1) from 60:01:94:34:4f:0c (Hostname Unsuitable for Printing) via em1 Still seeing problem in lwip2 here. |
@caipifrosch thanks for reporting ! |
I didn't see the second one until now, and I will try it now, too. |
Though, I will note that I still believe something in lwip2 is clobbering memory, because with the latest build my DHT22 sensor stopped working reliably, but going back to lwip1.4 and it works fine again. |
@dragondaud can you confirm the hostname problem is solved by the second proposal ? |
Proposal 2 does fix the dhcp hostname issue, and the DHT22 seems to be happy, too. I'm betting something was referencing the non-initialized hostname and clobbering stuff. I'll close this issue once the fix is merged into master, or you can, whenever. Thanks! |
Thanks for testing ! |
) * lwip2: use only wifi_station_get_hostname() to set netif hostname fix #3970 * lwip2 comments on hostname
I have just updated my esp libraries in Atom and now the hostname is missing from the DHCP. This stops my esp's from getting DHCP on my network. Im not shure what changed in the last update or two, but why would you take the hostname out of DHCP? |
Also is there a command to put the hostname back in , or is the only option to recompile the sdk? |
|
Basic Infos
Hardware
Hardware: ESP-12/NodeMCU v1.0
Core Version: 2.4.0-github
Description
When using github version of Arduino ESP8266, the dhcp client is not sending hostname in request, resulting in a blank name in the DHCP server, and no DNS entry created. If I recompile with 2.3.0, then the hostname is sent, and assigned as expected.
I noticed blank hostnames previously, but wasn't sure where they came from. It turns out that jumping between 2.3.0 and 2.4.0-github was masking the issue, as once the server has the name set, it maintains it thru renewals, even when the name is not specified subsequently. And something is causing my modules running 2.4.0-github to occasionally lose their lease (localIP() shows 0.0.0.0).
ALSO, the default generated hostname (ESP_xxxx) is invalid, as the underscore character is not allowed in a valid hostname. A valid hostname may only contain letters, numbers and the dash "-", though a valid hostname cannot begin or end with a dash. https://en.wikipedia.org/wiki/Hostname
Settings in IDE
Arduino IDE: 1.8.5
Module: NodeMCU 1.0(ESP-12E)
Flash Size: 4M(1M)
CPU Frequency: 80 Mhz
lwip: v2
Upload Using: Serial
Sketch
Debug Messages
No related errors or other messages observed, even with full debug enabled.
The text was updated successfully, but these errors were encountered: