Hello ESP32 forum,
I'm developing an application using esp-idf_v3.1.1. ESP32 is configured in WIFI_MODE_APSTA mode, working at the same time as access point that accepts connections from WiFi clients and as station.
The system usually works as expected with most access points... but... there are a few access points that don't give IP address to ESP32 client.
In practice, looking at wifi stack logs we can verify that client side of ESP32 connects to this access point but there is no further step, i.e. the STA interface of ESP32 is formally connected to AP but can't do nothing anymore (IP address is missing). To be noted that this AP surely has IPV4 DHCP server running; AP authentication is WPA2-PSK-CCMP.
Technically speaking, we get SYSTEM_EVENT_STA_CONNECTED event but futher SYSTEM_EVENT_STA_GOT_IP event is never called.
Below there is some log lines produced by wifi stack:
...
I (6791) wifi: n:11 0, o:11 0, ap:11 0, sta:11 0, prof:11
I (6791) wifi: state: init -> auth (b0)
I (6796) wifi: state: auth -> assoc (0)
I (6797) wifi: state: assoc -> run (10)
I (6800) wifi: connected with M*****l, channel 11
I (6801) wifi: pm start, type: 0
...
I compared these lines with the log messages obtained when ESP32, trying to connect to another AP, can get IP address. The steps are exactly the same, but in the latter case we have the SYSTEM_EVENT_STA_GOT_IP event.
Any suggestion that could explain this weird behavior?
Thank you for your help!!!
rayf15
ESP32 connects to Access Point but can't get IP address
Re: ESP32 connects to Access Point but can't get IP address
Hello,rayf15 wrote: ↑Fri Oct 25, 2019 8:54 pmHello ESP32 forum,
I'm developing an application using esp-idf_v3.1.1. ESP32 is configured in WIFI_MODE_APSTA mode, working at the same time as access point that accepts connections from WiFi clients and as station.
The system usually works as expected with most access points... but... there are a few access points that don't give IP address to ESP32 client.
In practice, looking at wifi stack logs we can verify that client side of ESP32 connects to this access point but there is no further step, i.e. the STA interface of ESP32 is formally connected to AP but can't do nothing anymore (IP address is missing). To be noted that this AP surely has IPV4 DHCP server running; AP authentication is WPA2-PSK-CCMP.
Technically speaking, we get SYSTEM_EVENT_STA_CONNECTED event but futher SYSTEM_EVENT_STA_GOT_IP event is never called.
Below there is some log lines produced by wifi stack:
...
I (6791) wifi: n:11 0, o:11 0, ap:11 0, sta:11 0, prof:11
I (6791) wifi: state: init -> auth (b0)
I (6796) wifi: state: auth -> assoc (0)
I (6797) wifi: state: assoc -> run (10)
I (6800) wifi: connected with M*****l, channel 11
I (6801) wifi: pm start, type: 0
...
I compared these lines with the log messages obtained when ESP32, trying to connect to another AP, can get IP address. The steps are exactly the same, but in the latter case we have the SYSTEM_EVENT_STA_GOT_IP event.
Any suggestion that could explain this weird behavior?
Thank you for your help!!!
rayf15
Did you try same router with your mobile in which are you getting IP address in which you are not getting IP with ESP32?
So that you can have idea to move further for this issue.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: ESP32 connects to Access Point but can't get IP address
Hello,
Yes, sure, I tried with both a mobile phone and a laptop without any trouble...
I got maximum log verbosity from wifi stack but no help. Are there known issues regarding wifi chipsets incompatibile with ESP32?
rayf15
Yes, sure, I tried with both a mobile phone and a laptop without any trouble...
I got maximum log verbosity from wifi stack but no help. Are there known issues regarding wifi chipsets incompatibile with ESP32?
rayf15
Re: ESP32 connects to Access Point but can't get IP address
Try enabling dhcp debugging in lwip header files. Also consider trying newer versions of esp-idf.
Re: ESP32 connects to Access Point but can't get IP address
Yeah. That will be also helpful to find out exact issue.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: ESP32 connects to Access Point but can't get IP address
Thank you WiFive and Ritesh for your precious hints...
Finally I could try to debug ESP32 DHCP client behavior and discovered that there was a problem with last ARP check during DHCP sequence... This seem to be a known issue with "enterprise" access points, like Cisco Aironet Enterprise AP. Therefore I disabled the lwIP option CONFIG_LWIP_DHCP_DOES_ARP_CHECK and at last my ESP32 could get and use the IP address received from DHCP server.
rayf15
Finally I could try to debug ESP32 DHCP client behavior and discovered that there was a problem with last ARP check during DHCP sequence... This seem to be a known issue with "enterprise" access points, like Cisco Aironet Enterprise AP. Therefore I disabled the lwIP option CONFIG_LWIP_DHCP_DOES_ARP_CHECK and at last my ESP32 could get and use the IP address received from DHCP server.
rayf15
Re: ESP32 connects to Access Point but can't get IP address
Great. Thanks for update regarding same. Let us know if any issue into later stage.rayf15 wrote: ↑Mon Nov 04, 2019 11:17 pmThank you WiFive and Ritesh for your precious hints...
Finally I could try to debug ESP32 DHCP client behavior and discovered that there was a problem with last ARP check during DHCP sequence... This seem to be a known issue with "enterprise" access points, like Cisco Aironet Enterprise AP. Therefore I disabled the lwIP option CONFIG_LWIP_DHCP_DOES_ARP_CHECK and at last my ESP32 could get and use the IP address received from DHCP server.
rayf15
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: ESP32 connects to Access Point but can't get IP address
I am also facing the same issue. I can not find "CONFIG_LWIP_DHCP_DOES_ARP_CHECK " option in menuconfig as "rayf15" suggested. I am trying smartConfig Example with "WIFI_MODE_APSTA " Mode. I am able to provision ESP successfully and I can see ssid in mobile wifi list screen. but when I click on it then it showing "obtaining IP address...". can someone help me? Thanks
- Attachments
-
- wifi_issue.jpeg (24.6 KiB) Viewed 26641 times
Re: ESP32 connects to Access Point but can't get IP address
Is your issue has been resolved or still ongoing?Kunjan wrote: ↑Tue May 25, 2021 4:55 pmI am also facing the same issue. I can not find "CONFIG_LWIP_DHCP_DOES_ARP_CHECK " option in menuconfig as "rayf15" suggested. I am trying smartConfig Example with "WIFI_MODE_APSTA " Mode. I am able to provision ESP successfully and I can see ssid in mobile wifi list screen. but when I click on it then it showing "obtaining IP address...". can someone help me? Thanks
Regards,
Ritesh Prajapati
Ritesh Prajapati
-
- Posts: 1
- Joined: Thu Sep 22, 2022 4:09 am
Re: ESP32 connects to Access Point but can't get IP address
Hi, we are also facing the same issue but for us some of the devices are getting IP and some aren't.
- In the router - MAC id whitelisting is done correctly, we have checked free ips are available.
- Enabled DHCP logs, discover request is being sent from the devices but not all of them is receiving response from DHCP server (router)
CONFIG_LWIP_DHCP_DOES_ARP_CHECK isn't enabled. Any ideas on how to resolve this.
Thanks in advance for your help.
Aziz
- In the router - MAC id whitelisting is done correctly, we have checked free ips are available.
- Enabled DHCP logs, discover request is being sent from the devices but not all of them is receiving response from DHCP server (router)
CONFIG_LWIP_DHCP_DOES_ARP_CHECK isn't enabled. Any ideas on how to resolve this.
Thanks in advance for your help.
Aziz
Who is online
Users browsing this forum: Bing [Bot] and 72 guests