Skip to content

Ethernet Static IP Fails #5733

Closed
Closed
@weswitt

Description

@weswitt

Using Arduino ESP32 v2.0.0 and Arduino IDE v1.8.16. Board is a WESP32 with the ETH_PHY_RTL8201 chip.

I cannot get static IP to work -- very simple code below. The network initializes just fine but I get a DHCP address. I tried calling ETH.config before ETH.begin but that results in the system crashing. Is there a way to get a static IP to work?

ETH.begin(0, -1, 16, 17, ETH_PHY_RTL8201);
esp_event_handler_register(ETH_EVENT, ESP_EVENT_ANY_ID, &eth_event_handler, NULL);
ETH.config(
    IPAddress(192,168,10,186),
    IPAddress(192,168,10,1),
    IPAddress(255,255,255,0),
    IPAddress(192,168,10,1),
    IPAddress(8,8,8,8));

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions