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
products:sbc:common:configurations:setting-the-wi-fi-country-code [2025/10/13 07:51]
nick
products:sbc:common:configurations:setting-the-wi-fi-country-code [2026/02/03 01:43] (current)
gray update by using AI
Line 1: Line 1:
 ====== Wi-Fi Country Code Configuration Guide ====== ====== Wi-Fi Country Code Configuration Guide ======
- 
 ===== 1. Introduction ===== ===== 1. Introduction =====
-By default, the Wi-Fi module's **Country Code** is set to ''00'' (global).   
-Wi-Fi channels and power levels are regulated differently in each country.   
-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.+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.
  
 ===== 2. Firmware and Configuration Path ===== ===== 2. 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 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/''.
 +This is the standard system path.
  
 ===== 3. Identifying the Configuration File ===== ===== 3. Identifying the Configuration File =====
 +
 The configuration file for a specific Wi-Fi module follows the naming convention: ''config_xxxxx.txt''. 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 (Edge-2L) - config_bcm43752a2_pcie_ag.txt
-  * AP6275P(Edge2) - ''config_bcm43752a2_pcie_ag.txt''   +
-  * AP6398S(VIM3/3L) - ''config_bcm4359c0_ag.txt''+
  
-==== 4. Temporary Method: Using iw (for Testing) ==== +    AP6398S (VIM3/VIM3L) - config_bcm4359c0_ag.txt 
-This is the quickest way to change the country code. It'perfect for testing if a specific setting resolves your issue, **but the change will be lost after you reboot the device.**+ 
 +===== 4. Temporary Method: Using iw (for Testing) ===== 
 + 
 +This is the quickest way to change the country code. It'useful for testing if a specific setting resolves an issue. Howeverthis change is not persistent and will be lost after reboot
 +Set the Country Code 
 + 
 +Open a terminal and run the iw reg set command with the two-letter ISO country codeFor example, to set the country to Italy (''IT''):
  
-=== 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 sudo iw reg set IT
 ``` ```
-Verify the Change + 
-You can immediately check if the setting was applied using the iw reg get command:+==== Verify the Change ==== 
 + 
 +You can immediately check if the setting was applied:
  
 ``` ```
 sudo iw list | grep MHz sudo iw list | grep MHz
 ``` ```
-The output should show the frequency those are allowed in the set country. 
  
-If this temporary setting fixes your Wi-Fi problemyou should proceed to the permanent method below.+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.
  
 ===== 5. Permanent Method: Editing the Config File (Recommended) ===== ===== 5. Permanent Method: Editing the Config File (Recommended) =====
-You can change the Country Code by editing the appropriate configuration file.+ 
 +You can permanently change the Country Code by editing the appropriate configuration file.
  
 === Example: Setting Country Code for Italy (IT) === === Example: Setting Country Code for Italy (IT) ===
  
 +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]] [[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 VIM4 and Edge-2L, the ''regrev'' value for all countries is ''0''. For example, the United States is configured as ''US/0''.
 </WRAP> </WRAP>
  
Line 61: Line 70:
 ``` ```
  
-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 71: Line 79:
  
 === 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.
  
  
 ===== 6. Apply and Verify the Changes ===== ===== 6. Apply and Verify the Changes =====
  
-=== Step 1: Reboot the System ===+==== Step 1: 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 85: Line 94:
 ``` ```
  
-=== Step 2: Verify the Setting ===+==== Step 2: 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 103: Line 112:
  
 ==== 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: 2026/02/03 01:43 by gray