From cb90bb69a25b35db249455dcd9ab9c50a4e7797a Mon Sep 17 00:00:00 2001 From: majorlinux Date: Fri, 19 Jun 2026 11:36:06 -0400 Subject: [PATCH] wiki: add Steam Deck Wi-Fi flapping runbook (IWD periodic scan + rtw88 power save) Client-side fix for OG Steam Deck (RTL8822CE/rtw88) flapping ~once a minute on SteamOS: disable IWD periodic scan + disable Wi-Fi power save via NM dispatcher. Cross-linked with the 160MHz airtime article; registered in SUMMARY.md nav. --- ...k-wifi-flapping-iwd-periodic-scan-rtw88.md | 133 ++++++++++++++++++ ...60mhz-airtime-saturation-game-streaming.md | 1 + SUMMARY.md | 1 + 3 files changed, 135 insertions(+) create mode 100644 05-troubleshooting/networking/steam-deck-wifi-flapping-iwd-periodic-scan-rtw88.md diff --git a/05-troubleshooting/networking/steam-deck-wifi-flapping-iwd-periodic-scan-rtw88.md b/05-troubleshooting/networking/steam-deck-wifi-flapping-iwd-periodic-scan-rtw88.md new file mode 100644 index 0000000..ed52503 --- /dev/null +++ b/05-troubleshooting/networking/steam-deck-wifi-flapping-iwd-periodic-scan-rtw88.md @@ -0,0 +1,133 @@ +--- +title: "Steam Deck Wi-Fi Flapping: IWD Periodic Scan + rtw88 Power Save" +domain: troubleshooting +category: networking +tags: [wifi, steam-deck, steamos, iwd, networkmanager, rtw88, rtl8822ce, power-save, supplicant-disconnect, flapping] +status: published +created: 2026-06-19 +updated: 2026-06-19 +--- + +# Steam Deck Wi-Fi Flapping: IWD Periodic Scan + rtw88 Power Save + +## ๐Ÿ›‘ Problem + +An OG Steam Deck (LCD model, Realtek **RTL8822CE** on the `rtw88_8822ce` driver) kept "losing" Wi-Fi โ€” it would connect, hold for around a minute, drop, then reconnect a second later, over and over. From the router side the device looked like it was constantly coming and going; from the couch it felt like the network "wouldn't stay connected." + +Crucially, **this was not a router problem.** The AP config was correct, RF was clean (strong signal, zero tx retries / beacon loss), and every other client on the network was rock-solid. The fault was entirely on the Deck. + +## ๐Ÿ” Diagnosis + +SteamOS uses **NetworkManager with the `iwd` backend** (not `wpa_supplicant`). That detail is the whole ballgame. + +### Step 1 โ€” Confirm the flap and its cadence + +```bash +# how many disconnects this boot? +journalctl -b -u NetworkManager --no-pager | grep -c supplicant-disconnect +# 50 + +# when did they happen? +journalctl -b -u NetworkManager --no-pager | grep supplicant-disconnect \ + | awk '{print $1,$2,$3}' | tail +# 10:20:52 ยท 10:21:54 ยท 10:22:57 ยท 10:24:00 ยท 10:25:03 ยท 10:26:05 ยท 10:27:08 ... +``` + +**~63 seconds between every drop.** A fixed, metronome-like interval is the tell โ€” this is a *timer*, not RF noise. The NetworkManager log shows the pattern plainly: + +``` +activated -> failed (reason 'supplicant-disconnect') +... -> activated # reconnects ~1s later +``` + +### Step 2 โ€” Prove the link is healthy *when it's up* + +```bash +iw dev wlan0 station dump | grep -iE 'signal|bitrate|failed|retries|beacon loss' +# signal: -65 dBm +# tx retries: 0 +# tx failed: 0 +# beacon loss: 0 +``` + +Strong signal, zero retries, zero beacon loss โ€” the association is clean while it lasts. So the drop is being *commanded*, not caused by a bad radio link. + +### Step 3 โ€” Identify the chip and the backend + +```bash +lspci -k | grep -A3 -iE 'network|wireless' +# Realtek RTL8822CE ... Kernel driver in use: rtw88_8822ce +``` + +The `~63s` interval is **IWD's default periodic background scan**. With no `/etc/iwd/main.conf` present, IWD scans on a timer even while connected, and on the `rtw88` driver that scan knocks the current association over โ€” producing the `supplicant-disconnect` every minute. + +A secondary annoyance: `iw dev wlan0 get power_save` reported `on`, which showed up as wildly jittery LAN latency (8โ€“69 ms to the gateway over Wi-Fi, where a healthy 5 GHz link is 2โ€“10 ms). + +## โœ… Fix + +Two independent changes โ€” the first stops the flap, the second smooths latency. + +### 1. Disable IWD's periodic scan (stops the flap) + +```bash +sudo mkdir -p /etc/iwd +printf '[Scan]\nDisablePeriodicScan=true\n' | sudo tee /etc/iwd/main.conf +sudo systemctl restart iwd # briefly drops Wi-Fi; NetworkManager auto-reconnects +``` + +Trade-off: with periodic scanning off, the Deck roams to a different/stronger AP (e.g. another AiMesh node) more lazily. Fine for a device that mostly sits in one spot. + +### 2. Disable Wi-Fi power save (kills the latency jitter) + +The obvious `nmcli connection modify 802-11-wireless.powersave 2` **does not work under the IWD backend** โ€” NetworkManager doesn't enforce that property when `iwd` is managing the radio. Use a dispatcher script instead, with a retry loop because `rtw88` won't accept the setting in the first instant after association on a cold boot: + +```bash +sudo tee /etc/NetworkManager/dispatcher.d/90-wifi-powersave >/dev/null <<'SCRIPT' +#!/bin/sh +# Disable Wi-Fi power save on the wireless iface (retry: rtw88 may not accept it instantly on boot) +case "$2" in + up|dhcp4-change|connectivity-change) + case "$1" in + wl*) + for n in 1 2 3 4 5; do + /usr/bin/iw dev "$1" set power_save off 2>/dev/null + [ "$(/usr/bin/iw dev "$1" get power_save 2>/dev/null)" = "Power save: off" ] && break + sleep 1 + done + ;; + esac + ;; +esac +SCRIPT +sudo chmod +x /etc/NetworkManager/dispatcher.d/90-wifi-powersave +sudo iw dev wlan0 set power_save off # apply now without waiting for a reconnect +``` + +> ๐Ÿ’ก A single-shot dispatcher (no retry) **silently fails on a cold boot** โ€” it fires before the interface is ready, the `iw` call no-ops, and power save stays on. Verify with `iw get power_save` *after a real reboot*, not just after a service restart. + +## ๐Ÿ” Verification + +```bash +# was 50/boot, ~once a minute: +journalctl -b -u NetworkManager --no-pager | grep -c supplicant-disconnect +# 0 +iw dev wlan0 get power_save +# Power save: off +``` + +A 3-minute continuous `ping` showed **180/180 replies, 0 loss**, latency tightened to **6โ€“11 ms**. Confirmed across a full cold reboot: the Deck auto-rejoins Wi-Fi, both settings persist, and the disconnect counter stays at 0. + +## ๐Ÿ“Œ Notes + +- **Persistence:** `/etc/iwd/main.conf` and the dispatcher live in `/etc`, which survives reboots. A major SteamOS update *can* reset `/etc` โ€” re-apply if the flapping returns after an OS update. +- **Fully reversible:** + ```bash + sudo rm /etc/iwd/main.conf /etc/NetworkManager/dispatcher.d/90-wifi-powersave + sudo systemctl restart iwd + ``` +- **Interface name** is usually `wlan0`; confirm with `iw dev` if different. +- The same IWD-periodic-scan behavior can affect other `iwd`-based distros (Arch, some Fedora spins) on flaky/older Wi-Fi chips โ€” the `DisablePeriodicScan` fix is general, not Deck-specific. + +## ๐Ÿ”— Related + +- [Wi-Fi Game Streaming Stutter: 160 MHz Channel Width Saturating the 5 GHz Radio](wifi-160mhz-airtime-saturation-game-streaming.md) โ€” the *other* Steam Deck Wi-Fi issue (airtime contention, router-side), distinct from this client-side flap. diff --git a/05-troubleshooting/networking/wifi-160mhz-airtime-saturation-game-streaming.md b/05-troubleshooting/networking/wifi-160mhz-airtime-saturation-game-streaming.md index bc85c3c..a8d357a 100644 --- a/05-troubleshooting/networking/wifi-160mhz-airtime-saturation-game-streaming.md +++ b/05-troubleshooting/networking/wifi-160mhz-airtime-saturation-game-streaming.md @@ -109,6 +109,7 @@ The PHY peak dropped (narrower channel) but that is irrelevant โ€” Steam Remote ## Related +- [Steam Deck Wi-Fi Flapping: IWD Periodic Scan + rtw88 Power Save](steam-deck-wifi-flapping-iwd-periodic-scan-rtw88.md) โ€” the *other* Steam Deck Wi-Fi issue (client-side flap), distinct from this router-side airtime problem. - [Network Overview](../../02-selfhosting/dns-networking/network-overview.md) - [Wake-on-LAN via Router SSH](../../02-selfhosting/dns-networking/wake-on-lan-router-ssh.md) - [Pi-hole v6 Group Management โ€” Per-Client DNS Rules](../../02-selfhosting/dns-networking/pihole-v6-group-management.md) diff --git a/SUMMARY.md b/SUMMARY.md index dfa413c..47fcd81 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -80,6 +80,7 @@ updated: 2026-06-19T10:05 * [Plex Transcoding Troubleshooting](04-streaming/plex/plex-transcoding-troubleshooting.md) * [Troubleshooting](05-troubleshooting/index.md) * [Wi-Fi Game Streaming Stutter: 160 MHz Channel Width Saturating the 5 GHz Radio](05-troubleshooting/networking/wifi-160mhz-airtime-saturation-game-streaming.md) + * [Steam Deck Wi-Fi Flapping: IWD Periodic Scan + rtw88 Power Save](05-troubleshooting/networking/steam-deck-wifi-flapping-iwd-periodic-scan-rtw88.md) * [Apache Outage: Fail2ban Self-Ban + Missing iptables Rules](05-troubleshooting/networking/fail2ban-self-ban-apache-outage.md) * [Postfix + SendGrid: TLS Handshake Failure (Port 465 vs 587)](05-troubleshooting/networking/postfix-sendgrid-tls-handshake-failure.md) * [Mail Client Stops Receiving: Fail2ban IMAP Self-Ban](05-troubleshooting/networking/fail2ban-imap-self-ban-mail-client.md)