WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Regulatory Domain settings  (Read 727 times)

Offline madmax

  • WikiUser
  • *
  • Posts: 36
Regulatory Domain settings
« on: May 13, 2017, 01:20:54 PM »
Hello:
I seem to have some problems with my Regulatory Domain settings.
My setup is:
Code: [Select]
tc@box:~$ uname -a
Linux box 4.8.17-tinycore #2017 SMP Sun Mar 5 15:49:22 UTC 2017 i686 GNU/Linux

My wifi adapter is:
Code: [Select]
tc@box:~$ lsusb
Bus 002 Device 003: ID 0cf3:1006 Atheros Communications, Inc. TP-Link TL-WN322G v3 / TL-WN422G v2 802.11g [Atheros AR9271]

The Regulatory Domain is apaprently set (hard wired?) to CN (China):
(snip from dmesg)
Code: [Select]
ath9k_htc 2-5:1.0: FW RMW support: On
ath: EEPROM regdomain: 0x809c
ath: EEPROM indicates we should expect a country code
ath: doing EEPROM country->regdmn map search
ath: country maps to regdmn code: 0x52
ath: Country alpha2 being used: CN
ath: Regpair used: 0x52
ieee80211 phy0: Atheros AR9271 Rev:1

But once boot is finished, it seems to have been set to 00:
Code: [Select]
tc@box:~$ iw reg get
country 00: DFS-UNSET
        (2402 - 2472 @ 40), (6, 20)
        (2457 - 2482 @ 20), (6, 20), PASSIVE-SCAN
        (2474 - 2494 @ 20), (6, 20), NO-OFDM, PASSIVE-SCAN
        (5170 - 5250 @ 80), (6, 20), PASSIVE-SCAN
        (5250 - 5330 @ 80), (6, 20), DFS, PASSIVE-SCAN
        (5490 - 5730 @ 160), (6, 20), DFS, PASSIVE-SCAN
        (5735 - 5835 @ 80), (6, 20), PASSIVE-SCAN
        (57240 - 63720 @ 2160), (N/A, 0)
Now, when I try to set it to the code I need for where I am located (AR), it wont 'stick':
eg:
Code: [Select]
tc@box:~$ sudo iw reg set AR
tc@box:~$ iw reg get
country 00: DFS-UNSET
        (2402 - 2472 @ 40), (6, 20)
        (2457 - 2482 @ 20), (6, 20), PASSIVE-SCAN
        (2474 - 2494 @ 20), (6, 20), NO-OFDM, PASSIVE-SCAN
        (5170 - 5250 @ 80), (6, 20), PASSIVE-SCAN
        (5250 - 5330 @ 80), (6, 20), DFS, PASSIVE-SCAN
        (5490 - 5730 @ 160), (6, 20), DFS, PASSIVE-SCAN
        (5735 - 5835 @ 80), (6, 20), PASSIVE-SCAN
        (57240 - 63720 @ 2160), (N/A, 0)
tc@box:~$
Any idea as how to set the country code properly?

Thanks in advance.

MM

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 2453
Re: Regulatory Domain settings
« Reply #1 on: May 13, 2017, 06:21:57 PM »
Interesting dilemma..
Seems to be set for country of purchase without many options to change it.

I'm sure tinypoodle would have a solution but haven't seen him around in a while :(

If no one else has a solution like a module load option,  I found a couple of not very convenient solutions here
https://bbs.archlinux.org/viewtopic.php?id=124574

Hope it helps


Sent from my iPhone using Tapatalk

Offline madmax

  • WikiUser
  • *
  • Posts: 36
Re: Regulatory Domain settings
« Reply #2 on: May 13, 2017, 07:29:59 PM »
Hello:
Interesting dilemma..
Seems to be set for country of purchase without many options to change it.
I believe it can be set with the CRDA package but it is not available.
It *was* available in the 4.x repository but not after that.

http://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz/

---
Title:          crda.tcz
Description:    This is the Central Regulatory Domain Agent for Linux.
Version:        1.1.0
Author:         Luis R. Rodriguez,Johannes Berg,Michael Green
Original-site:  git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git
Copying-policy: ISC
      Copyright (c) 2008, Luis R. Rodriguez <mcgrof@gmail.com>
      Copyright (c) 2008, Johannes Berg <johannes@sipsolutions.net>
      Copyright (c) 2008, Michael Green <Michael.Green@Atheros.com>
Size:       36 KB
Extension_by:   ZhaoChunsheng
Tags:       This Central Regulatory Domain Agent Linux.
Comments:       This is the Central Regulatory Domain Agent for Linux. It serves one
      purpose: tell Linux kernel what to enforce. In essence it is a udev
      helper for communication between the kernel and userspace. You only
      need to run this manually for debugging purposes. For manual changing
      of regulatory domains use iw (iw reg set) or wpa_supplicant (feature
      yet to be added).
Change-log:     -
Current:        2009/12/12 - First version(1.1.0)
---

In Mint 18.0, you have CRDA installed with a file in /lib/crda called setregdomain.

Code: [Select]
#!/bin/sh
set -e
REGDOMAIN=AR
CRDA_CONF=/etc/default/crda
[ -r "$CRDA_CONF" ] && . "$CRDA_CONF"
[ -z "$REGDOMAIN" ] && exit 0
exec /sbin/iw reg set "$REGDOMAIN"

This works perfectly in Mint.
Would there a crda.tcz package available for TC 8.0?

Thanks in advance.

MM

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5313
Re: Regulatory Domain settings
« Reply #3 on: May 13, 2017, 07:50:33 PM »
Hi madmax
The  crda  package in TC4 has no dependencies. Download it and give it a try.

Offline madmax

  • WikiUser
  • *
  • Posts: 36
Re: Regulatory Domain settings
« Reply #4 on: May 14, 2017, 03:53:35 AM »
Hello:
The  crda  package in TC4 has no dependencies. Download it and give it a try.
Thanks for the info.
Downloaded all the crda files.
But ..
Code: [Select]
tc@box:~$ crda
crda: error while loading shared libraries: libgcrypt.so.11: cannot open shared object file: No such file or directory
tc@box:~$

So I downloaded libgcrypt.tcz.
Still no dice.

Anything else I can try?

Thanks in advance.

MM

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9282
Re: Regulatory Domain settings
« Reply #5 on: May 14, 2017, 04:00:51 AM »
crda is present in the tc-8.x corepure64 repo if that's an option?

Offline madmax

  • WikiUser
  • *
  • Posts: 36
Re: Regulatory Domain settings
« Reply #6 on: May 14, 2017, 05:50:42 AM »
Hello:
crda is present in the tc-8.x corepure64 repo if that's an option?
I'd have to run (?) corepure64 instead of coreplus.
I'm afraid I'm not even up to speed with the basics of the 32bit version yet.

Can't we (eventually) get an 8.x version of crda for coreplus?
I wonder why it didn't get compiled past the 4.x repo.
It *is* in use in Mint 18 and I expect it is also used in other up to date distributions.

Thanks in advance.

MM

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5313
Re: Regulatory Domain settings
« Reply #7 on: May 14, 2017, 06:16:18 AM »
Hi madmax
Sorry about that, apparently the TC4 version is missing a dependency file so don't bother with that version any further.
You could try compiling it yourself. If you look over here:
http://tinycorelinux.net/7.x/x86_64/tcz/src/crda/
The files  compile_crda  and  compile_wireless_regdb  give line by line instructions of what commands to run.

Offline madmax

  • WikiUser
  • *
  • Posts: 36
Re: Regulatory Domain settings
« Reply #8 on: May 14, 2017, 07:07:17 AM »
Hello:
Sorry about that, apparently the TC4 version is missing a dependency file ...
No problem.
Quote
You could try compiling it yourself. If you look over here:
http://tinycorelinux.net/7.x/x86_64/tcz/src/crda/
The files  compile_crda  and  compile_wireless_regdb  give line by line instructions of what commands to run.
I'm sorry to be such a nag.  =-/
Now this asks for a file I cannot find in the repo: python-m2crypto.tcz
Code: [Select]
tc@box:~$ tce-load -i python-m2crypto openssl-dev libnl-dev git libgcrypt-dev
python-m2crypto.tcz not found!
tc@box:~$

Anything else I can do?

Thanks in advance,

MM

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9282
Re: Regulatory Domain settings
« Reply #9 on: May 14, 2017, 07:27:52 AM »
Now this asks for a file I cannot find in the repo: python-m2crypto.tcz

Welcome to the world of compiling stuff  :)

