I am using ESP-IDF on a Wifi Kit 32 board. I’m noticing that all of the examples I have tried from the esp-idf sources have VERY slow Wifi initialization. Using menuconfig I found I had to change the Main XTAL frequency option to 26 MHz from the default of 40 MHz. I also changed the CPU frequency to 240 MHz instead of 160 MHz and set RTC clock source to External 32kHz crystal. This made it to where it at least boots properly and the serial monitor works.
From the serial port monitor it looks like the system is booting up, but with the default DHCP configuration, it takes around 8 minutes before a DHCP IP address is obtained! I then tried assigning a static IP address with esp_netif_set_ip_info() which works, but still takes around 40 seconds before I can ping the device or communicate with a listening TCP port. I thought it was perhaps a poor connection, since my router is reporting a rather poor connection, despite being just 1 room away, so I put it right next to the router, without any improvement and it is still showing around -81dBm of signal strength, despite being a couple feet from the router. I don’t think it is because of the poor connection though, since it seems to take a fairly consistent amount of time to be usable (8 minutes with DHCP and 40 seconds with static IP). The Wifi AP connection appears to happen fairly quickly in both cases. In the case of a static IP, it also gets a callback fairly quickly with the IP address, it is just that the interface doesn’t work yet. In the case of DHCP it takes around 8 minutes to get an IP assigned and the event callback to be triggered.
Are there perhaps some other settings I need to change from the default Espressif board settings for the Heltec Wifi Kit 32?
Any ideas or tips on this would be much appreciated.
Here is an excerpt from the log for the static IP case:
I (906) wifi:connected with ElementsOfSound, aid = 3, channel 11, BW20, bssid = 60:e3:27:4e:03:20
I (906) wifi:security: Open Auth, phy: bg, rssi: -55
I (916) wifi:pm start, type: 1
I (916) tcp_server: got ip:192.168.0.72
I (926) esp_netif_handlers: sta ip: 192.168.0.72, mask: 255.255.255.0, gw: 192.168.0.2
I (996) wifi:AP’s beacon interval = 102400 us, DTIM period = 2
I (39816) tcp_server: Socket accepted ip address: 192.168.0.10
As can be seen the Wifi connection happens within 1 second of booting, but the TCP connection doesn’t occur until almost 40 seconds later.