====== Wi-Fi country code configuration guide ====== ===== Introduction ===== 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. ===== Firmware and configuration path ===== 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. ===== Identifying the configuration file ===== 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 (Edge2/Edge-2L) - config_bcm43752a2_pcie_ag.txt AP6398S (VIM3/VIM3L) - config_bcm4359c0_ag.txt ===== Temporary method: using iw for testing ===== 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. 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 ``` ==== Verify the change ==== 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. ===== Permanent method: editing the config File ===== You can permanently change the Country Code by editing the appropriate configuration file, for example setting country code for Italy. First, consult the reference document to find the correct ccode and regrev values for your country and hardware: [[dl>resources/development/wifi/get-ccode-regrev.xlsx|Check ccode and regrev correspondence]] For VIM4, Edge2 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 ``` === IMPORTANT === The correct values for **ccode** and **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. ===== Apply and verify the changes ===== ==== Reboot the system ==== After saving the configuration file, reboot the device for the changes to take effect. ``` sudo reboot ``` ==== Verify the setting ==== 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**. ---- ==== Summary ==== * Identify and edit the correct ''config_*.txt'' file under ''/lib/firmware/brcm/''. * Set the proper ''ccode'' and ''regrev'' values based on your hardware and country. * Reboot the device and verify the change via ''dmesg''.