Non-default Country Code after reboot: transmit power = driver default 0 dBm

I have 2 TP Link devices, C2600 and C7 v4 running 22.03.2 (although I have seen this in all the older versions I have used too).

I have changed the country code from the UK default, and then changed the channels and power - all good. Until reboot, and then the wireless goes to 0 power.

Then I can use the UI to set any power, and the Status country code changes to ZA, after which I can then use the expanded UI list to use the wider range of powers.

Can anyone explain this? What exactly is the UI doing - I am thinking I should be able to script at startup. A simple restart of the network interface is not enough though.
Screenshot 1

the solution is in /lib/firmware regdb
take care of that
i'll stop here
i do not have this devices also, but that should be the rigt way

It's not quite clear to me which country code you actually selected, respectively wanted to set. Probably best to paste the full /etc/config/wireless (redact ESSID and PSK).

My guess would be a mismatch between 2.4 GHz and 5 GHz country settings, aside from this, with both radios QCA based for either router, there shouldn't be much interfering.

1 Like

Interesting pointer - I have /lib/firmware/regulatory.db although it is a binary file ("file" reports: CRDA wireless regulatory database file) so not easily editable.

I may look into ways to do this...

Thanks
Nick

Sorry if my explanation was not clear.

To summarise:
The hardware thinks it is GB (UK).
I have left the 2.4 GHz radio in GB
I have changed the 5 GHz radio to ZA and increased the power to 30 dBm (via UI)
This works fine until I reboot - the 5 GHz radio does not come up and UI shows that in the screenshot; the radio has gone back to GB so the power setting is no longer valid.

It looks to mee like the UI is able to change the country code, but that either the startup script is not doing it or it's getting overwritten. If I can script whatever the UI is doing after startup, that would be a workaround.

Here is my wireless file:

config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11a'
	option path 'pci0000:00/0000:00:00.0'
	option htmode 'VHT80'
	option cell_density '0'
	option country 'ZA'
	option channel '100'
	option txpower '30'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ieee80211w '1'
	option ssid 'XXX-5'
	option encryption 'psk2'
	option ieee80211r '1'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'
	option wpa_disable_eapol_key_retries '1'
	option key 'XXX'
	option mobility_domain '5001'

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11g'
	option path 'platform/ahb/18100000.wmac'
	option cell_density '0'
	option htmode 'HT20'
	option country 'GB'
	option txpower '20'
	option channel '11'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option mode 'ap'
	option ieee80211r '1'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'
	option ssid 'XXX-2.4'
	option key 'XXX'
	option mobility_domain '2401'
	option network 'lan'
	option encryption 'psk2+ccmp'
	option wpa_disable_eapol_key_retries '1'

config wifi-iface 'wifinet2'
	option device 'radio1'
	option mode 'ap'
	option encryption 'psk2+ccmp'
	option key 'XXX'
	option ieee80211r '1'
	option mobility_domain '2403'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'
	option wpa_disable_eapol_key_retries '1'
	option network 'private'
	option ssid 'XXX-2.4-Private'

config wifi-iface 'wifinet3'
	option device 'radio1'
	option mode 'ap'
	option ssid 'XXX-2.4-Guest'
	option encryption 'psk2+ccmp'
	option key 'XXX'
	option ieee80211r '1'
	option mobility_domain '2404'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'
	option wpa_disable_eapol_key_retries '1'
	option network 'guest'

Thanks!

Well, what are you expecting to happen then?
Set one regulatory domain for all radios - and it'll better be your real one, as anything else messes up the situation for all clients in your neighbourhood and would be blatantly illegal.

1 Like

I would have expected the result after a reboot to match the result after manual changes in the UI, when the actual configuration is the same.

You are right that if I set both radios to ZA they do both come up after reboot, thanks. But I am still curious as to the boot process/how the UI applies its settings.