feat(pi): add a Wi-Fi hotspot mode for routerless direct streaming

scripts/pi-hotspot.sh turns the receiver into a WPA2 access point via
NetworkManager (ipv4 shared mode gives the Pi built-in DHCP/NAT at
10.42.0.1), so a sender connects directly with no router in between —
which also sidesteps LAN quirks like unreachable 6to4 addresses, since
the direct link is plain private IPv4. The passphrase is generated on
first use and stored root-only in /etc/screencast-hotspot.conf;
on|off|status subcommands manage it, and off restores normal client
Wi-Fi. The hotspot owns wlan0 while active (documented). No receiver
changes were needed: it already announces on every interface.

nmcli property syntax validated against NetworkManager 1.58 with a
disposable never-activated profile; actual AP bring-up can only be
validated on the Pi.
This commit is contained in:
2026-09-07 14:13:48 +02:00
parent 013c2519dc
commit 41f71fd217
4 changed files with 153 additions and 0 deletions
+19
View File
@@ -90,6 +90,25 @@ Verified behavior: `systemctl stop` results in a clean exit (success,
no restart) and the mDNS announcement is withdrawn — senders stop finding
the receiver immediately.
## Direct link: receiver as a Wi-Fi hotspot
The receiver can run as a Wi-Fi access point, so a sender connects to the
Pi directly with no router in between (on such a direct link the Pi is
plain private IPv4 — no 6to4 or router quirks):
```sh
sudo scripts/pi-hotspot.sh on # prints SSID + generated password
sudo scripts/pi-hotspot.sh status # shows the saved credentials
sudo scripts/pi-hotspot.sh off # back to normal router Wi-Fi
```
While the hotspot is active it owns the Wi-Fi interface: the Pi leaves any
router network, and the Pi is reachable at `10.42.0.1` (SSH included). On
the sender, join the hotspot's Wi-Fi and run `screencast --send`
discovery and streaming then flow over the direct link. The passphrase is
generated on first use and stored in `/etc/screencast-hotspot.conf` (root
only). Override with `--ssid`, `--psk`, or `--band a` (5 GHz).
## Headless receiver (no window manager)
The receiver does not need X11, Wayland, or any window manager: SDL3's