#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
#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 #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 <[email protected]>
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.
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 <[email protected]>
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 <[email protected]>
The room server never supported RX boosted gain, while the repeater
does. Three consequences on SX1262/SX1268 boards:
- boosted gain was never applied to the radio at boot, so a room server
ran in power-saving RX mode while an identical repeater ran boosted -
a real receive-sensitivity difference with nothing pointing at it
- _prefs.rx_boosted_gain was never initialised (the prefs are memset to
0 before defaults are set), so it defaulted to off
- 'set radio.rxgain on' replied "Error: unsupported" but CommonCLI had
already written the value to prefs and saved them, so a stale setting
survived reboot and was never applied
Mirror the repeater's implementation: initialise the pref default under
the same USE_SX1262/USE_SX1268 and SX126X_RX_BOOSTED_GAIN guards, apply
it during radio init, and override setRxBoostedGain() so the CLI reports
success and takes effect.
Built Heltec_v3_room_server (SX1262) and LilyGo_T3S3_sx1276_room_server
(guards compile out cleanly).
Compile fails due to user_btn not declared in board target.
Fixes:
- Add MomentaryButton declaration for user_btn in variants/xiao_nrf52/target.cpp
- Add momentary button helper include in variants/xiao_nrf52/target.h
- Add extern linkage for MomentaryButton -> user_btn in variants/xiao_nrf52/target.h
SerialEthernetInterface.cpp is compiled for every nRF52 target because
PlatformIO builds all .cpp files under src/. It includes
SerialEthernetInterface.h, which unconditionally pulls in
<RAK13800_W5100S.h> -- a library only present in the RAK4631 Ethernet
env's lib_deps. As a result any other nRF52 board (e.g. Heltec T114)
fails to build with 'RAK13800_W5100S.h: No such file or directory'.
Wrap the contents of both files in '#ifdef ETHERNET_ENABLED' so they
compile to empty translation units on non-Ethernet builds. RAK4631
Ethernet envs define ETHERNET_ENABLED and are unaffected.
Fixes#2985
Improvements:
- Add condition to only turn off display if on (avoids wedging the shutdown on some displays)
- Reset LoRa radio before calling radio_driver.powerOff() to ensure it is in a known good state (and will accept the command)
- Ensure SPI is started so LoRa radio commands can be sent (some shutdowns can happen before this)
- Add gate for P_LORA_NSS pin defined before writing to the pin
setTxTimeoutMs() and setTxBufferSize() are HWCDC-only APIs; calling
them on HardwareSerial (UART-bridge boards like T-Beam) fails to compile.
Co-Authored-By: Adam Gessaman <[email protected]>
The new test_kiss_modem suite needs KissModem headers and sources that
only native_kiss_modem provides. Scope native to test_utils and run both
envs in the unit test workflow.
Switch ESP32-S3 KISS modem environments to HWCDC and move outbound KISS writes to a non-blocking queued frame path so loop() and TX completion keep progressing when the host reads slowly. Add native backpressure regression tests and correct the native_kiss_modem test filter so this suite runs directly with pio test.