DietPi icon indicating copy to clipboard operation
DietPi copied to clipboard

DietPi-Config | Add ability to set regulatory domain (WiFi)

Open k-plan opened this issue 10 years ago • 33 comments

@Fourdee

we need a option, like in the new raspi-config version, to get e.g. RPi 3 Wifi Channel 12+13 working with Kernel 4.4x ("unstable").

raspberry_change_wifi_country

Please see: "Test and set the correct regulatory domain"

root@RPi-3-test:~# iw reg get
country 00: DFS-UNSET
        (2402 - 2472 @ 40), (N/A, 20), (N/A)
        (2457 - 2482 @ 40), (N/A, 20), (N/A), NO-IR
        (2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM, NO-IR
        (5170 - 5250 @ 80), (N/A, 20), (N/A), NO-IR
        (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, NO-IR
        (5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, NO-IR
        (5735 - 5835 @ 80), (N/A, 20), (N/A), NO-IR
        (57240 - 63720 @ 2160), (N/A, 0), (N/A)


root@RPi-3-test:~# iw reg set DE


root@RPi-3-test:~# iw reg get
country DE: DFS-ETSI
        (2400 - 2483 @ 40), (N/A, 20), (N/A)
        (5150 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR
        (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS
        (5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)


root@RPi-3-test:~# iwlist wlan0 channel
wlan0     13 channels in total; available frequencies :
          Channel 01 : 2.412 GHz
          Channel 02 : 2.417 GHz
          Channel 03 : 2.422 GHz
          Channel 04 : 2.427 GHz
          Channel 05 : 2.432 GHz
          Channel 06 : 2.437 GHz
          Channel 07 : 2.442 GHz
          Channel 08 : 2.447 GHz
          Channel 09 : 2.452 GHz
          Channel 10 : 2.457 GHz
          Channel 11 : 2.462 GHz
          Channel 12 : 2.467 GHz
          Channel 13 : 2.472 GHz
          Current Frequency:2.412 GHz (Channel 1)

root@RPi-3-test:~# sed -i "s/REGDOMAIN=/REGDOMAIN=DE/g" /etc/default/crda


root@RPi-3-test:~# cat /etc/default/crda
# Set REGDOMAIN to a ISO/IEC 3166-1 alpha2 country code so that iw(8) may set
# the initial regulatory domain setting for IEEE 802.11 devices which operate
# on this system.
#
# Governments assert the right to regulate usage of radio spectrum within
# their respective territories so make sure you select a ISO/IEC 3166-1 alpha2
# country code suitable for your location or you may infringe on local
# legislature. See `/usr/share/zoneinfo/zone.tab' for a table of timezone
# descriptions containing ISO/IEC 3166-1 alpha2 country codes.

REGDOMAIN=DE


Hint: Tested on RPi 3, Odroid C1+ and C2. Working as well. If setting Regulatory Domain to the correct country code, and the same as the Access-Point (WiFi Router) I will get a higher bandwidth and a more solid connection.

root@oDroid-C1-TEST2:~# iw reg set 00

root@oDroid-C1-TEST2:~# iw reg get
country 00: DFS-UNSET

root@oDroid-C1-TEST2:~# iperf -s
[  4]  0.0-90.1 sec   747 MBytes  69.5 Mbits/sec

root@oDroid-C1-TEST2:~# iw reg set DE

root@oDroid-C1-TEST2:~# iw reg get
country DE: DFS-ETSI

root@oDroid-C1-TEST2:~# iperf -s
[  4]  0.0-90.0 sec  1.02 GBytes  97.4 Mbits/sec

k-plan avatar May 02 '16 21:05 k-plan

@k-plan Excellent idea, will look into it :+1:

Fourdee avatar May 03 '16 11:05 Fourdee

@Fourdee

Verry nice! 😄 👍

Some testing result from RPi 3:

root@RPi-3-test:~# uname -a
Linux RPi-3-test 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux

-------------------

root@RPi-3-test:~# iw reg get
country 00: DFS-UNSET

root@RPi-3-test:~# iwlist wlan0 channel
wlan0     11 channels in total; available frequencies :

root@RPi-3-test:~# iperf -s 
. . .
[  4]  0.0-90.4 sec   109 MBytes  10.1 Mbits/sec

--------------------

root@RPi-3-test:~# iw reg get
country DE: DFS-ETSI

root@RPi-3-test:~# iwlist wlan0 channel
wlan0     11 channels in total; available frequencies :

root@RPi-3-test:~# iperf -s 
. . .
[  4]  0.0-90.2 sec   176 MBytes  16.4 Mbits/sec

=================

root@RPi-3-test:~# uname -a
Linux RPi-3-test 4.4.8-v7+ #881 SMP Sat Apr 30 12:16:50 BST 2016 armv7l GNU/Linux

-------------------

root@RPi-3-test:~# iw reg get
country 00: DFS-UNSET

root@RPi-3-test:~# iwlist wlan0 channel
wlan0     11 channels in total; available frequencies :

root@RPi-3-test:~# iperf -s 
. . .
[  4]  0.0-90.1 sec   130 MBytes  12.1 Mbits/sec

--------------------

root@RPi-3-test:~# iw reg get
country DE: DFS-ETSI

root@RPi-3-test:~# iwlist wlan0 channel
wlan0     13 channels in total; available frequencies :

root@RPi-3-test:~# iperf -s 
. . .
[  4]  0.0-90.3 sec   197 MBytes  18.3 Mbits/sec

-------------------

Reference result from eth0:

root@RPi-3-test:~# iperf -s 
. . .
[  4]  0.0-90.0 sec  1010 MBytes  94.1 Mbits/sec

k-plan avatar May 03 '16 19:05 k-plan

Country codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

Current country code

iw reg get | grep -m1 'country' | awk '{print $2}' | tr -d ':'

Menu select common codes -GB -RU -US +manual entry option etc

Location: Network Options: Adapters > Wifi ? (menu too big already?, convert to scrollable menu?) Network Options: Adapters > WiFi Country?

Merge Menu_WifiHotspot into Menu_NetworkAdapters_Wifi() , create whiptail array to only show required menu options, depending on mode. Allows for https://github.com/Fourdee/DietPi/issues/311. Possible issue with top stats being too many lines,

Fourdee avatar May 05 '16 13:05 Fourdee

@Fourdee

Location: Network Options: Adapters > Wifi ? (menu too big already?, convert to scrollable menu?) Network Options: Adapters > WiFi Country?

Difficult question. Both have pros and cons. If scrollable, someone can miss it. If it will be a new list point, it will blow up the list. May be a issue, if you must have to put in new options later.

Merge Menu_WifiHotspot into Menu_NetworkAdapters_Wifi() , create whiptail array to only show required menu options, depending on mode. Allows for #311. Possible issue with top stats being too many lines,

Hmm ... it's the same here.


Menu select common codes -GB -RU -US +manual entry option etc

Hmm ..

  • for 2.4 GHz (802.11b/g/n) it will be better:

Menu select common codes -GB -US -JP +manual entry option etc.

  • for 5 GHz (802.11a/h/j/n/ac) it will be better:

Menu select common codes -GB -US -CN +manual entry option etc.

WLAN Frequency

Can you please build a version with all possible option and check in via testing branch, so we can have a look?

k-plan avatar May 05 '16 16:05 k-plan

@k-plan Thanks for the extra info :+1:

Started on this today. I havn't done any real "programming" for a while, so little rusty lol. Will let you know when its available for testing.

image

Fourdee avatar May 07 '16 16:05 Fourdee

@Fourdee

your screenshot is looking very handsome.
2.4 GHz (802.11b/g/n) is a good choice to start. (RPi 3 build-in WLAN module)

k-plan avatar May 07 '16 16:05 k-plan

CRDA was not applying our saved setting during reboots, reverts to 00:

# - Apply to system configs, for reboots
echo -e "REGDOMAIN=$wifi_country_code_target" > /etc/default/crda
echo -e "options cfg80211 ieee80211_regdom=$wifi_country_code_target" > /etc/modprobe.d/cfg80211.conf

Fixed :)

Fourdee avatar May 08 '16 12:05 Fourdee

@k-plan Uploaded to testing branch.

For now, I've just added the ability to change WiFi country code when running in non-AP mode. Also been playing around with the menu code (select "change mode") to resolve the height issue. Country Code is available in Network Options: Adapters > Wifi

Commit: https://github.com/Fourdee/DietPi/commit/49aa00bb3b272e10ec723a36cff9632dd52da332

I'll work on the AP mode menu next.

EDIT: And test 5ghz country code support for non-AP mode.

Turns out I do not own a 5ghz capable USB WiiFi dongle, and the RPi 3 is 2.4ghz only. :( lol

I might have to purchase one of these: http://www.edimax.com/edimax/merchandise/merchandise_detail/data/edimax/global/wireless_adapters_ac600_dual-band/ew-7811utc

Good list of RPi USB WiFi adapters: http://elinux.org/RPi_USB_Wi-Fi_Adapters

Fourdee avatar May 08 '16 12:05 Fourdee

As far as I can tell, country code iw reg set has no effect on Hostapd.

  • iw reg set US
  • Set hostapd channel to 13
  • Restart hostapd and networking services. Even did a reboot. iw reg get = US
  • Hotspot still available on channel 13.

Fourdee avatar May 08 '16 15:05 Fourdee

Hostapd:

I can not get 2.4ghz N (150mbit) to work on hostapd with driver=rtl871xdrv and :

Bus 002 Device 002: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]

Tried using:

hw_mode=n
wwm_enabled=1
ieee80211n=1

Any of these option prevents hostapd service from starting, no error codes/info from systemctl status hostapd -l

Tried with RPi 3

interface=wlan0
#driver=none
ssid=DietPi-HotSpot
hw_mode=g
channel=3
macaddr_acl=0
auth_algs=1
ssid=DietPi-HotSpot
wpa=2
wpa_passphrase=dietpihotspot
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
#wwm_enabled=1
ieee80211n=1

Seems to work with N (72mbit max on this device): image

So as far as I can tell, Wireless N support is only available for devices that use the driver=nl80211

Fourdee avatar May 08 '16 15:05 Fourdee

@Fourdee

wow, you are to quick for me. 😄
Sorry, have to catch up.

Starting now with gitbranch=testing

k-plan avatar May 08 '16 17:05 k-plan

@k-plan I broke the RPi 3 hotspot. Turns out the internal BCM does not like any driver unless its disabled #driver=none. I've sent a new commit: https://github.com/Fourdee/DietPi/commit/746fa36b3fa3e2027527c625f12560560833936d you just need to grab dietpi-software if you are going to test RPi 3 with hotspot.

Fourdee avatar May 08 '16 17:05 Fourdee

@Fourdee

CRDA was not applying our saved setting during reboots, reverts to 00: Fixed :)

Hmm .. doesn't work here:

  • set Country-Code manual per dietpi-config and Apply Save Changes (Restart Networking)

160508-0002

root@oDroid-C1-TEST:~# iw reg get
country DE: DFS-ETSI
        (2400 - 2483 @ 40), (N/A, 20), (N/A)
        (5150 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR
        (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS
        (5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

root@oDroid-C1-TEST:~#reboot

root@oDroid-C1-TEST:~# iw reg get
country 00: DFS-UNSET
        (2402 - 2472 @ 40), (6, 20), (N/A)
        (2457 - 2482 @ 40), (6, 20), (N/A), PASSIVE-SCAN
        (2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
        (5170 - 5250 @ 160), (6, 20), (N/A), PASSIVE-SCAN
        (5250 - 5330 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
        (5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN

root@oDroid-C1-TEST:~# cat /etc/default/crda
REGDOMAIN=DE

root@oDroid-C1-TEST:~# cat /etc/modprobe.d/cfg80211.conf
options cfg80211 ieee80211_regdom=DE

160508-0001

k-plan avatar May 08 '16 17:05 k-plan

@k-plan

root@oDroid-C1-TEST:~#reboot

root@oDroid-C1-TEST:~# iw reg get

Strange, run it twice:

reboot

iw reg get
sleep 5
iw reg get

Fourdee avatar May 08 '16 17:05 Fourdee

Odroid C2 dmesg. It is being applied for me:

[    7.992802] cfg80211: Calling CRDA for country: GB
[    8.005850] cfg80211: Regulatory domain changed to country: GB
[    8.006045] cfg80211:  DFS Master region: ETSI
[    8.010317] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[    8.012946] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[    8.020294] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm)
[    8.027643] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2000 mBm)
[    8.034937] cfg80211:   (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm)
[    8.042425] cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm)

Fourdee avatar May 08 '16 18:05 Fourdee

root@oDroid-C1-TEST:~# reboot

root@oDroid-C1-TEST:~# iw reg get
country 00: DFS-UNSET
        (2402 - 2472 @ 40), (6, 20), (N/A)
        (2457 - 2482 @ 40), (6, 20), (N/A), PASSIVE-SCAN
        (2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
        (5170 - 5250 @ 160), (6, 20), (N/A), PASSIVE-SCAN
        (5250 - 5330 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
        (5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN

root@oDroid-C1-TEST:~# dmesg 
 . . .      
 [   17.081693] usbcore: registered new interface driver rtl8192cu

root@oDroid-C1-TEST:~# cat /var/log/syslog | grep cfg 
May  8 19:50:51 oDroid-C1-TEST kernel: [  440.785811@0] cfg80211: Calling CRDA for country: DE
May  8 19:50:51 oDroid-C1-TEST kernel: [  440.798204@3] cfg80211: Regulatory domain changed to country: DE
May  8 19:50:51 oDroid-C1-TEST kernel: [  440.798292@3] cfg80211:  DFS Master region: ETSI
May  8 19:50:51 oDroid-C1-TEST kernel: [  440.798340@3] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cactime)
May  8 19:50:51 oDroid-C1-TEST kernel: [  440.798440@3] cfg80211:   (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
May  8 19:50:51 oDroid-C1-TEST kernel: [  440.798585@3] cfg80211:   (5150000 KHz - 5250000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), N/A)
May  8 19:50:51 oDroid-C1-TEST kernel: [  440.798705@3] cfg80211:   (5250000 KHz - 5350000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), 0 s)
May  8 19:50:51 oDroid-C1-TEST kernel: [  440.798818@3] cfg80211:   (5470000 KHz - 5725000 KHz @ 160000 KHz), (N/A, 2698 mBm), (0 s)
May  8 19:50:51 oDroid-C1-TEST kernel: [  440.798914@3] cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
May  8 19:58:50 oDroid-C1-TEST kernel: [    0.177597@0] cfg80211: Calling CRDA to update world regulatory domain

But I have to say, my C1+ is running DietPi from USB device at the moment and have installed "SoftEther"

I will make a fresh install on a new sd-card ...

k-plan avatar May 08 '16 18:05 k-plan

@Fourdee

starting with a fresh sd-card installation:

root@oDroid-C1-TEST:~# lsusb
Bus 001 Device 003: ID 7392:7822 Edimax Technology Co., Ltd
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@oDroid-C1-TEST:~# dmesg
 . . .
[    0.177589] cfg80211: Calling CRDA to update world regulatory domain
[    7.030012] usbcore: registered new interface driver rtl8192cu

root@oDroid-C1-TEST:~# cat /var/log/syslog | grep cfg
May  8 20:24:46 oDroid-C1-TEST kernel: [    0.177589@0] cfg80211: Calling CRDA to update world regulatory domain

root@oDroid-C1-TEST:~# iw reg get
country 00: DFS-UNSET
        (2402 - 2472 @ 40), (6, 20), (N/A)
        (2457 - 2482 @ 40), (6, 20), (N/A), PASSIVE-SCAN
        (2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
        (5170 - 5250 @ 160), (6, 20), (N/A), PASSIVE-SCAN
        (5250 - 5330 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
        (5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN

root@oDroid-C1-TEST:~# cat /etc/default/crda
# Set REGDOMAIN to a ISO/IEC 3166-1 alpha2 country code so that iw(8) may set
# the initial regulatory domain setting for IEEE 802.11 devices which operate
# on this system.
#
# Governments assert the right to regulate usage of radio spectrum within
# their respective territories so make sure you select a ISO/IEC 3166-1 alpha2
# country code suitable for your location or you may infringe on local
# legislature. See `/usr/share/zoneinfo/zone.tab' for a table of timezone
# descriptions containing ISO/IEC 3166-1 alpha2 country codes.

REGDOMAIN=

root@oDroid-C1-TEST:~# cat /etc/modprobe.d/cfg80211.conf
cat: /etc/modprobe.d/cfg80211.conf: No such file or directory

  • now set Country per dietpi-config to GB and save
root@oDroid-C1-TEST:~# iw reg get
country GB: DFS-ETSI
        (2402 - 2482 @ 40), (N/A, 20), (N/A)
        (5170 - 5250 @ 80), (N/A, 20), (N/A)
        (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS
        (5490 - 5710 @ 160), (N/A, 27), (0 ms), DFS
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

root@oDroid-C1-TEST:~# cat /etc/default/crda
REGDOMAIN=GB

root@oDroid-C1-TEST:~# cat /etc/modprobe.d/cfg80211.conf
options cfg80211 ieee80211_regdom=GB

root@oDroid-C1-TEST:~# reboot

root@oDroid-C1-TEST:~# iw reg get
country 00: DFS-UNSET
        (2402 - 2472 @ 40), (6, 20), (N/A)
        (2457 - 2482 @ 40), (6, 20), (N/A), PASSIVE-SCAN
        (2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
        (5170 - 5250 @ 160), (6, 20), (N/A), PASSIVE-SCAN
        (5250 - 5330 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
        (5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN

root@oDroid-C1-TEST:~# cat /etc/default/crda
REGDOMAIN=GB

root@oDroid-C1-TEST:~# cat /etc/modprobe.d/cfg80211.conf
options cfg80211 ieee80211_regdom=GB

root@oDroid-C1-TEST:~# dmesg | grep cfg
[    0.177442] cfg80211: Calling CRDA to update world regulatory domain

root@oDroid-C1-TEST:~# cat /var/log/syslog | grep cfg
May  8 20:24:46 oDroid-C1-TEST kernel: [    0.177589@0] cfg80211: Calling CRDA to update world regulatory domain
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.399978@3] cfg80211: Calling CRDA to update world regulatory domain
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.424219@3] cfg80211: World regulatory domain updated:
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.424304@3] cfg80211:  DFS Master region: unset
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.424357@3] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.424450@3] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.424533@3] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.424614@3] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.424691@3] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.424785@3] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.424878@3] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.424954@3] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.425040@3] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.425370@3] cfg80211: Calling CRDA for country: GB
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.437968@2] cfg80211: Regulatory domain changed to country: GB
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.438046@2] cfg80211:  DFS Master region: ETSI
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.438092@2] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.438185@2] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.440388@2] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.442580@2] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.444730@2] cfg80211:   (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s)
May  8 20:43:43 oDroid-C1-TEST kernel: [ 1140.446875@2] cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)

May  8 20:46:08 oDroid-C1-TEST kernel: [    0.177442@0] cfg80211: Calling CRDA to update world regulatory domain


root@oDroid-C1-TEST:~# crda
COUNTRY environment variable not set.

Will test as well 'DE' but I think it's the same.

k-plan avatar May 08 '16 18:05 k-plan

@Fourdee

is it possible we missed something (packet, config, db ..) ?

https://wireless.wiki.kernel.org/en/developers/regulatory/crda

https://wireless.wiki.kernel.org/en/developers/Regulatory

k-plan avatar May 08 '16 19:05 k-plan

My brain has been squished from LLMP, BUT I wanted to ask both of you --

Based on the dietpi-software and configure options:

  • Are we caching @k-plan's setting or is cleaned up from /tmp/.... ?
  • If we aren't caching this, would a work using /etc/rc.local + boot scripts for services to SET this be too... hackish?
  • As for N networking, I've seen similar issues as you found @Fourdee -- good catch and reminder!
  • I run N and can test this tomorrow morning as I have several routers and can wait till the family is snuggled in bed to confirm the 5Ghz range, etc
  • OR as I just realized, boot.ini could carry/source this in

The angle I am coming from is ensuring this is set as close to pre init 3 run-level as possible and also leaving a config option cache to avoid the kick back to !DE, but 00.

