Add RAK4631 PoE + Ethernet companion support (W5100S/RAK13800) 🤖🤖#2679
Add RAK4631 PoE + Ethernet companion support (W5100S/RAK13800) 🤖🤖#26791sthandy wants to merge 1 commit into
Conversation
322fc9d to
57a9988
Compare
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>
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. |
What
Adds support for running a RAK4631 over PoE using the RAK13800 (W5100S) Ethernet module on a RAK19018 base, in two roles:
RAK_4631_repeater_poe,+_debug): boots 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.RAK_4631_companion_radio_eth): exposes the MeshCore companion protocol as a TCP server (default port 5000) over the W5100S, so Home Assistant connects directly to the device's IP. Uses a static IP to avoid blocking DHCP at cold start. W5100S PHY bring-up is deferred out ofsetup()intoloop()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(+RAK_4631_repeater_poe_debug)RAK_4631_companion_radio_ethSafety / impact
All additions are guarded by
WITH_W5100S_POE/WITH_ETHERNET_COMPANION, so existing RAK4631 builds are unaffected.Testing
Tested on real hardware (RAK4631 + RAK13800 + RAK19018):