Skip to content

fix static IP on wired ETH - #11385

Merged
caveman99 merged 2 commits into
developfrom
eth-static-ip
Aug 10, 2026
Merged

fix static IP on wired ETH#11385
caveman99 merged 2 commits into
developfrom
eth-static-ip

Conversation

@caveman99

@caveman99 caveman99 commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added support for applying configured static IPv4 settings to W5500 and CH390D Ethernet connections after initialization.
    • Ethernet services now start after successful initialization and network configuration.
  • Bug Fixes

    • Improved error reporting when static network configuration cannot be applied.
    • Added clearer handling when Ethernet is disabled or initialization fails, including fallback to DHCP when needed.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b530cfb3-3cf0-44f3-9b11-1ddf5a99d907

📥 Commits

Reviewing files that changed from the base of the PR and between efa63cd and 61a636b.

📒 Files selected for processing (1)
  • src/mesh/wifi/WiFiAPClient.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/mesh/wifi/WiFiAPClient.cpp

📝 Walkthrough

Walkthrough

Changes

Ethernet static IP configuration

Layer / File(s) Summary
Apply static IPv4 settings
src/mesh/wifi/WiFiAPClient.cpp
Adds applyEthStaticIp() for static IP, gateway, subnet, and DNS values. W5500 and CH390D initialization validate enablement, register events before ETH.begin(), apply static settings after successful startup, and then start web services and connection polling.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided, so the required change summary and testing attestations are missing. Add a description that explains the fix, references issue #11385 if applicable, and completes the required testing attestations.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing static IP configuration for wired Ethernet.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch eth-static-ip

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.

@caveman99 caveman99 changed the title fix https://github.com/meshtastic/firmware/issues/11370 fix static IP on wired ETH Aug 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/mesh/wifi/WiFiAPClient.cpp`:
- Around line 103-109: Change applyEthStaticIp() to return a boolean indicating
whether static Ethernet configuration is valid and successfully applied; log
failures for both ETH.config() rejection and a zero static IP. Update both
initEthernet() call sites to check this result and return false before starting
Ethernet events or services when static configuration is rejected.
- Around line 117-119: Register WiFiEvent before each ETH.begin() call,
including the W5500 initialization shown here and the other Ethernet
initialization site. Ensure applyEthStaticIp() cannot emit
ARDUINO_EVENT_ETH_GOT_IP before the handler is installed, preserving the
existing ethNetworkConnectedPending and onNetworkConnected() startup flow.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b7ec1b89-27e7-4660-8809-86c82bc0bb5c

📥 Commits

Reviewing files that changed from the base of the PR and between 512154f and efa63cd.

📒 Files selected for processing (1)
  • src/mesh/wifi/WiFiAPClient.cpp

Comment thread src/mesh/wifi/WiFiAPClient.cpp Outdated
Comment thread src/mesh/wifi/WiFiAPClient.cpp Outdated
@caveman99 caveman99 self-assigned this Aug 10, 2026
@caveman99 caveman99 added bugfix Pull request that fixes bugs 2.8 labels Aug 10, 2026
@caveman99
caveman99 added this pull request to the merge queue Aug 10, 2026
Merged via the queue into develop with commit b1132cf Aug 10, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.8 bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant