TypeError when editing or adding networks on radio0

I have a fresh install of 22.03.0 r19685 on a Netgear R8000 and am configuring the WLANs - I've got networks working on radio1 and radio2 but when I try to edit or add networks on radio0 I get this error:

TypeError: chan.options[0] is undefined

Any suggestions how to fix?

sc84647,

The error is probably due to differences between the 2 radio settings.

I found: https://github.com/openwrt/luci/issues/5951
Where is stated: delete the /etc/config/wireless and reboot
During a reboot the file will be made again (if not exist).
Then try configuring the WLANs.

DG.

could be a drivers limit, Broadcom?

OK tried that, the file does get created again but I still can't edit the interface or add a new interface on radio0.

I found this issue:

which led me to look at the output of uci show wireless:

ireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.path='18000000.axi/bcma0:7/pci0000:00/0000:00:00.0/0000:01:00.0'
wireless.radio0.disabled='1'
wireless.default_radio0=wifi-iface
wireless.default_radio0.device='radio0'
wireless.default_radio0.network='lan'
wireless.default_radio0.mode='ap'
wireless.default_radio0.ssid='OpenWrt'
wireless.default_radio0.encryption='none'
wireless.radio1=wifi-device
wireless.radio1.type='mac80211'
wireless.radio1.path='18000000.axi/bcma0:8/pci0001:00/0001:00:00.0/0001:01:00.0/0001:02:01.0/0001:03:00.0'
wireless.radio1.channel='1'
wireless.radio1.band='2g'
wireless.radio1.htmode='HT20'
wireless.radio1.disabled='1'
wireless.default_radio1=wifi-iface
wireless.default_radio1.device='radio1'
wireless.default_radio1.network='lan'
wireless.default_radio1.mode='ap'
wireless.default_radio1.ssid='OpenWrt'
wireless.default_radio1.encryption='none'
wireless.radio2=wifi-device
wireless.radio2.type='mac80211'
wireless.radio2.path='18000000.axi/bcma0:8/pci0001:00/0001:00:00.0/0001:01:00.0/0001:02:02.0/0001:04:00.0'
wireless.radio2.channel='36'
wireless.radio2.band='5g'
wireless.radio2.htmode='VHT80'
wireless.radio2.disabled='1'
wireless.default_radio2=wifi-iface
wireless.default_radio2.device='radio2'
wireless.default_radio2.network='lan'
wireless.default_radio2.mode='ap'
wireless.default_radio2.ssid='OpenWrt'
wireless.default_radio2.encryption='none'

and the output of iwinfo:

wlan0     ESSID: unknown
          Access Point: 9C:3D:CF:57:CB:BE
          Mode: Client  Channel: 36 (5.180 GHz)
          Center Channel 1: 36 2: unknown
          Tx-Power: 0 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11nac
          Hardware: 14E4:AA52 14E4:AA52 [Broadcom BCM43602]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy0

wlan1     ESSID: unknown
          Access Point: 9C:3D:CF:57:CB:BD
          Mode: Client  Channel: 1 (2.412 GHz)
          Center Channel 1: 1 2: unknown
          Tx-Power: 0 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11bgn
          Hardware: 14E4:AA52 14E4:AA52 [Broadcom BCM43602]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy1

wlan2     ESSID: unknown
          Access Point: 9C:3D:CF:57:CB:BC
          Mode: Client  Channel: 36 (5.180 GHz)
          Center Channel 1: 36 2: unknown
          Tx-Power: 0 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11nac
          Hardware: 14E4:AA52 14E4:AA52 [Broadcom BCM43602]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy2

But I'm not sure where to go from here.

iw phy0 info

sc84647,

The issue you found, looks the same, but is on other hardware (not broadcom).
Your device is a Broadcom, and has already some issues: https://openwrt.org/meta/infobox/broadcom_wifi

I found a Broadcom device (rpi3b) with the same issue: https://github.com/openwrt/luci/issues/5937
Maybe add your HW-info and the requested files into that issue, which is still 'open'?

And could you add the info requested by bricco1981 to your next reply?
Output of: iw phy0 info

Do you use wolfssl? Then you should check: https://openwrt.org/advisory/2022-10-04-1
Make sure you use wolfSSL 5.5.1 or higher.
Check this with: opkg list-installed | grep wolfssl
Although I doubt this has anything to do with your error, but just to be sure.

DG.

root@OpenWrt:~# iw phy0 info
Wiphy phy0
	wiphy index: 0
	max # scan SSIDs: 10
	max scan IEs length: 2048 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 roaming.
	Available Antennas: TX 0 RX 0
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * P2P-client
		 * P2P-GO
		 * P2P-device
	Band 2:
		Capabilities: 0x1062
			HT20/HT40
			Static SM Power Save
			RX HT20 SGI
			RX HT40 SGI
			No RX STBC
			Max AMSDU length: 3839 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 16 usec (0x07)
		HT TX/RX MCS rate indexes supported: 0-23
		VHT Capabilities (0x0c025820):
			Max MPDU length: 3895
			Supported Channel Width: neither 160 nor 80+80
			short GI (80 MHz)
			SU Beamformer
			SU Beamformee
		VHT RX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: MCS 0-9
			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: MCS 0-9
			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
		Frequencies:
			* 5170 MHz [34] (disabled)
			* 5180 MHz [36] (disabled)
			* 5190 MHz [38] (disabled)
			* 5200 MHz [40] (disabled)
			* 5210 MHz [42] (disabled)
			* 5220 MHz [44] (disabled)
			* 5230 MHz [46] (disabled)
			* 5240 MHz [48] (disabled)
			* 5260 MHz [52] (disabled)
			* 5280 MHz [56] (disabled)
			* 5300 MHz [60] (disabled)
			* 5320 MHz [64] (disabled)
			* 5500 MHz [100] (disabled)
			* 5520 MHz [104] (disabled)
			* 5540 MHz [108] (disabled)
			* 5560 MHz [112] (disabled)
			* 5580 MHz [116] (disabled)
			* 5600 MHz [120] (disabled)
			* 5620 MHz [124] (disabled)
			* 5640 MHz [128] (disabled)
			* 5660 MHz [132] (disabled)
			* 5680 MHz [136] (disabled)
			* 5700 MHz [140] (disabled)
			* 5720 MHz [144] (disabled)
			* 5745 MHz [149] (20.0 dBm)
			* 5765 MHz [153] (20.0 dBm)
			* 5785 MHz [157] (20.0 dBm)
			* 5805 MHz [161] (20.0 dBm)
			* 5825 MHz [165] (20.0 dBm)
	valid interface combinations:
		 * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
		   total <= 3, #channels <= 1
		 * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
		   total <= 4, #channels <= 1
		 * #{ AP } <= 4,
		   total <= 4, #channels <= 1, STA/AP BI must match
	max # scan plans: 1
	max scan plan interval: -1
	max scan plan iterations: 0
	Supported extended features:
		* [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
		* [ DFS_OFFLOAD ]: DFS offload

this chipset/drivers are very limited. that's the reason of your problem

this driver * #{ managed } <= 1
ath9k * #{ managed } <= 2048

you was not really clear what you are trying to do. ap/sta dual ap, or just really trying edit the config

Ah ok - yeah I’m trying to either configure an AP using each of the three radios (which you can do using the stock firmware), or understand why that’s not possible. I think I managed to get all three working using DD-WRT (albeit with a car-crash of other issues with that firmware), I probably don’t understand enough about the whole Broadcom driver / proprietary / closed source issue to get my head around why this doesn’t work fully. If it really just isn’t possible I’ll update the Wiki page for this model to set expectations for future adopters of OpenWrt. For me having two radios is fine!

so you have tree radio and only two works?
so you are trying to bring radio0 up for an access point?
if so you can only use one of this channels on this radio: 149,153,157,161,165.
look at the output of iw phy0 info, other channels will not work
and i see you have it on channel 36

Yes the router has three radios (one 2.4GHz and two 5GHz).

OK I tried manually editing into /etc/config/wireless to add:

	option band '5g'
	option country 'GB'
	option htmode 'HT20'
	option channel '153'

rebooted, and the web UI now lets me edit the network on radio0 but I don't see the SSID on client devices. In dmesg I do see:

[  995.057576] ieee80211 phy0: brcmf_cfg80211_start_ap: Set Channel failed: chspec=53401, -52

iw reg get
iw dev
show that please

	option country 'GB'

to make it work i think you should set US

Yes setting option country to 'US' does indeed make it work, and I can connect to the AP.

Here's the output from those two commands when the option country is 'GB':

root@OpenWrt:~# iw reg get
global
country GB: 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 - 5730 @ 160), (N/A, 26), (0 ms), DFS
	(5725 - 5850 @ 80), (N/A, 23), (N/A), NO-OUTDOOR
	(5925 - 6425 @ 160), (N/A, 23), (N/A), NO-OUTDOOR
	(57000 - 71000 @ 2160), (N/A, 40), (N/A)

phy#2
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)

phy#1
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)

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)

root@OpenWrt:~# iw dev
phy#2
	Interface wlan2
		ifindex 12
		wdev 0x200000001
		addr 9c:3d:cf:57:cb:bc
		ssid OpenWrt5
		type AP
		channel 48 (5240 MHz), width: 20 MHz, center1: 5240 MHz
		txpower 31.00 dBm
phy#1
	Interface wlan1
		ifindex 11
		wdev 0x100000001
		addr 9c:3d:cf:57:cb:bd
		ssid OpenWrt
		type AP
		channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
		txpower 31.00 dBm
phy#0
	Interface wlan0
		ifindex 10
		wdev 0x1
		addr 9c:3d:cf:57:cb:be
		type AP
		channel 36 (5180 MHz), width: 20 MHz, center1: 5180 MHz
		txpower 31.00 dBm