Thanks again for everyone's time to listen to my ideas as the code will come, oh trust me, but group work is far superior to a myopic approach!

Cheers to you both!

jkbenedict avatar May 08 '16 20:05 jkbenedict

Testing some tips I have read:

root@oDroid-C1-TEST:~# cat /etc/udev/rules.d/regulatory.rules
# WLAN-Regionseinstellungen festlegen

 KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="/sbin/iw reg set DE"

## KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="/sbin/crda"

But without success ...


Strange, run it twice:

root@oDroid-C1-TEST:~# iw reg get
country 00: DFS-UNSET
        (2402 - 2472 @ 40), (6, 20), (N/A)
        (2457 - 2482 @ 40), (6, 20), (N/A), PASSIVE-SCAN
        (2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
        (5170 - 5250 @ 160), (6, 20), (N/A), PASSIVE-SCAN
        (5250 - 5330 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
        (5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
root@oDroid-C1-TEST:~# sleep 5
root@oDroid-C1-TEST:~# iw reg get
country 00: DFS-UNSET
        (2402 - 2472 @ 40), (6, 20), (N/A)
        (2457 - 2482 @ 40), (6, 20), (N/A), PASSIVE-SCAN
        (2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
        (5170 - 5250 @ 160), (6, 20), (N/A), PASSIVE-SCAN
        (5250 - 5330 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
        (5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN

k-plan avatar May 08 '16 20:05 k-plan