[SOLVED]Wifi AP mode stopped working after upgrading to Ubuntu 22.04

Post Reply
User avatar
mad_ady
Posts: 10739
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 647 times
Been thanked: 935 times
Contact:

[SOLVED]Wifi AP mode stopped working after upgrading to Ubuntu 22.04

Post by mad_ady »

I'm posting this in the General section because it likely affects all Ubuntu 22.04 versions.

Here's my story (and most likely I'll be reading it in 2 years when it happens again). I have a HC4 with a Odroid Wifi module (based on rt2800usb) that I use with create_ap (https://github.com/lakinduakash/linux-wifi-hotspot) to host a 5GHz wifi AP. It was running tobetter's Ubuntu 20.04 with kernel 5.13 and I did a dist-upgrade to 22.04. After the upgrade finished without issues I noticed that wifi was down. The create_ap script failed with this error:

Code: Select all

ERROR: Your adapter can not transmit to channel 36, frequency band 5GHz.
When looking at iw list for my adapter I had:

Code: Select all

...
	Band 2:
		Capabilities: 0x2fe
			HT20/HT40
			SM Power Save disabled
			RX Greenfield
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			RX STBC 2-streams
			Max AMSDU length: 3839 bytes
			No DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 2 usec (0x04)
		HT TX/RX MCS rate indexes supported: 0-15, 32
		Bitrates (non-HT):
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 5180 MHz [36] (20.0 dBm) (no IR)
			* 5190 MHz [38] (20.0 dBm) (no IR)
			* 5200 MHz [40] (20.0 dBm) (no IR)
			* 5210 MHz [42] (20.0 dBm) (no IR)
			* 5220 MHz [44] (20.0 dBm) (no IR)
			* 5230 MHz [46] (20.0 dBm) (no IR)
			* 5240 MHz [48] (20.0 dBm) (no IR)
			* 5250 MHz [50] (20.0 dBm) (no IR, radar detection)
			* 5260 MHz [52] (20.0 dBm) (no IR, radar detection)
			* 5270 MHz [54] (20.0 dBm) (no IR, radar detection)
			* 5280 MHz [56] (20.0 dBm) (no IR, radar detection)
			* 5290 MHz [58] (20.0 dBm) (no IR, radar detection)
			* 5300 MHz [60] (20.0 dBm) (no IR, radar detection)
			* 5310 MHz [62] (20.0 dBm) (no IR, radar detection)
			* 5320 MHz [64] (20.0 dBm) (no IR, radar detection)
			* 5500 MHz [100] (20.0 dBm) (no IR, radar detection)
			* 5510 MHz [102] (20.0 dBm) (no IR, radar detection)
			* 5520 MHz [104] (20.0 dBm) (no IR, radar detection)
			* 5530 MHz [106] (20.0 dBm) (no IR, radar detection)
			* 5540 MHz [108] (20.0 dBm) (no IR, radar detection)
			* 5550 MHz [110] (20.0 dBm) (no IR, radar detection)
			* 5560 MHz [112] (20.0 dBm) (no IR, radar detection)
			* 5570 MHz [114] (20.0 dBm) (no IR, radar detection)
			* 5580 MHz [116] (20.0 dBm) (no IR, radar detection)
			* 5590 MHz [118] (20.0 dBm) (no IR, radar detection)
			* 5600 MHz [120] (20.0 dBm) (no IR, radar detection)
			* 5610 MHz [122] (20.0 dBm) (no IR, radar detection)
			* 5620 MHz [124] (20.0 dBm) (no IR, radar detection)
			* 5630 MHz [126] (20.0 dBm) (no IR, radar detection)
			* 5640 MHz [128] (20.0 dBm) (no IR, radar detection)
			* 5650 MHz [130] (20.0 dBm) (no IR, radar detection)
			* 5660 MHz [132] (20.0 dBm) (no IR, radar detection)
			* 5670 MHz [134] (20.0 dBm) (no IR, radar detection)
			* 5680 MHz [136] (20.0 dBm) (no IR, radar detection)
			* 5690 MHz [138] (20.0 dBm) (no IR, radar detection)
			* 5700 MHz [140] (20.0 dBm) (no IR, radar detection)
			* 5745 MHz [149] (20.0 dBm) (no IR)
			* 5755 MHz [151] (20.0 dBm) (no IR)
			* 5765 MHz [153] (20.0 dBm) (no IR)
			* 5775 MHz [155] (20.0 dBm) (no IR)
			* 5785 MHz [157] (20.0 dBm) (no IR)
			* 5795 MHz [159] (20.0 dBm) (no IR)
			* 5805 MHz [161] (20.0 dBm) (no IR)
			* 5825 MHz [165] (20.0 dBm) (no IR)
			* 4920 MHz [184] (disabled)
			* 4940 MHz [188] (disabled)
			* 4960 MHz [192] (disabled)
			* 4980 MHz [196] (disabled)
...
The "no IR" message means it's not allowed to initiate radiation first, which disables AP on that channel. To allow it to IR, you need to change/set the regulatory domain for the wifi. In the old days (Ubuntu 20.04) you would do it with /sbin/iw reg set RO with the country code. But now, it doesn't work...

So, the network adapter remains with country unset even if you try to set it.

Code: Select all

# iw reg get
global
country 00: DFS-UNSET
	(2402 - 2472 @ 40), (6, 20), (N/A)
	(2457 - 2482 @ 20), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
	(2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
	(5170 - 5250 @ 80), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
	(5250 - 5330 @ 80), (6, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
	(5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
	(5735 - 5835 @ 80), (6, 20), (N/A), PASSIVE-SCAN
	(57240 - 63720 @ 2160), (N/A, 0), (N/A)

Doing some digging, it seems that there is a "crda" program/package that is called by iw reg set which causes the kernel to load the correct domain.
However, it seems that since kernel 4.15 crda is not needed anymore, since the kernel loads regulatory data from a database in the firmware. And Ubuntu 22.04 deprecated the package and removed it completely. iw reg set now fails quietly, without indicating the true problem.

Code: Select all

# apt-get install crda
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package crda is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'crda' has no installation candidate

https://bugs.launchpad.net/ubuntu/+sour ... ug/1958918

Now, I haven't dug into what the correct way is to set regulatory domain in newer kernels (I'm on 5.13 currently), but my workaround was to track down and install crda from Ubuntu 20.04:

Code: Select all

# wget  	http://ports.ubuntu.com/pool/main/c/crda/crda_3.18-1build1_arm64.deb
# dpkg -i crda_3.18-1build1_arm64.deb 
Selecting previously unselected package crda.
(Reading database ... 93545 files and directories currently installed.)
Preparing to unpack crda_3.18-1build1_arm64.deb ...
Unpacking crda (3.18-1build1) ...
Setting up crda (3.18-1build1) ...
Processing triggers for man-db (2.10.2-1) ...

Now iw reg get/set work as intended:

Code: Select all

# iw reg set RO
# iw reg get
global
country RO: 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 - 5725 @ 160), (N/A, 26), (0 ms), DFS
	(5725 - 5875 @ 80), (N/A, 13), (N/A)
	(57000 - 66000 @ 2160), (N/A, 40), (N/A)

# iw list
...
	Band 2:
		Capabilities: 0x2fe
			HT20/HT40
			SM Power Save disabled
			RX Greenfield
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			RX STBC 2-streams
			Max AMSDU length: 3839 bytes
			No DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 2 usec (0x04)
		HT TX/RX MCS rate indexes supported: 0-15, 32
		Bitrates (non-HT):
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 5180 MHz [36] (23.0 dBm)
			* 5190 MHz [38] (23.0 dBm)
			* 5200 MHz [40] (23.0 dBm)
			* 5210 MHz [42] (23.0 dBm)
			* 5220 MHz [44] (23.0 dBm)
			* 5230 MHz [46] (23.0 dBm)
			* 5240 MHz [48] (23.0 dBm)
			* 5250 MHz [50] (20.0 dBm) (radar detection)
			* 5260 MHz [52] (20.0 dBm) (radar detection)
			* 5270 MHz [54] (20.0 dBm) (radar detection)
			* 5280 MHz [56] (20.0 dBm) (radar detection)
			* 5290 MHz [58] (20.0 dBm) (radar detection)
			* 5300 MHz [60] (20.0 dBm) (radar detection)
			* 5310 MHz [62] (20.0 dBm) (radar detection)
			* 5320 MHz [64] (20.0 dBm) (radar detection)
			* 5500 MHz [100] (26.0 dBm) (radar detection)
			* 5510 MHz [102] (26.0 dBm) (radar detection)
			* 5520 MHz [104] (26.0 dBm) (radar detection)
			* 5530 MHz [106] (26.0 dBm) (radar detection)
			* 5540 MHz [108] (26.0 dBm) (radar detection)
			* 5550 MHz [110] (26.0 dBm) (radar detection)
			* 5560 MHz [112] (26.0 dBm) (radar detection)
			* 5570 MHz [114] (26.0 dBm) (radar detection)
			* 5580 MHz [116] (26.0 dBm) (radar detection)
			* 5590 MHz [118] (26.0 dBm) (radar detection)
			* 5600 MHz [120] (26.0 dBm) (radar detection)
			* 5610 MHz [122] (26.0 dBm) (radar detection)
			* 5620 MHz [124] (26.0 dBm) (radar detection)
			* 5630 MHz [126] (26.0 dBm) (radar detection)
			* 5640 MHz [128] (26.0 dBm) (radar detection)
			* 5650 MHz [130] (26.0 dBm) (radar detection)
			* 5660 MHz [132] (26.0 dBm) (radar detection)
			* 5670 MHz [134] (26.0 dBm) (radar detection)
			* 5680 MHz [136] (26.0 dBm) (radar detection)
			* 5690 MHz [138] (26.0 dBm) (radar detection)
			* 5700 MHz [140] (26.0 dBm) (radar detection)
			* 5745 MHz [149] (13.0 dBm)
			* 5755 MHz [151] (13.0 dBm)
			* 5765 MHz [153] (13.0 dBm)
			* 5775 MHz [155] (13.0 dBm)
			* 5785 MHz [157] (13.0 dBm)
			* 5795 MHz [159] (13.0 dBm)
			* 5805 MHz [161] (13.0 dBm)
			* 5825 MHz [165] (13.0 dBm)
			* 4920 MHz [184] (disabled)
			* 4940 MHz [188] (disabled)
			* 4960 MHz [192] (disabled)
			* 4980 MHz [196] (disabled)
...
Hope this helps!

User avatar
odroid
Site Admin
Posts: 39381
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2617 times
Been thanked: 1430 times
Contact:

Re: [SOLVED]Wifi AP mode stopped working after upgrading to Ubuntu 22.04

Post by odroid »

Did you use this WiFi module 4 for the AP mode settings?
Image

Can you please try this WiFi Module 5B(K) too when you have time?
Image

User avatar
mad_ady
Posts: 10739
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 647 times
Been thanked: 935 times
Contact:

Re: [SOLVED]Wifi AP mode stopped working after upgrading to Ubuntu 22.04

Post by mad_ady »

Yes, I'm currently using Wifi module 4. I'll give module 5 a try sometime next week.
These users thanked the author mad_ady for the post:
odroid (Mon Jul 18, 2022 10:25 am)

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 2 guests