Page 1 of 1

I try to connect ethernet with static ip first, and if it does not connect, I want to connect with dynamic ip.

Posted: Mon Jul 04, 2022 2:55 pm
by dallim30
Hello

I was working on project using esp32 wrover-e with PlatformIO v4.4.1 and Arduino framework.
I try to connect ethernet with static ip first, and if it does not connect, I want to connect with dynamic ip.
How can I get Ethernet to work like the above scenario?
I think I need ETH.end(). How should I implement the ETH.end() function?

Any suggestion and help will be highly appreciated.

Re: I try to connect ethernet with static ip first, and if it does not connect, I want to connect with dynamic ip.

Posted: Tue Jul 05, 2022 3:44 pm
by lbernstone
I think you can just do your check for connectivity (ping the destination) and if there is no connection, call ETH::config() again with a 0 for your local_ip.
https://github.com/espressif/arduino-es ... H.cpp#L410