Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

ESP8266 can't get DHCP IP addres from Asus router

Open cniedzi opened this issue 3 years ago • 36 comments

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 avatar Sep 03 '21 13:09 cniedzi

Any comment pls?

cniedzi avatar Sep 11 '21 22:09 cniedzi

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.

TD-er avatar Sep 25 '21 09:09 TD-er

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

cniedzi avatar Sep 25 '21 10:09 cniedzi

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

TD-er avatar Sep 25 '21 13:09 TD-er

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.

cniedzi avatar Sep 25 '21 13:09 cniedzi

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

TD-er avatar Sep 25 '21 13:09 TD-er

@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 ?

d-a-v avatar Sep 25 '21 15:09 d-a-v

@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

cniedzi avatar Sep 25 '21 17:09 cniedzi

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

rolupusoru avatar Nov 05 '21 22:11 rolupusoru

#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).

d-a-v avatar Nov 05 '21 22:11 d-a-v

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.

movodos avatar Nov 12 '21 02:11 movodos

@movodos we have a test version of Tasmota available with the fix Please join the discussion and test at https://github.com/arendst/Tasmota/discussions/13623

barbudor avatar Nov 12 '21 12:11 barbudor

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 .

rolupusoru avatar Nov 14 '21 00:11 rolupusoru

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.

cniedzi avatar Dec 27 '21 13:12 cniedzi

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.

d-a-v avatar Dec 27 '21 23:12 d-a-v

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 avatar Dec 28 '21 11:12 cniedzi

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

cniedzi avatar Dec 28 '21 12:12 cniedzi

Hi, any suggestions how to install 0.0.2 core?

cniedzi avatar Dec 30 '21 22:12 cniedzi

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.

d-a-v avatar Dec 31 '21 09:12 d-a-v

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...

cniedzi avatar Dec 31 '21 11:12 cniedzi

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.

d-a-v avatar Jan 04 '22 21:01 d-a-v

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 avatar Jan 05 '22 10:01 cniedzi

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+.

cniedzi avatar Jan 06 '22 10:01 cniedzi

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

DHCP updates have just been integrated in master branch.

d-a-v avatar Jan 06 '22 12:01 d-a-v

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.

cniedzi avatar Jan 06 '22 13:01 cniedzi

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 avatar Feb 07 '22 23:02 sblantipodi

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?

sblantipodi avatar Feb 13 '22 14:02 sblantipodi

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

zpin avatar Aug 17 '22 15:08 zpin

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.

PedanticPete avatar Sep 17 '22 20:09 PedanticPete