-
Notifications
You must be signed in to change notification settings - Fork 34
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
ESP8266: Wifi connectivity stuck trying to wifi_apply_hostname
#3402
Comments
Reviewing the ticket, it definitely happened on a totally barebones ESPHome config (aka w/out even the time sync, nor any sensors / components / frameworks), since I still had serial logging enabled at that point, which I disabled when I configured the device for https://github.com/geoffdavis/esphome-mitsubishiheatpump |
I'm getting this error too with an energy meter (pulse counting) built using a Wemos D1 connected to a DD-WRT Netgear WNDR3700v4. Worked fine for a few days but after that I'm lucky if I get energy data for a couple of hours each day. Using esphome 2022.6.2. I may try to upgrade my router or connect to a different access point. My Sonoff S26 smart plug is also having connection issues since I upgraded esphome but was fine with a version from I guess about a year ago. |
Running into this same issue. It just started today on a Wemos D1 hooked up to a Vista alarm system that ran fine for the last maybe four or five weeks. I didn't change anything in my setup (wifi, router, or esphome version/firmware). Here's my esphome Wemos D1 log:
Glancing at the lwIP code https://github.com/espressif/esp-lwip/blob/2.1.2-esp/src/include/lwip/err.h it appears that -16 is ERR_ARG=illegal argument. Hmm. |
FWIW, I just gave my ESP32 devices static IP addresses and things look 10x
better now. All my issues were due to something timing out / erroring /
being unhappy during the DHCP transaction(s).
…On Tue, Sep 13, 2022 at 12:25 PM Martin Ecker ***@***.***> wrote:
Running into this same issue. It just started today on a Wemos D1 hooked
up to a Vista alarm system that ran fine for the last maybe four or five
weeks. I didn't change anything in my setup (wifi, router, or esphome
version/firmware).
I think the Wemos D1 got bricked somehow. Going to try with another one.
—
Reply to this email directly, view it on GitHub
<#3402 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABAM3FUIZGSORPMMNNETU73V6CTGHANCNFSM5ZYQOAUQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*RAFAL BONI* | Engineering Team Lead
e: ***@***.***
*Meet me here <https://meet.yesware.com/me/rafalyesware>*
|
Ah, thanks for that tip. I assigned a static IP in my router to the Wemos D1 and indeed it was immediately able to reconnect. |
Have same issues with my NodeMCU v3 of unknown origin with a ASUS AX58U router. Static ip via DHCP gave same error messages as original post. Then put the IP static in in Esphome config at connection got stable right away. |
Had the same issue on a D1 uisng ESPHome version 2022.10.2. Fix was to disable "Wi-Fi Agile Multiband" based on this comment. Problem solved. |
I have the same issue, it happened on a Sonoff Basic R1 (pretty old module with a lot of flashes over time). I just experimented moving away from tasmota to esphome and everything worked fine with 2022.8.0 firmware. I have updated to 2022.10.2 and it was still ok. Then I have added
Other reasons that show are all possible, Token expired, Association Expired, Auth Expired and so on. It just looks like if the wifi chip got somehow damaged. What is however interesting - after flashing back tasmota 9.5 it was able to connect and work just fine?!? What I also observed - during some boots, scan reports wery poor RSSI (-85) and for some other boots a bit better (-79)... This does not seem to be signal related though... Edit: after trying to revert back to tasmota i have found out, that after longer running it also looses wifi and gets in 'trying to connect' loop, so it seems that those few additional flash operations might have either weared out the flash chip or caused some other kind of damage as it does not work back with tasmota. I will have to replace the module entirely :/ |
Same issue with multiple ESP8266 devices (NodeMCU clones, D1 Mini clones), with or without any functionality attached. Haven't had any issues with ESP32 devices. All of them are complaining about not being able to apply hostname
What's noticeable is that if I leave them powered on for long enough, sometimes they do connect to WiFi. The WiFi is running on a pair of Asus XT8 units, the DHCP server is powered by PiHole v5.19.2. |
I'm having an exactly the same issue. It seems unrelated to ESPHome at all. I've seen this problem with a brand new NodeMCU-v3 dev board with a factory firmware. Luckily I have two routers at home and the issue only exists with my Archer AX73. Everything works fine and blazingly fast with a good old TL-WR841N. I'm suspecting that it's some protocol issue. Probably with 802.11n that the good old TL-WR841N doesn't even support. |
Hi, I have been struggling with this issue for a week now and I finally managed to solve it.
And it works like a charm. Now the question is could something be done in ESPHome to make ESP8266 support Smart Connect as it not cool to have two SSIDs :P |
I have an Asus XT8 (RT-AX95Q), but I have different SSIDs for each band and each guest network. I was connecting to the 2.4GHz SSID and still had the issue. |
Sorry to hear that, Something I was told to check (I did not need to though) is to set the the Wireless mode for 2.4Ghz to "Legacy". Maybe this will help? |
I got my devices working when I switched my Asus router to Wireless Mode = Legacy. |
I'm almost a little embarrassed, but for me this behavior occurred because my DHCP range had no more free addresses... |
The workaround to set the manual_ip in the wifi module also fixed the issue for me. Flashing the firmware to a brand new esp32 did not fix it. |
The problem
I have a couple of cheap Wemos D1 mini clones that frequently get in a state which they can't recover from -- they error out trying set the hostname (via a DHCP renew, if I'm reading the code correctly) over and over again and then give up and eventually time out, then re-scan and fall back into the same pattern. Eventually, they may recover but I haven't found the clue to when and how.
Here's the loop of log messages I see when this happens:
The DHCP server is a DD-WRT router using
dnsmasq
for DHCP & DNS. Here's a capture of a snippetof the traffic for the ESP's MAC address at the router when it's in this state:
The TL;DR appears to be that when it's in that state it does a DHCP DISCOVER, gets a DHCP OFFER back and then nada.
When it works, it looks like this:
IOW, now after the OFFER, the ESP sends a REQUEST with the hostname and the router sends back an ACK. Behavior matches the point in the networking code where the hostname is set, but I have no idea how to track down what the error is in the ESP / Arduino Wifi / Networking code since it appears that
dhcp_renew
which is actually causing the error is part of the (closed source?) Espressif SDK?Which version of ESPHome has the issue?
2022.6.2
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2022.6.7 (core) 2022.06.0 (supervisor)
What platform are you using?
ESP8266
Board
Wemos D1 clone (https://www.amazon.com/dp/B07V84VWSM?_encoding=UTF8&psc=1&ref_=cm_sw_r_cp_ud_dp_84K8CM5B88XMAZWKPY2V)
Component causing the issue
Wifi
Example YAML snippet
I believe I saw this even before installing any of the additional components / sensors / fameworks as well, will grab a clean device to test with a minimal config.
Additional information
No response
The text was updated successfully, but these errors were encountered: