Repository navigation
Conversation
RAK13800EthernetInterface keeps a single EthernetClient and closes the
live connection whenever another client connects, so Home Assistant and
the phone app kick each other off the one socket and keep reconnecting.
Keep up to MAX_ETH_CLIENTS (default 3; the W5100S has 4 sockets, one of
which is the listener) connections open at once:
- per-client connection slot and receive-parser state, with round-robin
polling so one busy client cannot starve the others
- command responses go only to the client that sent the last command;
push frames (code >= 0x80, e.g. adverts or LoRa-RX logs) go to all
- a new client is rejected only when every slot is busy, and a dropped
client frees just its own slot
The framing is unchanged ('<' / '>' + uint16 LE length), and a single
client behaves as before. checkRecvFrame()/writeFrame() are overridden in
RAK13800EthernetInterface only; the shared SerialEthernetInterface base
and the CH390 driver are untouched.
Tested on a RAK10720: Home Assistant and the phone app connected to the
same node at the same time.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 12, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #2679 (which bundled it with PoE support, now #3827). Addresses the same problem as #2972, which targets the pre-refactor file layout.
Problem
RAK13800EthernetInterfaceholds a singleEthernetClientand stops the live connection whenever another client connects. With Home Assistant and the phone app both pointed at the same node, they kick each other off the one socket and reconnect in a loop.Change
Keep up to
MAX_ETH_CLIENTS(default 3; the W5100S has 4 sockets and one is the listener) connections open at once:Framing is unchanged (
</>plus a uint16 LE length), and a single client behaves as before.Scope
Only
RAK13800EthernetInterface.{h,cpp}changes.checkRecvFrame()andwriteFrame()are overridden there because routing to several clients needs per-client state that the shared single-clientSerialEthernetInterfacedoes not track; the shared base,MultiSerialInterface,EthernetInterface.hand the CH390 driver are untouched.available()/read()/write()are kept as trivial stubs only to satisfy the base class's pure-virtual contract. If you would rather have multi-client support in the shared base so CH390 benefits too, I am happy to rework it that way.Testing
RAK_4631_companion_radio_ethernet,RAK_4631_repeater_ethernet.This and #3827 both touch
RAK13800EthernetInterface.{h,cpp}, so whichever is merged second will need a small rebase.🤖 Generated with Claude Code