Skip to content

WiFi static IP configuration doesn't work after networking refactoring #9435

Closed
@JAndrassy

Description

@JAndrassy

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.

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.

if((getStatusBits() & ESP_NETIF_HAS_IP_BIT) == 0 && !config()){
.

Metadata

Metadata

Assignees

Labels

3.0 migrationissue relates to migration from 2.X to 3.X versionType: RegressionResult of unforeseen consequences of a previous change

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions