Wifi regulatory settings Mobo and dongle radios

Hi ,

I've a Gl.Inet ar150 [Atheros] AR9331 WiSoC with a second radio usb dongle [Atheros AR9271] connected through an usb hub.

I've compiled openwrt with Luci and essential drivers.

I have problems changing regulatory wifi settings for both the radios.
I am changing them with luci interface or trying by using iw reg set but in no way I am able to change them
so I am loosing channel 13 on the mobo radio.
Funny thing is that the usb dongle shows channels 12-13 as active (iw reg set tells me CN china I believe)while the mobo radio seems to be configured (iw reg get, iw list) as US radio without channel 11 and 13 ?

Using Gl.Inet proprietary binary (the latest 2.64 or similar)without the dongle attached I am able to change the motherboard radio settings up to japan setting with even channel 14 enabled ??

Any clue ? Could be the presence of 2 different wifi interfaces a problem ? Any idea is suggestion is very welcome I'll try my bests (I am kind of new to openwrt thought ) !

Thank You very much indeed

Bests

P.

  • Are you running OpenWrt???
  • If so, what version of OpenWrt are you running?

Also let me be clear, you should only set the country that the device is being used in. Other settings may be illegal.

I simply set all cards to the same county and it works.

1 Like

Yes I am running openwrt compiled from trunk locally (cloned github couple of weeks ago)
I am not in the US thats why I need channel 13.

I tried setting both of the m by luci on DE setting but didnt work ?

How do I use iw reg set for only one interface at the time ?

Let me know.

Bests

P

Have you tried just using the UCI configuration of country without any manual commands?

Edit: I just checked on my Archer C7 v2 by temporarily changing the country code in /etc/config/wireless. After executing wifi to restart the wireless, the output of iw phy changed as expected to allow use of non-US frequencies.

https://openwrt.org/docs/guide-user/network/wifi/basic

What do you see in /var/run/hostapd-phy*.conf and/or /var/run/wpa_supplicant-*.conf?

It looks like there's a lot of setup around country in the netifd scripts:

$ fgrep -r country /lib/netifd
/lib/netifd/hostapd.sh:	config_add_string country
/lib/netifd/hostapd.sh:	config_add_boolean country_ie doth
/lib/netifd/hostapd.sh:	json_get_vars country country_ie beacon_int:100 doth require_mode legacy_rates acs_chan_bias
/lib/netifd/hostapd.sh:	set_default country_ie 1
/lib/netifd/hostapd.sh:	[ -n "$country" ] && {
/lib/netifd/hostapd.sh:		append base_cfg "country_code=$country" "$N"
/lib/netifd/hostapd.sh:		[ "$country_ie" -gt 0 ] && append base_cfg "ieee80211d=1" "$N"
/lib/netifd/hostapd.sh:	local country_str=
/lib/netifd/hostapd.sh:	[ -n "$country" ] && {
/lib/netifd/hostapd.sh:		country_str="country=$country"
/lib/netifd/hostapd.sh:$country_str
/lib/netifd/wireless/mac80211.sh:		country chanbw distance \
/lib/netifd/wireless/mac80211.sh:	[ -n "$country" ] && {
/lib/netifd/wireless/mac80211.sh:		iw reg get | grep -q "^country $country:" || {
/lib/netifd/wireless/mac80211.sh:			iw reg set "$country"

Hi,

I think I am missing something in the reg get process.

Both the interfaces are set as DE into /etc/config/wireless

But one of them keep having channel 13 disabled.

More interesting when starting the router alone (no usb wifi dongle), I am able to change the reg setting, actually the router boots up with the right country configuration moreover if I do a scan by Luci I pick up channel 13,when using iw reg get both global and phy0 show the DE (right) country and iw phy0 info show channel 13 as enabled.

If a attach the dongle to the router and then enable the wifi dongle by Luci I get channel 13 on this one too but suddently iw reg get gives me global country as DE; phy1 the, second dongle, country DE; but the router wifi phy0 shoes up as country US neverthless both phy1 and phy0 have channel 13 enable.

At this point /var/run/hostapd-phy*.confand/or/var/run/wpa_supplicant-*.conf` show the DE country

As soon as I reboot everything with the dongle attached the country global settings goes to 98 and both the dongles revert to different country regulatory codes and for me its impossible to change them.

At this point /var/run/hostapd-phy*.confand/or/var/run/wpa_supplicant-*.conf` show the DE country

So the question is how to avoid having to remove and replug the second wifi dongle everytime I start the router ? Any init.d uci setting I should try to change ? please help !

Thank You indeed for any suggestion.

Bests P.

Until you get it "worked out", I'd only modify the settings by editing the UCI files in /etc/config and executing wifi and/or /etc/init.d/network restart -- LuCI might be rewriting things for you in ways that you might not expect or want. Installing nano is helpful if you're not a vi user.

iw dev <wlanX-Y> station dump and iw dev <wlanX-Y> scan are a couple command-line tools that might useful.

1 Like

Hi Jeff sorry I almost forgot.

I went for the patching of the wireless-regb.txt

using quilt as per openwrt webpage instruction

https://wiki.openwrt.org/doc/devel/patches

modified the db.txt inside openwrt/build_dir/target-mips24kmusl/wireless-regb-......./db.txt

copied german setting under US one.

Now both the ar150radio and the wifi usb dongle have access to channel 13.

Now I got a 2.4 and 5ghz rt8812au dongle I think I'll be more difficult to have it to work

on openwrt. I'll ask you about when starting.

Topic is closed form me.

Thank you indeed for your help.

Best

P.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.