RPi 5 & OpenWrt: Internal BCM4345/6 WiFi Fails on 2.4GHz (Regulatory 'country 99' Issue)

Hello everyone,

I'm documenting a significant issue with the Raspberry Pi 5's internal WiFi when using OpenWrt, and a reliable workaround for it.

The TL;DR:

The RPi 5's built-in BCM4345/6 WiFi fails to operate on the 2.4GHz band under OpenWrt (tested with snapshot 24.10.1). The driver gets stuck with a regulatory domain of country 99: DFS-UNSET , ignores all 2.4GHz channel settings, and fails to bring the interface up.

My Setup:

Device: Raspberry Pi 5 Model B

Operating System: OpenWrt 24.10.1 (Snapshot)

Internal WiFi: Broadcom BCM4345/6 (brcmfmac driver), intended for a 2.4GHz AP.

External WiFi: USB WiFi Adapter (MT76x2U), configured for 5GHz (this adapter works flawlessly).

Regulatory Domain: Romania (RO)

The Problem in Detail:

My goal is a dual-band AP setup. While the 5GHz USB adapter works perfectly, the internal chip's 2.4GHz network (phy0-ap0 ) is never discoverable.

My diagnostics show the core issue is a regulatory domain conflict. Despite setting the country code to RO in OpenWrt's configuration, the brcmfmac driver for the internal chip refuses to accept it.

iw reg get shows the global config is correct, but the phy is stuck:

phy#0
country 99: DFS-UNSET
(2402 - 2472 @ 40), (N/A, 20), (N/A)
(2457 - 2482 @ 20), (N/A, 20), (N/A), NO-IR
...
(5170 - 5250 @ 80), (N/A, 20), (N/A), NO-IR, AUTO-BW

The AP interface ignores my channel settings (e.g., channel 6 / 2437 MHz) and is instead stuck on a disabled 5GHz channel:

phy0-ap0 (on phy0)
Interface state: disabled
Type: AP
Channel: 34 (5170 MHz)
Width: 20 MHz

The system log confirms hostapd cannot set up the interface due to this conflict:

logread | grep "hostapd.*phy0"

Output includes:

daemon.err hostapd: phy0-ap0: Unable to setup interface.

daemon.notice hostapd: phy0-ap0: interface state COUNTRY_UPDATE->DISABLED

Troubleshooting Steps I've Already Taken:

I have tried extensively to force the correct regulatory domain without success:

Configuration: Set option country 'RO' in /etc/config/wireless and tried various 2.4GHz channels and HT modes. All settings are ignored by the driver.

Manual iw Commands: iw dev phy0-ap0 set freq 2437 is ignored.

Module Parameters: Reloading the brcmfmac kernel module with modprobe brcmfmac country=RO had no effect.

Firmware Text File: I added ccode=RO to /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt . This also had no effect.

You can set any EU country, like DE or FR.

Please revert to unmodified firmwares and start with wifi disabled and start AP only after setting country code.
Dont be shy, show FULL OUTPUT of iw reg get , as it seems you are concealing that CC is actually set which does not go with your storyline of "conflict" (whatever that means) and "ignored"

2 Likes

plus learn how to use the </> button to wrap cli output when posting at the forum.

1 Like

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/wireless
iw reg set RO
iw reg get
iw list | tee -a /tmp/wifi_capabilities.txt ;: upload the file as attachment.

Who told you to use iw when with other hand you clearly use hostapd/wpa_supplicant?

1 Like

