mikedefieslife
Posts: 30
Joined: Sat May 26, 2018 5:31 pm

Yet another "Wifi country is not set" problem

Tue May 29, 2018 3:16 pm

Well it seems I get to join the list of people with a Pi 3B+ who cannot set up wifi.

In NOOBs I get the message that wifi country is not set. No matter how many times I set it, or even if I manually add it to wpa_supplicant.conf I'm still unable t use wifi.

I've not so far found a valid fix for this yet.

Here's the config:

Code: Select all

country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        ssid="mynetwork"
        psk="mypassword"
        key_mgmt=WPA-PSK
}
sudo ifdown wlan0 && sudo ifup wlan0:

Code: Select all

ifdown: interface wlan0 not configured
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
ifup: failed to bring up wlan0

MaxTheSpy
Posts: 116
Joined: Sat May 26, 2018 11:58 pm

Re: Yet another "Wifi country is not set" problem

Tue May 29, 2018 5:23 pm

I have found that when performing setup, it is easiest to set up wifi before you get to the desktop. You can do this by loading noobs to a flash drive and right before you click install Raspberry or whatever OS you will be running to go ahead and click on the Wifi or network button near the top of the window.

Alternatively, in the menu go to raspberry>Raspberry Preferences>Locale> select your location settings from there.

a third way to do this is

Code: Select all

sudo raspi-config
and get into the locale settings from there and set them. It might be under advanced I'm not too sure.

NOTE: Some people have had problems with locales not saving from the config screen.

Let me know if this helps. I had to jump through all these same hoops. If you are not too worried about losing some stuff, just flash noobs again and set it up on the install screen.
Ask Me About:
Plex Media Server (PMS)
RasPlex

mikedefieslife
Posts: 30
Joined: Sat May 26, 2018 5:31 pm

Re: Yet another "Wifi country is not set" problem

Tue May 29, 2018 5:28 pm

I forgot that I tried that and got

"could not communicate with wpa_supplicant"

MaxTheSpy
Posts: 116
Joined: Sat May 26, 2018 11:58 pm

Re: Yet another "Wifi country is not set" problem

Tue May 29, 2018 5:42 pm

mikedefieslife wrote:
Tue May 29, 2018 5:28 pm
I forgot that I tried that and got

"could not communicate with wpa_supplicant"

Which way?
A. From noobs first Boot
B. The Menu
C- Raspi-config
Ask Me About:
Plex Media Server (PMS)
RasPlex

mikedefieslife
Posts: 30
Joined: Sat May 26, 2018 5:31 pm

Re: Yet another "Wifi country is not set" problem

Tue May 29, 2018 5:47 pm

From 'sudo raspi-config'

MaxTheSpy
Posts: 116
Joined: Sat May 26, 2018 11:58 pm

Re: Yet another "Wifi country is not set" problem

Tue May 29, 2018 5:50 pm

mikedefieslife wrote:
Tue May 29, 2018 5:47 pm
From 'sudo raspi-config'
Alright, that is the most problematic solution I have come across so far. You are not the only one though. Are you running command line or desktop?
Ask Me About:
Plex Media Server (PMS)
RasPlex

mikedefieslife
Posts: 30
Joined: Sat May 26, 2018 5:31 pm

Re: Yet another "Wifi country is not set" problem

Tue May 29, 2018 5:54 pm

Desktop. It actually worked perfectly fine when I had a headless setup.

Worse case is I do a reinstall, but I've since setup netatalk etc.. and would rather not have to do it over.

I can cope with a wired connection for now until I (well someone smarter than me) can figure it out.

MaxTheSpy
Posts: 116
Joined: Sat May 26, 2018 11:58 pm

Re: Yet another "Wifi country is not set" problem

Tue May 29, 2018 6:08 pm

mikedefieslife wrote:
Tue May 29, 2018 5:54 pm
Desktop. It actually worked perfectly fine when I had a headless setup.

Worse case is I do a reinstall, but I've since setup netatalk etc.. and would rather not have to do it over.

I can cope with a wired connection for now until I (well someone smarter than me) can figure it out.


try going through the desktop settings then. Go to the raspberry icon in the top left, then go to Raspbian preferences and then go to the far right tab, should be locale. Try that and see if it works through there.
Ask Me About:
Plex Media Server (PMS)
RasPlex

mikedefieslife
Posts: 30
Joined: Sat May 26, 2018 5:31 pm

Re: Yet another "Wifi country is not set" problem

