Fixes ethernet initialisation of static IP settings and modified some debug info #5262
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
#5247
The static IP configuration happened too late in the ethernet initialization sequence.
The ETH.config() call from the event handler was moved to just after ETH.begin().
Additionally, initEthernet() was called before config deserialization was complete.
The initEthernet() was moved later in the config deserialization to ensure static IP and DNS configuration is completed prior to ethernet initialisation.
Testing performed
Build with default_envs = esp32_eth (no platformio_override.ini used)
WiFi Setup already exists (AP SSID customised, static IP set with custom DNS server address and AP opens set to 'No Connection after boot')
Tests done with and without DHCP being enabled on the Ethernet network. Expected behaviour seen regardless of DHCP or static IP Address usage.
No Ethernet connected
Ethernet connected
Power cycled board with existing WiFi Setup
Ethernet connection registered
WiFi AP stopped and Access point disabled
UI accessible via Ethernet and the defined static IP
WiFi Setup config retained and loaded
Disconnected ethernet
Ethernet disconnection event registered
WiFi AP started (AP SSID customised name observed)
WiFi AP tested and connected OK (4.3.2.1)
Removed all config files via http://4.3.2.1/edit
Rebooted board
WiFi AP started (AP SSID default name observed)
WiFi AP tested and connected OK (4.3.2.1)
WiFi Setup defaults observed
Static IP address, gateway and DNS set
Ethernet type set to QuinLED-Dig-Octa & T-ETH-POE
WiFi Setup saved
Confirmed that WiFiSetup changes were retained
Connected Ethernet, connection event registered
WiFi AP stopped and Access point disabled
UI accessible via Ethernet and the defined static IP
Rebooted board with ethernet connected
UI accessible via Ethernet and the defined static IP
Erased flash via esptool
Ethernet connected
Uploaded firmware build with fixes
WiFi AP started (AP SSID default name observed)
WiFi AP tested and connected OK (4.3.2.1)
WiFi Setup defaults observed
Ethernet connection down due to Ethernet Type being set to 'None' by default.
Static IP address, gateway, DNS and AP SSID customised name set
Ethernet type set to QuinLED-Dig-Octa & T-ETH-POE
WiFi Setup saved
Ethernet connection registered
WiFi AP stopped and Access point disabled
UI accessible via Ethernet and the defined static IP
WiFi Setup config retained and loaded
Disconnected ethernet
Ethernet disconnection event registered
WiFi AP started (AP SSID customised name observed)
WiFi AP tested and connected OK (4.3.2.1)