By default, the Wi-Fi module's Country Code is set to 00 (global).
Wi-Fi channels and transmit power levels are regulated differently in each country.
To ensure proper functionality and legal compliance when using the device in a specific country, you must set the Country Code to match your location.
Setting the correct country code can prevent issues where certain Wi-Fi networks are not visible or connections are unstable.
On Ubuntu-based systems, the firmware and configuration files for Broadcom Wi-Fi modules are located in the following directory: /lib/firmware/brcm/.
This is the standard system path.
The configuration file for a specific Wi-Fi module follows the naming convention: config_xxxxx.txt.
Here, xxxxx corresponds to the firmware filename of the specific Wi-Fi module. Examples
AP6275S (VIM4) - config_bcm43752a2_ag.txt
AP6275P (Edge-2L) - config_bcm43752a2_pcie_ag.txt
AP6398S (VIM3/VIM3L) - config_bcm4359c0_ag.txt
This is the quickest way to change the country code. It's useful for testing if a specific setting resolves an issue. However, this change is not persistent and will be lost after a reboot. Set the Country Code
Open a terminal and run the iw reg set command with the two-letter ISO country code. For example, to set the country to Italy (IT):
sudo iw reg set IT
You can immediately check if the setting was applied:
sudo iw list | grep MHz
The output should show the frequency ranges allowed in the country you set.
If this temporary setting resolves your Wi-Fi issue, proceed to the permanent method below.
You can permanently change the Country Code by editing the appropriate configuration file.
First, consult the reference document to find the correct ccode and regrev values for your country and hardware: Check ccode and regrev correspondence
For VIM4 and Edge-2L, the regrev value for all countries is 0. For example, the United States is configured as US/0.
1. Open the configuration file with a text editor.
For the AP6398S(VIM3/3L) module, use:
sudo nano /lib/firmware/brcm/config_bcm4359c0_ag.txt
2. Modify the file to specify the desired ccode and regrev values. For Italy, the configuration should be:
ccode=IT regrev=20
The correct values for ccodeand regrev are specific to your Wi-Fi module model and target country. You must consult the appropriate regulatory documentation or tables for your hardware. Using incorrect values may cause improper device operation or violate local regulations.
After saving the configuration file, reboot the device for the changes to take effect.
sudo reboot
After rebooting, confirm that the new Country Code has been applied by checking the kernel messages:
dmesg | grep -i Country
If the configuration was successful (for Italy), you should see output similar to:
[ 18.743736] Country code: IT (IT/20)
This confirms that the Country Code has been successfully set to IT with a regulatory revision of 20.
config_*.txt file under /lib/firmware/brcm/.ccode and regrev values based on your hardware and country.dmesg.