Sat Jun 02, 2018 8:31 am

I have a fresh install but still the same issues.

The only way to get the locale for wifi set is to run

Code: Select all

sudo iw reg set GB
Setting via the GUI, by raspi-config, or manually in the wpa_supplicant does not work. Of course the code above then needs doing on each reset.

And still once I get around the locale problem, I have a problem with the interface itself.

Code: Select all

sudo ifdown wlan0 && sudo ifup wlan0
ifdown: interface wlan0 not configured
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
ifup: failed to bring up wlan0
Here is my etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
I'm at a loss as to what to try to next.

User avatar
davidcoton
Posts: 4405
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Yet another "Wifi country is not set" problem

Sat Jun 02, 2018 9:53 am

ifdown: interface wlan0 not configured
I think you need to add the network definition to wpa_supplicant.conf. There are many examples on the forum.
Signature retired

mikedefieslife
Posts: 30
Joined: Sat May 26, 2018 5:31 pm

Re: Yet another "Wifi country is not set" problem

Sat Jun 02, 2018 3:54 pm

It makes no difference. I've tried, not that I should have to though. I should be able to join any network ssid without specifying one in wpa_supplicant.conf.

Looking around the forums and stack exchange this does seem to be a common problem with the Pi that unfortunately hasn't fully been addressed, like the country code issue.

I do appreciate the advice and help on offer in sorting it out.

steeley
Posts: 6
Joined: Fri Jun 22, 2012 3:00 pm

Re: Yet another "Wifi country is not set" problem

Mon Jul 16, 2018 2:51 pm

Yes, they have really screwed up with this built-in wifi - this issue has been going on for months.

Unfortunately, until they fix it use a USB wifi stick. This works just like the previous PIs under Raspbian Jesse etc.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Yet another "Wifi country is not set" problem

Mon Jul 16, 2018 3:43 pm

Mine has worked fine with the RPi Zero W and the RPi3B and B+. Maybe I am just lucky?

jdonald
Posts: 430
Joined: Fri Nov 03, 2017 4:36 pm

Re: Yet another "Wifi country is not set" problem

Fri Dec 14, 2018 10:26 pm

Hey guys, this was bothering me as well on only one of my Raspbian 9.6 SD cards (following a long overdue sudo apt upgrade; sudo rpi-update).

WiFi would work fine when the same SD card was inserted into a Pi 3, but not a Pi 3B+, and a WiFi dongle continued to work with either. As this 3B+ specific problem sounded familiar, I ended up grabbing the four firmware files listed here: https://github.com/bamarni/pi64/pull/76/files

And that fixed it. Hope this may help others.

333over106
Posts: 2
Joined: Tue Dec 18, 2018 10:04 pm

Re: Yet another "Wifi country is not set" problem

Tue Dec 18, 2018 10:25 pm

Today I was setting up a 3B+ for someone. By some miracle, I got wifi to work, on both 2.4 and 5GHz. But I then wanted to turn wifi OFF. The lxpanel networking icon seemed confused, and wanted me to set the country code (which was already properly set up in /etc/wpa_supplicant/wpa_supplicant.conf as country=GB). "Click here to set the code", it said, and refused to offer to turn wifi off, or show me any nearby SSIDs. I clicked and set the code (GB); over and over again, to no avail, updating stuff, rebooting, poking around, with mounting levels of frustration.

What worked was to set the code to somewhere random (for Gabon, I think), say OK, and then set it back to GB. The lxpanel icon is now normal, and useful. Perhaps that should have been an obvious thing to try. Nevertheless, it might be a tip worth passing on to others as literal-minded as me.

vivekascoder
Posts: 2
Joined: Thu Aug 15, 2019 7:21 am

Re: Yet another "Wifi country is not set" problem

Thu Aug 15, 2019 7:44 am

All right dude i also had the same problem . But in my case i am using berryboot .
So to fix it i go to my berry boot menu and configure wifi from there and it fixed that issue.

vguttmann
Posts: 1
Joined: Sat Jan 18, 2020 2:51 pm

Re: Yet another "Wifi country is not set" problem

Sat Jan 18, 2020 2:56 pm

Hey Guys, I found the solution:
First:

Code: Select all

sudo nano /etc/wpa_supplicant/wpa_supplicant-wlan0.conf

Then add:

Code: Select all

ctrl_interface=/run/wpa_supplicant
update_config=1
country=DE

Feel free to adjust the country as you need it. This has saved the day for me.

Return to “Troubleshooting”