3

I'm a bit confused of the country property in wpa_supplicant.conf. In official Raspberry Wifi Documentation it says this:

On the Raspberry Pi 3 Model B+, you will also 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 add the following. (Note you need to replace 'GB' with the ISO code of your country. See Wikipedia for a list of country codes.)

So far everything was clear, until I encountered Wifi problems. I live in Spain 'ES', but I've set the country code to 'US' as the client I would ship the Raspbian image to is from there. I've sent him my Raspbian image and he mounted it on Pi 3B+ device. He connected to WiFi and obtained a wlan0 IP. The problem was when he wanted to connect to Pi from his device using wlan0 IP (Both devices were connected to same AP). It wouldn't connect and the request would time out eventually.

The fix was that he changed the country=US to country=ES

Therefore, he was using country=ES , while his device is located in the US and it apparently worked.

So what exactly is the purpose of setting the country in wpa_supplicant.conf? How come he was able to connect to Pi using wlan0 IP only after setting the country to ES?

  • 2
    the issue you describe is impossible ... fact is, "he" got an IP address, therefore the pi successfully connected to "his" router and successfully obtained, via DHCP, an IP address - that means the wifi on the pi and the AP are compatible ... don't trust what "he" says fixed the issue, "he" is probably mistaken - However, I do have a theory as to how changing the country code could behave that way - but the issue is not with the Pi – Jaromanda X Jan 30 at 10:53
1

The frequency allocations for 5GHz band differ between countries and there is NO UNIVERSAL SUBSET which is legal everywhere. (The 2.4GHz band supports channels 1-11 everywhere.)

It is a licensing condition that only supported bands are used - thus the need to set Country. (It is illegal to use unauthorised bands - but practically only bands supported by licensed routers would be used.)

  • But - why the OP has to use country=ES in the US instead of country=US? – Ingo Jan 31 at 1:12
  • 1
    @Ingo I was answering the OP's question "So what exactly is the purpose of setting the country in wpa_supplicant.conf?" It is impossible and futile to answer ill-defined questions with no evidence of an actual problem. – Milliways Jan 31 at 1:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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