Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiFi region always "world" even when specified otherwise in wpa_supplicant.conf #23

Open
coolbho3k opened this issue Mar 14, 2022 · 9 comments

Comments

@coolbho3k
Copy link
Contributor

coolbho3k commented Mar 14, 2022

The WiFi region on MiSTer seems to always be "world", even if it's set to TW or US or anything else in wpa_supplicant.conf.

As a result, I can't see my 5 GHz access point when it's set to certain US-specific channels, even when wpa_supplicant.conf is set to US. Being set to world may also limit the transmit power of the USB dongle, but this is a less critical issue.

Talking with @birdybro in the channel, we think that we need CRDA to be able to set the WiFi region correctly. Can we add it?

My adapter is a Asus AC-53 Nano (RTL8812BU), but from what I understand this doesn't matter.

Symptoms:

  • Run iw reg get on any MiSTer and you get this:
# iw reg get
global
country 00: DFS-UNSET
  • As a result the region being set to world, MiSTer won't ever see or connect to APs on certain region-specific channels even if wpa_supplicant.conf is configured correctly.
@sorgelig
Copy link
Member

i've tried to add crda which didn't fix the issue. iw reg set US doesn't change the region. What i've read is that region is handled by kernel itself. It reads /lib/firmware/regulatory.db and then should handle it somehow. I have no idea how it works, so if you know more then you can tinker with kernel config to find a working solution.

@coolbho3k
Copy link
Contributor Author

Thanks, I'll keep poking. Firmware is definitely there.

@coolbho3k
Copy link
Contributor Author

coolbho3k commented Mar 15, 2022

I think I may have narrowed it down to the fact that cfg80211 was trying to load regulatory.db prior to the rootfs being mounted, similar to the problem this person was facing: https://unix.stackexchange.com/questions/513449/unable-to-load-regulatory-database

Their solution was to build cfg80211 as a module.

So the reason I think this is that I get this log in dmesg:
regulatory.0: direct firmware load for regulatory.db failed with error -2

Prior to seeing messages about the rootfs being mounted.

@sorgelig
Copy link
Member

ok. i will try it as a module. probably tomorrow

@coolbho3k
Copy link
Contributor Author

Thanks. @amstan and I have also been hacking at it so will let you know if we get to it first.

@sorgelig
Copy link
Member

yes, i can set region now. Although i'm not sure how to test it. I will post test version here later.

@sorgelig
Copy link
Member

try this test build of linux+kernel:
https://mega.nz/file/MQIgXbSZ#5ycVQd8XvMn-hUYtMV30wRwv62JqxHdHNNkqJaBv8ic

@coolbho3k
Copy link
Contributor Author

coolbho3k commented Mar 17, 2022

I'll try this tonight. My way of trying it is to set my router's channel to 100 and just see if the MiSTer can find the SSID before and after.

@coolbho3k
Copy link
Contributor Author

coolbho3k commented Mar 18, 2022

I think it's still worth keeping CONFIG_CFG80211=m. That's definitely better as iw reg set now works, and the kernel is now respecting the region set in wpa_supplicant.conf too.

It actually doesn't work for me - I can't scan channel 52 or 100. But I suspect my problem now might be specific to Realtek chipsets. I've read we might need to set CONFIG_RTW_IOCTL_SET_COUNTRY=y for Realtek.

This is a rabbit hole. If you don't have the adapter or the time, I can keep debugging as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants