Skip to content
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 can't get DHCP IP addres from Asus router #8299

Open
cniedzi opened this issue Sep 3, 2021 · 32 comments
Open

ESP8266 can't get DHCP IP addres from Asus router #8299

cniedzi opened this issue Sep 3, 2021 · 32 comments

Comments

@cniedzi
Copy link

cniedzi commented Sep 3, 2021

Hi,

I have a problem described below. Is there any solution?

Platform

  • Hardware: ESP8266-12F
  • Core Version: Any higher then 2.5.2
  • Development Env: Arduino IDE
  • Operating System: Windows 10

Settings in IDE

  • Module: Wemos D1 R2 & mini
  • Flash Mode:
  • Flash Size: 4MB no SPIFFS
  • lwip Variant: v2 Lower Memory
  • Reset Method:
  • Flash Frequency:
  • CPU Frequency: 80Mhz
  • Upload Using: SERIAL
  • Upload Speed: 912600

Problem Description

I use Wemos D1 mini R2 with Arduino core for ESP8266. With any core version higher than 2.5.2 ESP can't get DHCP IP address from ASUS RT-AX86U router (although according to debug data it succesfully connects to wifi).

When I revert back to core 2.5.2 or 2.5.0 ESP sucessfully connects to Asus router and gets IP address. Is it known issue?

Regards

@cniedzi
Copy link
Author

cniedzi commented Sep 11, 2021

Any comment pls?

@TD-er
Copy link
Contributor

TD-er commented Sep 25, 2021

Not really a helpful reply from me, but I am quite curious to see an answer, as it is reported often by users of my software too.

@cniedzi
Copy link
Author

cniedzi commented Sep 25, 2021

