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?