Add RAK4631 / RAK10720 PoE + Ethernet companion support (W5100S/RAK13800) 🤖🤖#2679
Add RAK4631 / RAK10720 PoE + Ethernet companion support (W5100S/RAK13800) 🤖🤖#26791sthandy wants to merge 5 commits into
Conversation
57a9988 to
e513038
Compare
|
Is this duplicating the work in #1983 ? I believe these are both targeting the same hardware, no? |
|
Thanks for flagging it — yes, there's real overlap with #1983 on the base W5100S Ethernet support (we even independently ended up with a similarly named The part that's genuinely additive in this PR is PoE support for the RAK19018 (Silvertel) module, which #1983 doesn't cover:
The whole point of the PoE work is that it makes the node fully self-sufficient over a single cable: the device draws both data and power from the LAN, so it needs no separate power supply at all. That's what makes it practical to deploy as an Ethernet gateway where running a second power lead isn't convenient (ceiling, mast, remote closet, outdoor enclosure, etc.) — which is exactly how my device runs. If #1983 is the preferred Ethernet foundation, I'm happy to rebase this down to just the PoE-specific delta on top of it (or close this and re-submit the PoE bits as a follow-up to #1983). Which would you prefer? |
|
For the record, I have the RAK "MQTT Ethernet Gateway" kit. With just normal MeshCore firmware, the PoE hat DOES power the device, even though nothing is explicitly initialized. However, for it to work reliably, I had to add a battery. I am using an enterprise switch, and the board at time draws so little power, the switch thinks the device is gone and powers down the port. This is apparently quite commonly reported on the Internet from some Google searches I did when I first got it, and also happens with Meshtastic, for which there is full Ethernet support implemented. With battery attached, the board never dies, as the battery keeps it alive when the switch turns the port power off, and then when its recharging the battery, it pulls enough watts for the power power to re-activate. (The alternative is to use a passive 48v PoE injector, but I refuse to do that.) I don't really care which PR moves forward. I was just pointing out we have two implementations for the mostly the same thing. TO BE CLEAR -- I am not part of the dev team. So not part of the decision for which goes forward. My real desire is whichever moves forward, work is done to support MESH_PACKET_LOGGING (to enable use with mctomqtt) and/or the KISS firmware variant is supported (to enable use with pyMC). I will add that I think DHCP MUST be supported. Requiring static IP only would not work for people with enterprise setups where security is configured. |
|
I'm planning a repeater with a network, and I think that commit ( http://github.com/meshcore-dev/MeshCore/pull/1983 ) is more interesting. I would ask you, if it is not difficult for you, to transfer your logic for working with "POE" in addition to that code. |
|
Update: DHCP is now implemented and is the default (just pushed). Since the static-IP-only concern was the main blocker, I worked out a PoE-safe way to do DHCP:
Tested on RAK4631 + RAK13800 + RAK19018: repeated PoE-only cold starts (no USB) come up reliably with the DHCP-assigned address, and a DHCP reservation on the router gives a stable IP for Home Assistant — which covers the managed/enterprise case. So this PR now provides DHCP and the PoE-specific handling. I'm still happy to rebase the PoE bits on top of #1983 if that's the preferred Ethernet foundation — just let me know which direction the maintainers want. |
|
I've been trying to get my change merged in for a while -- got reviewed by a couple of maintainers but then radio silence. Identifying and fixing the POE issues is a great value add, that was my end goal but I was starting small to enable one system at a time. I'd love to see a solution get merged here -- either mine or yours, it doesn't really matter to me as long as we have working ETH support for all three firmware types. |
|
really eagerly awaiting this, have been watching @rgregg 's PR for a long while now to see if it could finally be merged. POE/tcp connectivity is a pretty fundamental offering of the 4631 and not having it available removes most of the utility in using these nodes. If I could build the image myself and use it I would! But I haven't been able to get the process working locally since platformio isn't something I'm familiar with. If one of these could be integrated as at least an option on the flasher, even with a "beta" disclaimer, that would be incredible |
|
I also could not build the firmware with these changes. Firstly, It is not registered correctly in platformio.ini I assembled the firmware by registering the library at the end of section [rak4631] in lib_deps = . And I’m somehow afraid to test the firmware in this form . Ps - Also in #1983 - build&work no problem |
|
FYI I have built firmware based on your PR. Ethernet Companion target to the upstream MeshCore PR #2679 style implementation: WITH_ETHERNET_COMPANION=1 I loaded it last night. Confirmed that it worked. I've left the device on to see if it's stable over time, but you should be able to load my firmware build in order to confirm. I will recompair if there's any difference between your PR and the fw I built. |
|
I'll have to see if I see the same Poe power off issue you've noted above, but I'm using a ubiquity edge switch, I will continue to monitor for that bug. Is there any other functionality missing that we need to add for this board type? |
|
@enigmaspb thanks for the detailed report — you were right about the library. I've switched the dependency from the Meshtastic fork to the official RAKWireless/RAK13800-W5100S, pinned to a commit for reproducibility. It exposes the same Verified end-to-end:
Could you pull the latest and try the build again? It should resolve the fork/registration issue you hit. Thanks for pushing on this — using the official library instead of a third-party fork is clearly the right call for upstream. |
|
@rgregg appreciate the supportive take — and likewise, I mainly care that working Ethernet lands for all three firmware types, whether that's your PR, this one, or a combination of the two. Right now I've just switched this PR to the official RAKWireless library (the Meshtastic fork was causing build failures for a couple of people), so I'd like to give @enigmaspb and the others a chance to re-confirm the build works before taking any bigger steps. Once that's confirmed — and if a maintainer can signal which Ethernet foundation they'd prefer to build on — I'm very happy to align the PoE handling on top of it. The PoE bits (power/reset sequencing, no-sleep, boot-voltage bypass, deferred bring-up) are largely independent of the transport layer, so they should port cleanly onto whichever base moves forward. A short steer from a maintainer on the preferred direction would really help get this over the line after the long wait. |
|
@1sthandy I tested the build firmware. All build errors: My thoughts (I don't program it) PS - A small question, you don’t know, will the RS232 bridge work with the network? and what will it be Serial1 or Serial2 ? |
|
@enigmaspb great catch, and thank you for the exact error output — that pinpointed the real bug (it wasn't the library URL after all). Root cause: Your workaround (adding the lib to the global Verified locally: On your RS232-bridge question: there's no hardware conflict — the RS232 bridge uses a UART ( The catch is at the firmware level: the RS232 bridge currently lives in the |
|
Good news, I'm glad I could help and thanks for the explanation about the bridge. PS - By the way, another question, is it possible to make firmware with control both over the network and via BLE? |
|
And yes, I confirm that the build-matching-firmwares RAK_4631 build was successful |
|
Thanks for confirming the full On controlling over both network and BLE: good question, and there are two cases:
I'd treat the fallback as a nice follow-up rather than expanding this PR, so we can keep this one focused and mergeable — but it's a clean, self-contained addition when the time comes. Your 868↔433 bridge with PoE sounds like a great use case. Good luck with the 433 modules — happy to help think through the combined build when you're at that stage. |
|
Thanks again for your detailed answers. Regarding BLE, I am used to preparing reserve options in case of failure of any element of the system, and therefore I consider the situation of network failure and the possibility of control via BLE as a reserve. about assembling the bridge - the most difficult thing was to correctly distribute the modules on the base board, as it turned out this is not a trivial task. |
|
Fully agree — let's revisit the BLE-fallback once network support is in |
|
For anyone who wants to try this without building locally, I've put pre-built EU868 binaries on my fork's releases: 👉 https://github.com/1sthandy/MeshCore/releases/tag/rak10720-poe-eth-2026.07.04
Each comes as a |
|
@1sthandy i tried out the ethernet companion firmware. Seems to work for a while and then the device seems to freeze. Not stable |
|
@metrafonic |
|
@1sthandy Its a bit hard to tell what is wrong. It suddenly stops responding to requests over the network. No ping etc. I am running https://github.com/jkingsman/Remote-Terminal-for-MeshCore against the node. The rak drop in replaced a HeltecV4. Running the eth module with poe. |
Adds support for running a RAK4631 over PoE using the RAK13800 (W5100S)
Ethernet module on a RAK19018 base, in two roles:
- PoE repeater: powers up reliably on the RAK19018 (Silvertel) converter.
The cold-start path is shortened and CPU sleep is disabled, because
dropping below the converter's hold current makes it fold back and
reset. Boot-voltage protection is bypassed when battery-less on PoE.
- Ethernet companion: exposes the MeshCore companion protocol as a TCP
server (default port 5000) over the W5100S, so Home Assistant connects
to the device's IP. Uses a static IP to avoid blocking DHCP at cold
start. W5100S PHY bring-up is deferred out of setup() into loop() to
avoid collapsing the marginal PoE supply during the cold-start window.
New files:
- src/helpers/SerialEthernetInterface.{cpp,h}: TCP transport for the
companion serial frame protocol.
- variants/rak4631/W5100SPoE.{cpp,h}: W5100S power/reset + init helper.
New platformio envs:
- RAK_4631_repeater_poe (+ _debug)
- RAK_4631_companion_radio_eth
All additions are guarded by WITH_W5100S_POE / WITH_ETHERNET_COMPANION,
so existing RAK4631 builds are unaffected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
DHCP is now the default for the Ethernet companion, addressing the need for DHCP in managed/enterprise networks. It is done PoE-safely: - deferred to loop() after the converter is latched (~6 s), so the blocking DHCP exchange can't collapse the supply at cold start; - bounded timeout (12 s lease / 4 s response) instead of the 60 s default; - falls back to the static IP if no DHCP server answers, so the node is always reachable and never reboot-loops; - Ethernet.maintain() renews the lease. Use a DHCP reservation on the router for a stable address. Add -D ETH_STATIC_ONLY to opt out of DHCP and use the static IP directly. Tested on RAK4631 + RAK13800 + RAK19018: repeated PoE-only cold starts come up reliably with the DHCP-assigned address. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…/nrf52) SerialEthernetInterface lived in src/helpers/, which the base build_src_filter compiles for EVERY variant via `+<helpers/*.cpp>`. Its `#include <RAK13800_W5100S.h>` then broke all non-Ethernet RAK4631 builds (repeater, room server, companion usb/ble, ...) with "RAK13800_W5100S.h: No such file or directory", since that library is only a dependency of the Ethernet env. Move it into src/helpers/nrf52/ (a subdirectory the base filter does NOT glob), matching how SerialBLEInterface is handled, and include it explicitly only in the Ethernet env via `+<helpers/nrf52/SerialEthernetInterface.cpp>`. Now every RAK4631 variant builds, and only the Ethernet build pulls in the W5100S library.
meshcore-dev#1983 landed a generic RAK4631 Ethernet base (repeater/room_server/companion envs, single-client SerialEthernetInterface, EthernetCLI telnet CLI) and independently added the same WB_IO2 rail-power fix we found for PoE boot. Layer the remaining PoE-specific delta on top of it instead of duplicating: - W5100SPoE: drop the now-redundant WB_IO2 early-ctor code (covered by meshcore-dev#1983's own constructor), keep only the early W5100S RST release and the bit-bang activation/VERSIONR check. - SerialEthernetInterface: add PoE-safe deferred bring-up (Ethernet.init/ begin() moved out of begin() into loop(), gated by an _hwReady flag, so the disruptive PHY soft-reset + DHCP can't collapse the marginal PoE supply at cold start) and bounded DHCP with a static-IP fallback. - EthernetCLI: same deferral (vTaskDelay before hardware bring-up) and bounded DHCP + static fallback for the repeater/room_server telnet path. - platformio.ini: add RAK_4631_{repeater,room_server,companion_radio} _ethernet_poe envs extending meshcore-dev#1983's _ethernet envs with WITH_W5100S_POE. Verified: all three new _poe envs build, plus the plain _ethernet envs and non-Ethernet variants (no cross-variant breakage). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The commented-out debug flag still referenced meshcore-dev#1983's original macro name (ETHERNET_DEBUG_LOGGING). SerialEthernetInterface.h now checks ETH_DEBUG_LOGGING after the merge with our multi-client/PoE-deferred implementation, so the comment was stale and enabling it would have done nothing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
8efd1fc to
108bced
Compare
|
@enigmaspb #1983 works out of the box on this eth adapter with or without the poe module. I dont understand why there is meant to be code for a poe version. I have the #1983 version running stable on my eth+poe rak4631 |
|
Rebased onto the merged #1983 foundation (commit What the PoE delta adds on top of #1983:
New envs (all extend the matching #1983
Tested on hardware (RAK10720: RAK4631 + RAK13800/W5100S + RAK19018, UniFi USW-Lite-16-PoE):
Not yet tested on hardware: @metrafonic re: the freeze you saw — that was on an earlier iteration of this branch (before this rebase), so if you get a chance to retest |
|
Prebuilt firmware for testers who don't want to build locally: https://github.com/1sthandy/MeshCore/releases/tag/rak10720-poe-eth-2026.07.25 Built from the current branch tip ( |
|
Great news! |
What
Adds PoE-specific support for running a RAK4631 on a RAK19018 PoE base with the RAK13800 (W5100S) Ethernet module (the RAK10720 "WisMesh Ethernet Gateway") — boots and stays up on PoE alone, with no battery and no separate power supply.
This branch is rebased onto the now-merged #1983 ("Support for RAK ethernet module"), which added the generic RAK4631 Ethernet foundation (envs,
SerialEthernetInterface/EthernetCLI, MAC generation). This PR is now an additive PoE delta on top of #1983, not a parallel implementation — the plain_ethernetenvs from #1983 are untouched; the PoE behavior only applies to the new opt-in envs below.board.begin()returns) and a no-battery boot-voltage bypass.Ethernet.init()/begin()(another PHY soft-reset + blocking DHCP) is deferred ~6s, until after the converter is solidly latched, instead of running immediately insetup()/at task start — doing it immediately reliably collapsed the marginal PoE supply on our hardware.New files
variants/rak4631/W5100SPoE.{cpp,h}— early W5100S RST release + bit-bang SPI activation/VERSIONR check.Changed files (additive, gated by
WITH_W5100S_POE)variants/rak4631/RAK4631Board.cpp— no-battery boot-voltage bypass, calls intoW5100SPoE.src/helpers/nrf52/SerialEthernetInterface.{cpp,h}— multi-client support + PoE-safe deferred bring-up, built on Support for RAK ethernet module #1983's version.src/helpers/nrf52/EthernetCLI.h— same deferred bring-up + bounded DHCP/static fallback for the repeater/room-server telnet CLI path.New PlatformIO envs
Each extends the matching #1983
_ethernetenv, adding-D WITH_W5100S_POE=1:RAK_4631_repeater_ethernet_poeRAK_4631_room_server_ethernet_poeRAK_4631_companion_radio_ethernet_poeDependencies
RAKWireless/RAK13800-W5100Slibrary, as pulled in by Support for RAK ethernet module #1983.Safety / impact
All additions are gated by
WITH_W5100S_POE, so #1983's plain_ethernetenvs and all non-Ethernet RAK4631 builds are unaffected. All RAK4631 envs verified to build cleanly (PoE envs + plain ethernet envs + non-Ethernet variants).Testing
Tested on real hardware (RAK4631 + RAK13800 + RAK19018 — a RAK10720 gateway, UniFi USW-Lite-16-PoE):
RAK_4631_repeater_ethernet_poe/RAK_4631_room_server_ethernet_poebuild clean but aren't yet hardware-verified on PoE — testers welcome. Prebuilt firmware for all three envs: https://github.com/1sthandy/MeshCore/releases/tag/rak10720-poe-eth-2026.07.25