-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
Description
WiFi doesn't use static IP configuration after the networking refactoring. Settings are not applied in NetworkInterface.config because esp_netif is NULL. In begin then DHCP is used.
| if(_esp_netif == NULL){ |
Sketch
WiFiClientStaticIP example
If I first begin with DHCP then setting static IP works for next begin. But following begin again uses DHCP. This is not right. Already configured static IP configuration has to be used. Static IP should be only cleared with config(INADDR_NONE) (or end()). All WiFi libraries have it that way including the esp8266 WiFi.
The static IP configuration is cleared because ESP_NETIF_HAS_IP_BIT is cleared so config() with default parameters in invoked.
arduino-esp32/libraries/WiFi/src/STA.cpp
Line 354 in 7b29bac
| if((getStatusBits() & ESP_NETIF_HAS_IP_BIT) == 0 && !config()){ |