[Info] Connecting to an access point with a fixed IP address ...
Posted: Sun Nov 13, 2016 5:43 pm
A new code fragment is available here:
https://github.com/nkolban/esp32-snippe ... tatic_ip.c
The purpose of the fragment is to connect to an access point from our ESP32 using a static/fixed IP address as opposed to using DHCP for IP address allocation. The reason I am calling this out is because it has improved my coding workflow. I often find myself repeating the "edit, compile, flash, run, examine" cycle. When we use DHCP to be allocated an IP address there is a delay of a few seconds (at least in my environment) while the DHCP protocols are being exchanged and an IP given to the ESP32. Using a static IP address, I am finding that from the point of esp_wifi_connect() to the event indicating that I have an IP and am ready to start communicating becomes so quick that I don't perceive any delays. When one is doing a lot of reboots to test ... this can be a great boon.
https://github.com/nkolban/esp32-snippe ... tatic_ip.c
The purpose of the fragment is to connect to an access point from our ESP32 using a static/fixed IP address as opposed to using DHCP for IP address allocation. The reason I am calling this out is because it has improved my coding workflow. I often find myself repeating the "edit, compile, flash, run, examine" cycle. When we use DHCP to be allocated an IP address there is a delay of a few seconds (at least in my environment) while the DHCP protocols are being exchanged and an IP given to the ESP32. Using a static IP address, I am finding that from the point of esp_wifi_connect() to the event indicating that I have an IP and am ready to start communicating becomes so quick that I don't perceive any delays. When one is doing a lot of reboots to test ... this can be a great boon.