3

I do not want to see the following message when I login to my Pi (5.10.17-v8+ #1403 SMP PREEMPT Mon Feb 22 11:37:54 GMT 2021 aarch64 GNU/Linux):

Wi-Fi is currently blocked by rfkill.
Use raspi-config to set the country before use.

How can I make it so that this message does not show up when I login by SSH?

2

Run sudo raspi-config and set the wifi country code by going to

5 Localisation Options

Then

L4. WLAN Country

Then select your country code from the list

2
  • 1
    Do you know of a way to do this programmatically? – Gordon Fogus Apr 11 at 1:32
  • 1
    @GordonFogus - yes - you can use raspi-config non-interactively ... sudo raspi-config nonint do_wifi_country XX - use appropriate value for XX – Jaromanda X Apr 11 at 2:58
2

The easiest way (that I've found) to programmatically make this message go away was to add the following to /boot/config.txt:

dtoverlay=disable-wifi

Yes, this does disable WiFi, but that was not a constraint in the original question (in other words, the question didn't say that disabling WiFi was unacceptable).

While I was at it, I also disabled Bluetooth, since I didn't need that either:

dtoverlay=disable-bt
1

No matter what I tried the raspi-config always failed with:

Could not communicate with wpa_supplicant

I already had the country code in the /etc/wpa_applicant/wpa_applicant.conf too.

In the end I used the rfkill command to enable it manually.

# rfkill unblock wifi

This seems to preserve the unblocked status, at least through warm-reboots.

Then (with quite a bit more stuffing around) it all worked.

It's a bit of a shame the "out-of-box" configuration scripts can't get this working.

0

I'm stealing/promoting @Jaromanda X's answer here, as it's a one-liner and avoids having to use the "GUI" to set the Wi-Fi region/country:

sudo raspi-config nonint do_wifi_country XX

XX is country code, you can find your country's code here: https://en.wikipedia.org/wiki/ISO_3166-1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.