Skip to content

Conversation

@brettbear
Copy link

@brettbear brettbear commented Jan 2, 2026

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

  • Upload firmware build with fixes to board with existing WiFi Setup
  • WiFi AP started (AP SSID customised name observed)
  • WiFi AP tested and connected OK (4.3.2.1) - WiFi Setup config retained and loaded
  • Connected Ethernet, connection event registered
  • WiFi AP stopped and Access point disabled
  • UI accessible via Ethernet and the defined static IP

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)

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Walkthrough

Reorganizes Ethernet configuration parsing in cfg.cpp by relocating the Ethernet deserialization block within deserializeConfig, and refactors Ethernet initialization logic in network.cpp by moving static IP configuration from the ETH_CONNECTED event handler to the post-ETH.begin phase and updating related logging messages.

Changes

Cohort / File(s) Change Summary
Configuration parsing reordering
wled00/cfg.cpp
Ethernet configuration block moved from pre-id position to post-DNS, pre-ap position within deserializeConfig; behavior unchanged with issue reference comment added.
Ethernet initialization and static IP configuration
wled00/network.cpp
Log messages updated from "initC" to "initE"; static IP configuration logic relocated from WiFiEvent (ETH_CONNECTED) to immediate post-ETH.begin with conditional application based on multiWiFi[0] settings; ETH.config call removed from event handler.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: fixing ethernet static IP initialization and updating debug messages.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Collaborator

@DedeHai DedeHai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, looks good to me (I can't test as I have no such hardware)

@brettbear
Copy link
Author

Cool - do I need to do anything else or are we good @DedeHai?

@DedeHai
Copy link
Collaborator

DedeHai commented Jan 2, 2026

all good, just waiting for some more feedback

@DedeHai DedeHai requested a review from softhack007 January 2, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants