Merged
Conversation
This commit addresses WiFi issues on Raspberry Pi 5 by fixing: 1. Regulatory domain configuration (PHY-specific hint required) 2. WiFi state persistence across reboots (using systemd-rfkill) **Problem:** - brcmfmac driver keeps WiFi soft-blocked until regulatory domain is set - ieee80211_regdom kernel parameter sets global default but PHY won't adopt it without userspace regulatory hint via 'iw reg set' - WiFi state persistence had race conditions between ConnMan and hardware rfkill state on boot **Solution:** **Regulatory Domain (udev-based):** - 85-wifi-regdomain.rules: Triggers when phy0 appears, reads country code from /etc/regdomain, runs 'iw reg set <COUNTRY>' - cfg80211.conf: Sets global regulatory domain default as fallback - Provisioning-friendly: Update /etc/regdomain and run 'iw reg set' **State Persistence (systemd-rfkill):** - Uses standard systemd-rfkill to persist WiFi enable/disable state - wifi-rfkill-migrate.service: One-time migration from ConnMan settings to rfkill state (runs before ConnMan on first boot only) - wifi-nudge.service: Ensures wpa_supplicant registers wlan0 with ConnMan when WiFi is enabled on boot - rfkill is single source of truth, ConnMan synchronizes to match **Architecture:** - udev owns regulatory domain setting - systemd-rfkill owns radio state persistence - ConnMan owns network management - No interference with USB gadget networking (ConnMan starts immediately) **Boot Sequence:** 1. brcmfmac loads → phy0 appears (rfkill registered, default unblocked) 2. udev sets regulatory domain via iw reg set 3. wlan0 appears, brought UP by udev rule 4. systemd-rfkill restores saved rfkill state 5. wifi-rfkill-migrate (first boot only) sets initial state from ConnMan 6. ConnMan starts, reads rfkill state 7. wifi-nudge toggles WiFi if enabled (ensures wpa_supplicant registration) Closes EDG-322
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.
Fixes #EDG-322
Summary
This PR enables full WiFi functionality on Raspberry Pi 5 by upgrading to kernel 6.12 and implementing proper regulatory domain configuration and WiFi state persistence.
Problem
Raspberry Pi 5 WiFi was not working due to several issues:
Root Causes
Solution
Kernel Upgrade (6.6 → 6.12)
WiFi DISTRO_FEATURES
ConnMan CLI Tools
Regulatory Domain Configuration
WiFi State Persistence
Architecture
udev → regulatory domain setting
systemd-rfkill → WiFi radio on/off persistence
ConnMan → network management
Boot Sequence
Testing
Verified on Raspberry Pi 5:
Usage
Enable WiFi:
connmanctl enable wifi
connmanctl scan wifi
connmanctl services
Set Country Code (optional):
echo "US" > /etc/regdomain
iw reg set US
Files Changed
References