root@OpenWrt-Pi5:~# iw reg get
global
country RO: DFS-ETSI
(2400 - 2483 @ 40), (N/A, 20), (N/A)
(5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
(5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
(5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
(5725 - 5875 @ 80), (N/A, 13), (N/A)
(5945 - 6425 @ 320), (N/A, 23), (N/A), NO-OUTDOOR
(57000 - 66000 @ 2160), (N/A, 40), (N/A)

root@OpenWrt-Pi5:~# ubus call system board
{
"kernel": "6.6.86",
"hostname": "OpenWrt-Pi5",
"system": "ARMv8 Processor rev 1",
"model": "Raspberry Pi 5 Model B Rev 1.0",
"board_name": "raspberrypi,5-model-b",
"rootfs_type": "ext4",
"release": {
"distribution": "OpenWrt",
"version": "24.10.1",
"revision": "r28597-0425664679",
"target": "bcm27xx/bcm2712",
"description": "OpenWrt 24.10.1 r28597-0425664679",
"builddate": "1744562312"
}
}
root@OpenWrt-Pi5:~# cat /etc/config/wireless

config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/axi/1000120000.pcie/1f00300000.usb/xhci-hcd.1/usb4/4-1/4-1:1.0'
option band '5g'
option channel '44'
option htmode 'VHT80'
option disabled '0'

config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt-Pi5-WiFi-5G-High'
option encryption 'psk2'
option key '123456'

config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/axi/1001100000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
option band '2g'
option channel '6'
option htmode 'HT20'
option disabled '1'
option country 'RO'

config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt-Pi5-2G'
option encryption 'psk2'
option key '123456'

root@OpenWrt-Pi5:~# iw reg set RO
root@OpenWrt-Pi5:~# iw reg get
global
country RO: DFS-ETSI
(2400 - 2483 @ 40), (N/A, 20), (N/A)
(5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
(5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
(5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
(5725 - 5875 @ 80), (N/A, 13), (N/A)
(5945 - 6425 @ 320), (N/A, 23), (N/A), NO-OUTDOOR
(57000 - 66000 @ 2160), (N/A, 40), (N/A)

root@OpenWrt-Pi5:~# iw list | tee -a /tmp/wifi_capabilities.txt
Wiphy phy2
wiphy index: 2
max # scan SSIDs: 4
max scan IEs length: 2243 bytes
max # sched scan SSIDs: 0
max # match sets: 0
Retry short limit: 7
Retry long limit: 4
Coverage class: 0 (up to 0m)
Device supports AP-side u-APSD.
Device supports T-DLS.
Available Antennas: TX 0x3 RX 0x3
Configured Antennas: TX 0x202 RX 0x202
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* monitor
* mesh point
* P2P-client
* P2P-GO
Band 1:
Capabilities: 0x1ff
RX LDPC
HT20/HT40
SM Power Save disabled
RX Greenfield
RX HT20 SGI
RX HT40 SGI
TX STBC
RX STBC 1-stream
Max AMSDU length: 3839 bytes
No DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: No restriction (0x00)
HT TX/RX MCS rate indexes supported: 0-15
Frequencies:
* 2412.0 MHz [1] (20.0 dBm)
* 2417.0 MHz [2] (20.0 dBm)
* 2422.0 MHz [3] (20.0 dBm)
* 2427.0 MHz [4] (20.0 dBm)
* 2432.0 MHz [5] (20.0 dBm)
* 2437.0 MHz [6] (20.0 dBm)
* 2442.0 MHz [7] (20.0 dBm)
* 2447.0 MHz [8] (20.0 dBm)
* 2452.0 MHz [9] (20.0 dBm)
* 2457.0 MHz [10] (20.0 dBm)
* 2462.0 MHz [11] (20.0 dBm)
* 2467.0 MHz [12] (20.0 dBm)
* 2472.0 MHz [13] (20.0 dBm)
* 2484.0 MHz [14] (disabled)
Band 2:
Capabilities: 0x1ff
RX LDPC
HT20/HT40
SM Power Save disabled
RX Greenfield
RX HT20 SGI
RX HT40 SGI
TX STBC
RX STBC 1-stream
Max AMSDU length: 3839 bytes
No DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: No restriction (0x00)
HT TX/RX MCS rate indexes supported: 0-15
VHT Capabilities (0x318001b0):
Max MPDU length: 3895
Supported Channel Width: neither 160 nor 80+80
RX LDPC
short GI (80 MHz)
TX STBC
RX antenna pattern consistency
TX antenna pattern consistency
VHT RX MCS set:
1 streams: MCS 0-9
2 streams: MCS 0-9
3 streams: not supported
4 streams: not supported
5 streams: not supported
6 streams: not supported
7 streams: not supported
8 streams: not supported
VHT RX highest supported: 0 Mbps
VHT TX MCS set:
1 streams: MCS 0-9
2 streams: MCS 0-9
3 streams: not supported
4 streams: not supported
5 streams: not supported
6 streams: not supported
7 streams: not supported
8 streams: not supported
VHT TX highest supported: 0 Mbps
VHT extended NSS: not supported
Frequencies:
* 5180.0 MHz [36] (19.0 dBm)
* 5200.0 MHz [40] (19.0 dBm)
* 5220.0 MHz [44] (19.0 dBm)
* 5240.0 MHz [48] (19.0 dBm)
* 5260.0 MHz [52] (19.0 dBm) (radar detection)
* 5280.0 MHz [56] (19.0 dBm) (radar detection)
* 5300.0 MHz [60] (19.0 dBm) (radar detection)
* 5320.0 MHz [64] (19.0 dBm) (radar detection)
* 5500.0 MHz [100] (19.0 dBm) (radar detection)
* 5520.0 MHz [104] (19.0 dBm) (radar detection)
* 5540.0 MHz [108] (19.0 dBm) (radar detection)
* 5560.0 MHz [112] (19.0 dBm) (radar detection)
* 5580.0 MHz [116] (19.0 dBm) (radar detection)
* 5600.0 MHz [120] (19.0 dBm) (radar detection)
* 5620.0 MHz [124] (19.0 dBm) (radar detection)
* 5640.0 MHz [128] (19.0 dBm) (radar detection)
* 5660.0 MHz [132] (19.0 dBm) (radar detection)
* 5680.0 MHz [136] (19.0 dBm) (radar detection)
* 5700.0 MHz [140] (19.0 dBm) (radar detection)
* 5720.0 MHz [144] (13.0 dBm) (radar detection)
* 5745.0 MHz [149] (13.0 dBm)
* 5765.0 MHz [153] (13.0 dBm)
* 5785.0 MHz [157] (13.0 dBm)
* 5805.0 MHz [161] (13.0 dBm)
* 5825.0 MHz [165] (13.0 dBm)
* 5845.0 MHz [169] (13.0 dBm)
* 5865.0 MHz [173] (13.0 dBm)
* 5885.0 MHz [177] (disabled)
valid interface combinations:
* #{ IBSS } <= 1, #{ managed, AP, mesh point, P2P-client, P2P-GO } <= 2,
total <= 2, #channels <= 1, STA/AP BI must match
HT Capability overrides:
* MCS: ff ff ff ff ff ff ff ff ff ff
* maximum A-MSDU length
* supported channel width
* short GI for 40 MHz
* max A-MPDU length exponent
* min MPDU start spacing
max # scan plans: 1
max scan plan interval: -1
max scan plan iterations: 0
Supported extended features:
* [ VHT_IBSS ]: VHT-IBSS
* [ RRM ]: RRM
* [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
* [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
* [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
* [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
* [ SCAN_RANDOM_SN ]: use random sequence numbers in scans
* [ SCAN_MIN_PREQ_CONTENT ]: use probe request with only rate IEs in scans
* [ AIRTIME_FAIRNESS ]: airtime fairness scheduling
* [ AQL ]: Airtime Queue Limits (AQL)
* [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
* [ DEL_IBSS_STA ]: deletion of IBSS station support
* [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
* [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
* [ POWERED_ADDR_CHANGE ]: can change MAC address while up
root@OpenWrt-Pi5:~#

ChatGPT and Claude.

Whtaver you did the builtin wifi adapter is no longer configurable at all and USB wifi popped up out of nowhere.

1 Like

Thank you for not paying attention.