Raspberry Pi-Logo_2581x2581Fix ‘WiFi country not set’ error on Raspberry Pi Model 3 B+ by adding a country code to the wpa_supplicant.conf file.  Accessing your Raspberry Pi and setting the country code is essential for enabling WiFi on a Raspberry Pi Model 3 B+ and for using the WiFi module to connect your Homebridge, openHAB or Home Assistant application to your local network. 

Here is the error message ‘WiFi country not set’:

Raspberry Pi WiFi country not set_01_WiFI disabled because country not set

Raspberry Pi WiFi country not set_01_WiFI disabled because country not set

On the Raspberry Pi 3 Model B+, you need to set the country code, so that the 5G networking can choose the correct frequency bands. You can either use the raspi-config application and select the localisation option, or edit the wpa_supplicant.conf file and execute the following steps:

How to access your Raspberry Pi 3 Model B+

After you install the operating system and connect your Raspberry Pi to your network (and into power), you need to locate it so you can ssh into it and run some commands.

The default “Raspbian” OS will automatically broadcast its presence on your network under the mDNS name “raspberrypi”. If you are using Mac or Linux, you can reach your Pi easily:

ssh pi@raspberrypi.local

Note: SSH is disabled by default in recent version of Raspbian. For details, see this page for instructions to re-enable it.

The default username for Raspbian is pi and the password is raspberry.

If you have a different OS installed on your Pi or you can’t find it via pi@raspberrypi.local then you can try connecting to your home router by pointing your web browser at somewhere like http://192.168.0.1, http://192.168.1.1, http://10.1.1.1 etc. (this depends on the router you’re using and your network setup). Once you are logged in, you can usually find a list of devices connected to your network under “DHCP”.

Windows does not support ssh on the command line, but you can use a free SSH client like Putty to connect to your Pi.

How to set the country code for enabling WiFi on Raspberry Pi 3 Model B+ and fix ‘WiFi country not set’

Raspberry Pi WiFi country not set_02_adding country code to wpa_supplicant.conf file

Raspberry Pi WiFi country not set_02_adding country code to wpa_supplicant.conf file

Here is how to set the country code on Raspberry Pi 3 Model B+:

1. Open the wpa-supplicant configuration file in nano:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

2. Go to the bottom of the file and add the following:

country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="testing"
psk="testingPassword"
}

3. Type ‘control + X‘, then ‘Y‘ and ‘Enter‘ for saving and exiting. Done!

Note: You need to replace ‘GB‘ with the ISO code of your country. See Wikipedia for a list of country codes.

Checking the debugging: No error message anymore, WiFi is enabled:

Raspberry Pi WiFi country not set_03_no error message after setting country code

Raspberry Pi WiFi country not set_03_no error message after setting country code

Due to security reasons, you have to manually set up WiFi on a Raspberry Pi 3 Model B+. WiFi is enabled by adding the country code to the wpa_supplicant.conf file.

Stay tuned! 😉

About 

Hi there,

my name is Gee Are, blogger and analyst. Blogging is my Passion! I’m the founder and owner of the two blogs called pabst.socialmedia and miapple.me - Tech.Blog.

My work experience as a blogger and analysist (Internet Intelligence, SEO and social media) is the basis of the services of pabst.socialmedia.

Find more about me.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Comment