See:

http://www.tinycorelinux.net/7.x/x86_64/tcz/src/python-m2crypto/

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5313
Re: Regulatory Domain settings
« Reply #10 on: May 14, 2017, 07:36:10 AM »
Hi madmax
The  compile_crda  file mentions  using openssl fails. The info file for  python-m2crypto.tcz  says it's an  openssl wrapper.
I see no references to  openssl  in any of the compilation commands so try running without it.

Offline madmax

  • WikiUser
  • *
  • Posts: 36
Re: Regulatory Domain settings
« Reply #11 on: May 14, 2017, 07:47:54 AM »
Hello:
Welcome to the world of compiling stuff  :)
Thanks ...
Quote
See:
http://www.tinycorelinux.net/7.x/x86_64/tcz/src/python-m2crypto/
Indeed ...

I installed python-dev.tcz which I did not have.
But no dice:

Code: [Select]
tc@box:~$ tce-load -i python-dev python-typing python-setuptools openssl-dev
python-dev is already installed!
openssl-dev is already installed!
python-typing.tcz not found!
tc@box:~$

As Murphy would have it, python-typing.tcz is not present in the 8.x repo.
And now?

Thanks for all the help in trying to figure this out.

MM






Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5313
Re: Regulatory Domain settings
« Reply #12 on: May 14, 2017, 07:55:02 AM »
Hi madmax
As Murphy would have it, python-typing.tcz is not present in the 8.x repo.
And now?
http://www.tinycorelinux.net/7.x/x86_64/tcz/src/python-typing/

Offline madmax

  • WikiUser
  • *
  • Posts: 36
Re: Regulatory Domain settings
« Reply #13 on: May 14, 2017, 08:06:05 AM »
Hello:
The  compile_crda  file mentions  using openssl fails. The info file for  python-m2crypto.tcz  says it's an  openssl wrapper.
I see no references to  openssl  in any of the compilation commands so try running without it.
My guess is that you mean running this:
Code: [Select]
tc@box:~$ tce-load -i openssl-dev libnl-dev git libgcrypt-dev

But now it asks for libnl-dev.tcz:

Code: [Select]
tc@box:~$ tce-load -i openssl-dev libnl-dev git libgcrypt-dev
openssl-dev is already installed!
libnl-dev.tcz not found!
tc@box:~$

So I install libnl-dev.tcz, git.tcz and libgcryp-dev.tcz twhich were not in my TC and will start again.
I'll let you know how it goes.

Thanks for the input.  =-)
MM

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 2453
Re: Regulatory Domain settings
« Reply #14 on: May 14, 2017, 08:59:34 AM »
hi madmax, 
I'm not sure if you're familiar but tce-load -i option only loads extensions that have been previously downloaded.

Code: [Select]
tc@box:~$ tce-load -i openssl-dev libnl-dev git libgcrypt-dev
openssl-dev is already installed!
libnl-dev.tcz not found!
tc@box:~$

Try this instead
Code: [Select]
tce-load -w openssl-dev libnl-dev git libgcrypt-dev
tce-load -i openssl-dev libnl-dev git libgcrypt-dev