Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reg domain appears unset when onboard Wi-Fi is enabled #199

Open
joshschmelzle opened this issue Sep 19, 2024 · 0 comments
Open

reg domain appears unset when onboard Wi-Fi is enabled #199

joshschmelzle opened this issue Sep 19, 2024 · 0 comments

Comments

@joshschmelzle
Copy link
Member

joshschmelzle commented Sep 19, 2024

With RPi5 + vanilla bookworm OS + Netgear Wi-Fi 6E USB adapter, profiler warns that reg domain appears unset. consider setting it with 'iw reg set XX' even when the reg has been set.

See warning lines:

jerry@raspberrypi:~ $ sudo profiler -i wlan1 --debug 
2024-09-19 02:50:39,336 [DEBUG] start: profiler version 1.0.18
2024-09-19 02:50:39,336 [DEBUG] start: python platform version is 3.11.2
2024-09-19 02:50:39,336 [DEBUG] start: scapy version is 2.5.0
2024-09-19 02:50:39,341 [DEBUG] start: profiler.manager pid 1741
2024-09-19 02:50:39,342 [DEBUG] start: config {'GENERAL': {'channel': 36, 'interface': 'wlan1', 'ssid': 'Profiler 4e0', 'ft_disabled': False, 'he_disabled': False, 'be_disabled': False, 'profiler_tlv_disabled': False, 'listen_only': False, 'hostname_ssid': False, 'files_path': '/var/www/html/profiler', 'frequency': 0}}
2024-09-19 02:50:39,350 [DEBUG] interface: wlan1 has a mac80211 stack
2024-09-19 02:50:39,359 [DEBUG] interface: phy2 maps to provided wlan1
2024-09-19 02:50:39,359 [DEBUG] interface: new wlan1mon will map to phy2
2024-09-19 02:50:39,359 [DEBUG] interface: frequency is set to 5180 which maps to channel 36
2024-09-19 02:50:39,366 [WARNING] interface: reg domain appears unset. consider setting it with 'iw reg set XX'
2024-09-19 02:50:39,366 [WARNING] interface: https://wireless.wiki.kernel.org/en/users/documentation/iw#updating_your_regulatory_domain
2024-09-19 02:50:39,366 [DEBUG] interface: mac: 94:18:65:48:50:cb, channel: 36, driver: mt7921u, driver-version: 6.6.31+rpt-rpi-2712, chipset: NetGear Wireless_Device

iw reg get:

jerry@raspberrypi:~ $ iw reg get
global
country US: DFS-FCC
	(902 - 904 @ 2), (N/A, 30), (N/A)
	(904 - 920 @ 16), (N/A, 30), (N/A)
	(920 - 928 @ 8), (N/A, 30), (N/A)
	(2400 - 2472 @ 40), (N/A, 30), (N/A)
	(5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
	(5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
	(5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
	(5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
	(5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
	(5925 - 7125 @ 320), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
	(57240 - 71000 @ 2160), (N/A, 40), (N/A)

phy#0
country 99: DFS-UNSET
	(2402 - 2482 @ 40), (6, 20), (N/A)
	(2474 - 2494 @ 20), (6, 20), (N/A)
	(5140 - 5360 @ 160), (6, 20), (N/A)
	(5460 - 5860 @ 160), (6, 20), (N/A)

jerry@raspberrypi:~ $ 

The issue in the output above is phy#0 is the onboard BRCM chip and has UNSET in the line.

def check_reg_domain(self) -> None:
"""Check and report the set regulatory domain"""
regdomain_result = run_command(["iw", "reg", "get"])
regdomain = [line for line in regdomain_result.split("\n") if "country" in line]
if "UNSET" in "".join(regdomain):
if "iwlwifi" not in self.driver:
self.log.warning(
"reg domain appears unset. consider setting it with 'iw reg set XX'"
)
self.log.warning(
"https://wireless.wiki.kernel.org/en/users/documentation/iw#updating_your_regulatory_domain"
)
else:
self.log.debug("reg domain set to %s", " ".join(regdomain))
self.log.debug("see 'iw reg get' for details")

Perhaps there is a better way to handle regulatory detection when multiple adapters are present with different drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant