Skip to content

Add PoE support for the RAK10720 (RAK4631 + RAK13800 + RAK19018) 🤖🤖 - #3827

Open
1sthandy wants to merge 1 commit into
meshcore-dev:devfrom
1sthandy:poe/rak10720-poe-support
Open

1sthandy wants to merge 1 commit into
meshcore-dev:devfrom
1sthandy:poe/rak10720-poe-support

Conversation

@1sthandy

Copy link
Copy Markdown

Fixes #2855. Replaces #2679, which bundled this with the multi-client change (now split out as a separate PR, per CONTRIBUTING).

What

Lets a RAK4631 with a RAK13800 (W5100S) on a RAK19018 PoE base (the RAK10720 "WisMesh Ethernet Gateway") boot and stay up on PoE alone, with no battery and no separate power supply. It builds on #1983 and on the RAK13800EthernetInterface refactor (#3049).

Why this is needed on top of #1983

#1983 powers the WisBlock slot rail (WB_IO2) early, which is necessary but did not make the cold start reliable on my setup. The RAK19018's Silvertel Ag9905MT converter folds back and resets unless it sees a continuous load of roughly 125 mA or more, and a bare MeshCore node draws only a few mA. The W5100S draws about that much once its PHY is active, so the chip has to be running at full current before the converter's foldback timer expires. Doing the library's normal bring-up (a PHY soft-reset plus a blocking DHCP exchange) straight away in setup() dips the load again and collapses the supply.

I know #1983 alone is enough on some PoE sources (see the report in #2679), so everything here is opt-in via the new *_ethernet_poe envs and WITH_W5100S_POE; the plain _ethernet envs are unchanged.

Changes (all gated by WITH_W5100S_POE)

  • variants/rak4631/W5100SPoE.{h,cpp} (new): release the W5100S reset in an early constructor and run a bit-banged soft-reset/VERSIONR read from board.begin(), so the chip draws full current as early as possible.
  • RAK4631Board.cpp: voltage_bootlock = 0. With no battery the floating ADC pin would otherwise trigger the boot-voltage protection and a SYSTEMOFF loop.
  • RAK13800EthernetInterface and EthernetCLI.h: defer the library bring-up by ~6 s (ETH_POE_DEFER_MS) until the converter has latched, and use a bounded DHCP timeout with a static-IP fallback (ETH_STATIC_IP / ETH_GATEWAY / ETH_SUBNET) so the node always comes up somewhere.
  • simple_repeater / simple_room_server: shorter boot delay; the repeater also skips CPU sleep, which drops the load below the hold threshold.
  • New envs: RAK_4631_repeater_ethernet_poe, RAK_4631_room_server_ethernet_poe, RAK_4631_companion_radio_ethernet_poe, each extending the matching _ethernet env with -D WITH_W5100S_POE=1.

Testing

  • Builds: the three new envs plus RAK_4631_companion_radio_ethernet, RAK_4631_repeater, RAK_4631_companion_radio_usb.
  • Hardware (RAK10720 behind a UniFi USW-Lite-16-PoE): the companion variant cold-boots on PoE only (no USB, no battery), gets a DHCP address, and Home Assistant plus the phone app connect to it.
  • The repeater and room-server envs build but I have not tested them on PoE hardware yet. Testers welcome; prebuilt firmware for all three: https://github.com/1sthandy/MeshCore/releases/tag/rak10720-poe-eth-2026.11.12 (that build also includes the multi-client PR).

Note

This and the multi-client PR both touch RAK13800EthernetInterface.{h,cpp}, so whichever is merged second will need a small rebase.

🤖 Generated with Claude Code

Lets a RAK4631 with a RAK13800 (W5100S) on a RAK19018 PoE base boot and
stay up on PoE alone, with no battery. Fixes meshcore-dev#2855. Builds on meshcore-dev#1983
(WB_IO2 rail power) and the RAK13800EthernetInterface refactor (meshcore-dev#3049).

The RAK19018's Silvertel Ag9905MT converter folds back and resets unless
it sees a continuous load of ~125 mA or more, which a bare MeshCore node
does not draw. All changes are gated by the new WITH_W5100S_POE flag and
only apply to the new *_ethernet_poe envs:

- W5100SPoE: release the W5100S reset in an early constructor and run a
  bit-banged soft-reset/VERSIONR read from board.begin(), so the chip
  draws its full current before the converter's foldback timer expires.
- RAK4631Board: skip the boot-voltage check (voltage_bootlock = 0); with
  no battery, the floating ADC pin would otherwise force a SYSTEMOFF loop.
- RAK13800EthernetInterface / EthernetCLI: defer the disruptive library
  bring-up (PHY soft-reset + blocking DHCP) by ~6 s, until the converter
  has latched, and use a bounded DHCP timeout with a static-IP fallback.
- simple_repeater / simple_room_server: shorter boot delay, and no CPU
  sleep on the repeater (it drops the load below the hold threshold).
- New envs: RAK_4631_{repeater,room_server,companion_radio}_ethernet_poe.

Tested on a RAK10720 behind a UniFi USW-Lite-16-PoE (companion variant):
cold boot on PoE only, DHCP, and Home Assistant plus the phone app
connected. The repeater and room-server envs build but are not yet
tested on PoE hardware.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@1sthandy

Copy link
Copy Markdown
Author

@liamcottle — you wrote the RAK13800EthernetInterface refactor (#3049) that this builds on, so I'd value your read on whether this is the right shape before it goes further.

Short version: on a RAK10720 the PoE module's converter resets unless the W5100S is already drawing its full current before the bring-up runs. This PR adds that as a small, opt-in layer (WITH_W5100S_POE, new *_ethernet_poe envs): early chip activation, deferred bring-up, bounded DHCP with a static fallback. The plain _ethernet envs are unchanged. It fixes #2855.

The companion-TCP multi-client change that used to be bundled here is now separate in #3828, so each is easy to review on its own. If you would rather have multi-client support in the shared SerialEthernetInterface base so CH390 benefits as well, I'm happy to rework #3828 that way.

This branch has not been deployed

No deployments
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.

1 participant