Any core higher then 2.5.2 is useless with asus routers :( I stay with 2.5.

@TD-er
Copy link
Contributor

TD-er commented Sep 25, 2021

Well it seems also to depend on the firmware of those Asus routers, as reported by some. (I don't have Asus routers here)

@cniedzi
Copy link
Author

cniedzi commented Sep 25, 2021

Well it seems also to depend on the firmware of those Asus routers, as reported by some. (I don't have Asus routers here)

Thx. I'll pay attention when new asus' fws will be releasing.

@TD-er
Copy link
Contributor

TD-er commented Sep 25, 2021

It was more like downgrade made it work (again), but I have no idea what specific router it was.

@d-a-v
Copy link
Collaborator

d-a-v commented Sep 25, 2021

@cniedzi

Any core higher then 2.5.2 is useless with asus routers :( I stay with 2.5.

With latest release, can you try, in the tools menu:

    1. to select generic esp8266 board
    1. then select firmware version "nonos-sdk 2.2.1 (legacy)"
    1. flash and report

Did you also try to flash OpenWrt on your asus router ?

@cniedzi
Copy link
Author

cniedzi commented Sep 25, 2021

@cniedzi

Any core higher then 2.5.2 is useless with asus routers :( I stay with 2.5.

With latest release, can you try, in the tools menu:

    1. to select generic esp8266 board
    1. then select firmware version "nonos-sdk 2.2.1 (legacy)"
    1. flash and report

Did you also try to flash OpenWrt on your asus router ?

Hi, thx for reply.
nonos-sdk 2.2.1 (legacy) doesn't work for me with the latest release.

I didn't try OpenWrt because I use Mesh system.

Regards

@rolupusoru
Copy link

rolupusoru commented Nov 5, 2021

Hi @cniedzi ,

I have an ASUS Rt-AC86U running Merlin firmware. My IoT device runs tasmota wit Arduino Core 2.7.4.9 and I have the same problem with DHCP addresses. I took a trace on the router and I can clearly see that the device ignores the DHCP offer from the router,
sp111_trace_NOK.zip

@d-a-v
Copy link
Collaborator

d-a-v commented Nov 5, 2021

#8319 may fix this issue (follow the links for explanations).
It is not merged yet into master branch but will be soon.
In the meantime, any report about it is welcome (by merging the PR or by using the alpha version 0.0.2 board manager installer for the Arduino IDE).

@movodos
Copy link

movodos commented Nov 12, 2021

Having the same issue with tasmota zbridge connecting to a ASUS RT-AX88U running wrt-merlin. The bridge required several manual power cycles after a reboot before it would reconnect to wifi. Following the guide below and another forum post, once "Wi-Fi Agile Multiband" was disabled on the 2.4 band the issue completely dissapeared.

https://www.asus.com/us/support/FAQ/1042475

Setting the IP on the device will probably be a better short term solution but maybe this info will help someone else until the fix above is implemented.

@barbudor
Copy link

@movodos we have a test version of Tasmota available with the fix
Please join the discussion and test at arendst/Tasmota#13623

@rolupusoru
Copy link

rolupusoru commented Nov 14, 2021

Tasmota 10.0.0.2 test version with #8319 fix did not help. I still have the same DHCP issues on my ASUS router. Trace attached.
esp8266_trace.zip
.

@cniedzi
Copy link
Author

cniedzi commented Dec 27, 2021

Hi, any news about this issue? Core 3.0.2 still doesn't work for me :(
PS. Sometimes I am able to sucessfully connect to Asus router, most often just after uploading new sketch.

@d-a-v
Copy link
Collaborator

d-a-v commented Dec 27, 2021

Hi, any news about this issue? Core 3.0.2 still doesn't work for me :(

There are suggestions after your last message that we'd like to have reports about.

@cniedzi
Copy link
Author

cniedzi commented Dec 28, 2021

Hi, any news about this issue? Core 3.0.2 still doesn't work for me :(

There are suggestions after your last message that we'd like to have reports about.

I've tried Alpha board manager and to install 0.0.2 core but there were errors during uploading sketch (for normal releases everyting goes fine). Should I set something in addition?

Arduino: 1.8.19 (Windows 10), Board: "LOLIN(WEMOS) D1 mini Pro, Sketch, Off, Off, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 16MB (FS:14MB OTA:~1019KB), v2 Lower Memory, Disabled, HTTP_UPDATE, Only Sketch, 921600"

Executable segment sizes:

ICACHE : 32768           - flash instruction cache 

IROM   : 298964          - code in flash         (default or ICACHE_FLASH_ATTR) 

IRAM   : 31497   / 32768 - code in IRAM          (IRAM_ATTR, ISRs...) 

DATA   : 1708  )         - initialized variables (global, static) in RAM/HEAP 

RODATA : 3712  ) / 81920 - constants             (global, static) in RAM/HEAP 

BSS    : 27168 )         - zeroed variables      (global, static) in RAM/HEAP 

Build-Dir: C:\Users\Czarek\AppData\Local\Temp\arduino_build_511358



C:\Users\Czarek\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3 -I C:\Users\Czarek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\0.0.2/tools/upload.py -fi 0 -up 1 --port COM3 --baud 921600 --before default_reset --after hard_reset --sk 0x0 C:\Users\Czarek\AppData\Local\Temp\arduino_build_511358/Sterownik_WiFi.ino.bin --fs 0x200000 C:\Users\Czarek\AppData\Local\Temp\arduino_build_511358/Sterownik_WiFi.ino 

Port: 'COM3', does not exist!

...Upload aborted

An error occurred while uploading the sketch

@cniedzi
Copy link
Author

cniedzi commented Dec 28, 2021

The core 3.0.2-42-gb5f3d1d6 (0.0.1) uploads correctly.

@cniedzi
Copy link
Author

cniedzi commented Dec 30, 2021

Hi, any suggestions how to install 0.0.2 core?

@d-a-v
Copy link
Collaborator

d-a-v commented Dec 31, 2021

0.0.1 and 0.0.2 installation process are similar, unofficial and experimental.
If 0.0.1 installs fine, then 0.0.2 can be installed with the same process.
In doubt or in case of a previous installation, you can quit the IDE, remove arduino15/staging/packages/esp8266-0.0* and arduino15/packaging/esp8266/hardware/esp8266/0.0* and retry.

@cniedzi
Copy link
Author

cniedzi commented Dec 31, 2021

0.0.1 and 0.0.2 installation process are similar, unofficial and experimental. If 0.0.1 installs fine, then 0.0.2 can be installed with the same process. In doubt or in case of a previous installation, you can quit the IDE, remove arduino15/staging/packages/esp8266-0.0* and arduino15/packaging/esp8266/hardware/esp8266/0.0* and retry.

I've done what you suggested - 0.0.1 uploads fine while 0.0.2 with error: "Port: 'COM3', does not exist!".
So, I have to wait for official release...

@d-a-v
Copy link
Collaborator

d-a-v commented Jan 4, 2022

COM port management is managed by the Arduino IDE.
To my knowledge this esp8266 Arduino core has no impact on the serial port management and I'm afraid I can't see any reason why 0.0.1 and 0.0.2 should behave differently regarding your COM3 port.

You can try to manually use esptool:
In the Arduino IDE preference, enable verbose upload, then retry to flash, then copy-pase the esptool command line from the Arduino IDE log window onto a command-line shell, then try to play with the arguments.
In both version 0.0.1 and 0.0.2, esptool is the same.

@cniedzi
Copy link
Author

cniedzi commented Jan 5, 2022

COM port management is managed by the Arduino IDE. To my knowledge this esp8266 Arduino core has no impact on the serial port management and I'm afraid I can't see any reason why 0.0.1 and 0.0.2 should behave differently regarding your COM3 port.

You can try to manually use esptool: In the Arduino IDE preference, enable verbose upload, then retry to flash, then copy-pase the esptool command line from the Arduino IDE log window onto a command-line shell, then try to play with the arguments. In both version 0.0.1 and 0.0.2, esptool is the same.

2.5.0 uses esptool - DOES upload
C:\Users\Czarek\AppData\Local\Arduino15\packages\esp8266\tools\esptool\2.5.0-3-20ed2b9/esptool.exe -vv -cd nodemcu -cb 921600 -cp COM3 -ca 0x00000 -cf C:\Users\Czarek\AppData\Local\Temp\arduino_build_151226/Sterownik_WiFi.ino.bin

0.0.1 uses upload.py instead of esptool - DOES upload
C:\Users\Czarek\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3 -I C:\Users\Czarek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\0.0.1/tools/upload.py --chip esp8266 --port COM3 --baud 921600 --before default_reset --after hard_reset write_flash 0x0 C:\Users\Czarek\AppData\Local\Temp\arduino_build_391240/Sterownik_WiFi.ino.bin

0.0.2 uses upload.py - DOES NOT upload
C:\Users\Czarek\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3 -I C:\Users\Czarek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\0.0.2/tools/upload.py -fi 0 -up 1 --port COM3 --baud 921600 --before default_reset --after hard_reset --sk 0x0 C:\Users\Czarek\AppData\Local\Temp\arduino_build_151226/Sterownik_WiFi.ino.bin --fs 0x200000 C:\Users\Czarek\AppData\Local\Temp\arduino_build_151226/Sterownik_WiFi.ino

With 0.0.2 no matter which port I set, "Port: 'COM3', does not exist!".
I've sucessfully used esptool for 0.0.2. I have to test it - ESP8266 sometimes connects, sometimes not.

@cniedzi
Copy link
Author

cniedzi commented Jan 6, 2022

I can say 0.0.1 is more or less the same as 3.0.2 - ESP8266 connects to router after ca. 3-5 min. while 2.5.0 instantly.
In both cases WiFi connection is set instantly, but there is a problem with DHCP negotiation for 2.5.0+.

@d-a-v
Copy link
Collaborator

d-a-v commented Jan 6, 2022

You can now remove 0.0.1 and reinstall it, or try the "git version",

DHCP updates have just been integrated in master branch.

@cniedzi
Copy link
Author

cniedzi commented Jan 6, 2022

You can now remove 0.0.1 and reinstall it, or try the "git version",

DHCP updates have just been integrated in master branch.

I have installed 3.1.0-dev and it looks promising. I can connect to router similarly to 2.5.0.

EDIT: Looks like I've stated premature opinion :( Sometimes I can connect immediately, somtimes I can't connect at all or I have to wait long time... Still testing.

@sblantipodi
Copy link

You can now remove 0.0.1 and reinstall it, or try the "git version",

DHCP updates have just been integrated in master branch.

I have installed 3.1.0-dev and it looks promising. I can connect to router similarly to 2.5.0.

EDIT: Looks like I've stated premature opinion :( Sometimes I can connect immediately, somtimes I can't connect at all or I have to wait long time... Still testing.

It looks promising, but does it worked?
Does 3.1.0-dev solved the problem?

Same problem here with AX56U

@sblantipodi
Copy link

it seems that the latest version on the master branch completely fixed the problem on my Asus AX56U.
I had a the same problem even using my provider's router (Vodafone Station) and it is fixed on that router too.

Congrats guys... is there an ETA for this patch to be released in the next release?

@zpin
Copy link

zpin commented Aug 17, 2022

Same problem here, the workaround in issue #8412 (using WiFi.setPhyMode(WIFI_PHY_MODE_11G);) worked for me.

@PedanticPete
Copy link

PedanticPete commented Sep 17, 2022

Thanks, all of my esp8266s have been working fine with my new ASU's xt8 until I had to update one of them ... this 11G solution works just fine! Thanks again!

Same problem here, the workaround in issue #8412 (using WiFi.setPhyMode(WIFI_PHY_MODE_11G);) worked for me.

@jasenpashov
Copy link

Thank you very much. That fixed everything - WiFi.setPhyMode(WIFI_PHY_MODE_11G);

@dustinsievers
Copy link

Same problem here, the workaround in issue #8412 (using WiFi.setPhyMode(WIFI_PHY_MODE_11G);) worked for me.

This solved my issues

@LabriePierre
Copy link

Had the same problem with a Giga Hub from Bell (Sagecom Fast 5689E). Used ESP8266 boards (3.02) in Arduino. The ESP01 was connecting after many minutes but did not receive an IP address. Using WiFi.setPhyMode(WIFI_PHY_MODE_11G); worked for me also. The connection is in 5 seconds now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests