feat(wolwifi): Wake-on-LAN over Wi-Fi (Waveshare RP2350B-Plus-W) - #120
Open
gunCannoli wants to merge 4 commits into
Open
gunCannoli wants to merge 4 commits into
gunCannoli wants to merge 4 commits into
Conversation
Release DS5 Bridge 1.7.0
fix: correct persona microphone handling
gunCannoli
force-pushed
the
feature/wol-wifi
branch
from
August 15, 2026 15:24
c57fde8 to
7556aad
Compare
Author
gunCannoli
force-pushed
the
feature/wol-wifi
branch
from
August 15, 2026 16:03
7556aad to
2842a86
Compare
Adds an isolated wolwifi.cpp/.h module gated behind ENABLE_WOLWIFI, wired into the existing Bluetooth connect path in bt.cpp with a single call site at the point a connection becomes Ready. Other boards build unaffected via no-op stubs. - Host-alive gate (ObserveHost): an event-driven observation window checks whether the target PC already looks awake over USB before firing WOL, so a PC that's already on doesn't get a pointless magic packet + lightbar pulse. Backed by a new usb_host_active() query in usb.cpp/.h. - Wi-Fi connect reuses the CYW43 radio already initialized for Bluetooth. - Magic packet send with resend-until-confirmed: watches for the target to come back on the network via ARP and resends a few times if needed, so one dropped packet on a slow-associating Wi-Fi network doesn't leave the PC asleep. - Wi-Fi/WOL failure (missing network, bad credentials, unreachable target) never blocks or delays Bluetooth pairing, controller input, or audio -- strictly best-effort. - USB-suspend controller power-off is suppressed while a WOL send is in flight, and a pulsing lightbar indicates the send is in progress. - New watchdog_telemetry phase (Wolwifi) so a reboot during the WOL path is distinguishable from other phases in the existing crash-reason report. Requires boards/headers/lwipopts.h (lwIP config for the UDP magic packet send and ARP snoop) and CMakeLists.txt wiring for the Waveshare RP2350B-Plus-W board's ENABLE_WOLWIFI option.
Wires the firmware WOL module up to the companion protocol and app: - New COMMAND_ID values (SET_WOL_ENABLED, SET_WOL_WIFI_SSID, SET_WOL_WIFI_PASSWORD, SET_WOL_TARGET_MAC) at 0x46-0x49, placed after the existing SET_EDGE_PROFILE_SWITCHING_BLOCKED (0x45) so they don't collide with any currently-assigned command ID. PROTOCOL_MINOR bumped to 23 for the new commands and status flag. - src/companion.cpp: command handlers for the four new commands, plus a wolControl status flag (protocol-minor gated) so the companion app can tell whether the connected firmware supports WOL at all. - Companion app: new Wake-on-LAN section in Bridge Settings with an enable toggle, Wi-Fi SSID/password fields, and a target MAC address field, wired through preload/IPC/bridge-service the same way existing settings are. Hidden entirely on firmware without ENABLE_WOLWIFI (i.e. wolControl false). Both sides were verified against each other end-to-end on real hardware: controller connects while the target PC is off -> WOL fires, gets ARP-confirmed, PC wakes, controller stays connected through the boot.
gunCannoli
force-pushed
the
feature/wol-wifi
branch
from
August 15, 2026 16:09
2842a86 to
740fc1b
Compare
myusernameiskebab
approved these changes
Aug 31, 2026
|
How does the WOL impact bluetooth stability since the antenna and resources are shared? |
Author
I guess is zero, WOL activity is short-lived and only exists during the wake-up process. |
|
What about hosting a live server for the config? It still has to listen and poll. |
Author
There's no live server anywhere in this, the Wi-Fi/BT radio contention is a few seconds during target host boot. Once the target host/pc is alive Wi-Fi is off and there is zero ongoing impact. |
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.

Summary
Adds Wake-on-LAN over Wi-Fi: when your DualSense controller connects to
the Pico, the firmware can send a real network magic packet to wake your PC
— even from a full shutdown, not just sleep. This is separate from the
existing USB-based "Wake PC on Controller" toggle, which relies on USB
remote wake and only works while the Pico stays connected to a PC that's
merely asleep.
Works on any board with a CYW43 Wi-Fi radio (
ENABLE_WOLWIFI, on by defaultfor Waveshare RP2350B-Plus-W, opt-in via
-DENABLE_WOLWIFI=ONon thedefault Pico 2 W target — same chip). Only tested on Waveshare so far.
Boards without a radio are unaffected, with the feature compiled out via
no-op stubs.
Confirmed working end-to-end on real hardware: controller connects while
the target PC is off → WOL fires, gets ARP-confirmed within ~10s, PC wakes,
controller stays connected through the whole boot with no disconnect.
How it works
ObserveHost) — on controller connect, checkswhether the target PC already looks awake over USB before firing WOL.
Skips the wake if the PC is already on.
Bluetooth, using the SSID/password set in the companion app.
packet, watches for the target via ARP, and resends a few times if
needed so one dropped packet doesn't leave the PC asleep.
solid green once confirmed, then restores the previous color (silently,
with no distinct failure color, if the resend budget runs out).
delays Bluetooth pairing, controller input, or audio. Isolated in
wolwifi.cpp/wolwifi.hwith a single call site into the existingconnect path (
bt.cpp, at the point a connection becomesReady).Companion app
New Wake-on-LAN section in Bridge Settings: enable toggle, Wi-Fi
SSID/password fields, and target MAC address field. Section is hidden
entirely on firmware without
ENABLE_WOLWIFI.Testing
ENABLE_WOLWIFIon by default) and the defaultpico2_wtarget with-DENABLE_WOLWIFI=ONboth build clean, eachproducing a valid
ds5-bridge.uf2.vitestsuite passes (320/320).firmware_logic_tests,usb_descriptor_migration_test,diagnostics_config_test) pass.controller connects → WOL fires → PC wakes, ARP-confirmed, no controller
disconnect during boot); host-alive gate confirmed skipping WOL correctly
when the PC is already on. The
pico2_wbuild is compile-verified only —not run on that hardware.
main/port-dev(v1.7.0) and reconciled the onereal conflict: this branch's
SET_WOL_*command IDs collided withv1.7.0's new
SET_RADIAL_DEADZONES/SET_EDGE_PROFILE_SWITCHING_BLOCKEDat
0x37. WOL's four command IDs now sit at0x46-0x49(
PROTOCOL_MINOR23), past everything currently assigned.Docs
README.md— new "Wake-on-LAN" section: how it works, setup steps,requirements.
Notes for the maintainer
port-devand is up to date with its current tip (through thev1.7.0 merge into
main) — happy to retarget if you'd prefer a differentbase branch.
protocol/companion-app wiring) for easier review — the original
iterative bring-up history (bug-by-bug Wi-Fi/BT contention tuning,
boot-race fixes, host-alive gate redesign, etc.) is preserved on this
fork if useful for context, just not carried into this PR.
pico2_wbuild on real Pico 2 W (or Pico W) hardware before this merges,that'd close the one remaining gap.