Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common:configurations:setting-the-wi-fi-country-code

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:common:configurations:setting-the-wi-fi-country-code [2025/10/13 02:04]
jacobe
products:sbc:common:configurations:setting-the-wi-fi-country-code [2026/05/11 02:11] (current)
nick
Line 1: Line 1:
-====== Wi-Fi Country Code Configuration Guide ======+====== Wi-Fi country code configuration guide ====== 
 +===== Introduction =====
  
-===== 1. Introduction ===== +By default, the Wi-Fi module's Country Code is set to ''00'' (global). 
-By default, the Wi-Fi module'**Country Code** is set to ''00'' (global).   +Wi-Fi channels and transmit power levels are regulated differently in each country. 
-Wi-Fi channels and 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.
-To ensure proper functionality and legal compliance when using the device in different country, you may need to set the Country Code to match your current location.  +
  
-This can prevent issues where certain Wi-Fi networks are not visible or the connection is unstable.+Setting the correct country code can prevent issues where certain Wi-Fi networks are not visible or connections are unstable.
  
-===== 2. Firmware and Configuration Path ===== +===== Firmware and configuration path =====
-On **Ubuntu-based systems**, the firmware and configuration files for Broadcom Wi-Fi modules are located in the following directory.   +
-This is the standard path used across the system.+
  
-'' +On Ubuntu-based systems, the firmware and configuration files for Broadcom Wi-Fi modules are located in the following directory: ''/lib/firmware/brcm/''
-/lib/firmware/brcm/ +This is the standard system path.
-''+
  
-===== 3. Identifying the Configuration File ===== +===== Identifying the configuration file =====
-The configuration file for a specific Wi-Fi module follows the naming convention:+
  
-<code>config_xxxxx.txt</code>+The configuration file for a specific Wi-Fi module follows the naming convention: ''config_xxxxx.txt''.
  
-where **xxxxx** corresponds to the module'firmware filename.+Here, xxxxx corresponds to the firmware filename of the specific Wi-Fi module. 
 +Examples
  
-=== Examples ===+    AP6275S (VIM4) - config_bcm43752a2_ag.txt
  
-  * AP6275S(VIM4) → ''config_bcm43752a2_ag.txt''   +    AP6275P (Edge2/Edge-2Lconfig_bcm43752a2_pcie_ag.txt
-  * AP6275P(Edge2) → ''config_bcm43752a2_pcie_ag.txt''   +
-  * AP6398S(VIM3/3L) → ''config_bcm4359c0_ag.txt''+
  
-===== 4. How to Set the Country Code ===== +    AP6398S (VIM3/VIM3L) - config_bcm4359c0_ag.txt
-You can change the Country Code by editing the appropriate configuration file.+
  
-=== ExampleSetting Country Code for Italy (IT) ===+===== Temporary methodusing iw for testing =====
  
-[[https://dl.khadas.com/resources/development/wifi/get-ccode-regrev.xlsx|Check ccode and regrev correspondence]]+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]]
  
 <WRAP important > <WRAP important >
-For VIM4 and Edge2, the regrev value for all countries is 0, such as the United states: US/0.+For VIM4Edge2 and Edge-2L, the ''regrev'' value for all countries is ''0''. For example, the United States is configured as ''US/0''.
 </WRAP> </WRAP>
  
 1. Open the configuration file with a text editor.   1. Open the configuration file with a text editor.  
  
-For the AP6398S module, use:+For the AP6398S(VIM3/3L) module, use:
  
 ``` ```
Line 48: Line 67:
 ``` ```
  
-2. Modify the file content to specify the desired **ccode** and **regrev** values.  +2. Modify the file to specify the desired **ccode** and **regrev** values.
- +
 For Italy, the configuration should be: For Italy, the configuration should be:
  
Line 58: Line 76:
  
 === IMPORTANT === === IMPORTANT ===
-The correct values for ccode and regrev are specific to your Wi-Fi module and country.   + 
-You must consult the appropriate regulatory documentation or tables for your hardware.   +The correct values for **ccode** and **regrev** are specific to your Wi-Fi module model and target country. 
-Using incorrect values may result in improper device operation.+You must consult the appropriate regulatory documentation or tables for your hardware. 
 +Using incorrect values may cause improper device operation or violate local regulations.
  
  
-===== 5. Apply and Verify the Changes =====+===== Apply and verify the changes =====
  
-=== Step 1: Reboot the System ===+===Reboot the system ====
 After saving the configuration file, reboot the device for the changes to take effect. After saving the configuration file, reboot the device for the changes to take effect.
  
Line 72: Line 91:
 ``` ```
  
-=== Step 2: Verify the Setting ===+===Verify the setting ====
 After rebooting, confirm that the new Country Code has been applied by checking the kernel messages: After rebooting, confirm that the new Country Code has been applied by checking the kernel messages:
  
 ``` ```
-dmesg | grep Country+dmesg | grep -i Country
 ``` ```
  
Line 90: Line 109:
  
 ==== Summary ==== ==== Summary ====
-  * Edit the correct ''config_*.txt'' file under ''/lib/firmware/brcm/'' +  * Identify and edit the correct ''config_*.txt'' file under ''/lib/firmware/brcm/''. 
-  * Set proper ccode and regrev +  * Set the proper ''ccode'' and ''regrev'' values based on your hardware and country. 
-  * Reboot and verify via dmesg+  * Reboot the device and verify the change via ''dmesg''.
  
Last modified: 2025/10/13 02:04 by jacobe