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/12 22:17]
jacobe
products:sbc:common:configurations:setting-the-wi-fi-country-code [2025/10/13 07:51] (current)
nick
Line 4: Line 4:
 By default, the Wi-Fi module's **Country Code** is set to ''00'' (global).   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.   Wi-Fi channels and power levels are regulated differently in each country.  
-To ensure proper functionality and legal compliance when using the device outside of China, you may need to set the Country Code to match your current 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. This can prevent issues where certain Wi-Fi networks are not visible or the connection is 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.  +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. This is the standard path used across the system.
  
-'' 
-/lib/firmware/brcm/ 
-'' 
  
 ===== 3. Identifying the Configuration File ===== ===== 3. Identifying the Configuration File =====
-The configuration file for a specific Wi-Fi module follows the naming convention: +The configuration file for a specific Wi-Fi module follows the naming convention: ''config_xxxxx.txt''.
- +
-<code>config_xxxxx.txt</code>+
  
 where **xxxxx** corresponds to the module's firmware filename. where **xxxxx** corresponds to the module's firmware filename.
Line 25: Line 20:
 === Examples === === Examples ===
  
-  * AP6275S → ''config_bcm43752a2_ag.txt''   +  * AP6275S(VIM4) - ''config_bcm43752a2_ag.txt''   
-  * AP6275P → ''config_bcm43752a2_pcie_ag.txt''   +  * AP6275P(Edge2) - ''config_bcm43752a2_pcie_ag.txt''   
-  * AP6398S → ''config_bcm4359c0_ag.txt''+  * AP6398S(VIM3/3L) - ''config_bcm4359c0_ag.txt''
  
-===== 4. How to Set the Country Code =====+==== 4. Temporary Method: Using iw (for Testing) ==== 
 +This is the quickest way to change the country code. It's perfect for testing if a specific setting resolves your issue, **but the change will be lost after you reboot the device.** 
 + 
 +=== 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 
 +``` 
 +Verify the Change 
 +You can immediately check if the setting was applied using the iw reg get command: 
 + 
 +``` 
 +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 problem, you should proceed to the permanent method below. 
 + 
 +===== 5. Permanent Method: Editing the Config File (Recommended) =====
 You can change the Country Code by editing the appropriate configuration file. You can change the Country Code by editing the appropriate configuration file.
  
 === Example: Setting Country Code for Italy (IT) === === Example: Setting Country Code for Italy (IT) ===
  
-[[https://dl.khadas.com/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 > 
 +For VIM4 and Edge2, the regrev value for all countries is 0, such as the United states: US/0. 
 +</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 59: Line 76:
  
  
-===== 5. Apply and Verify the Changes =====+===== 6. Apply and Verify the Changes =====
  
 === Step 1: Reboot the System === === Step 1: Reboot the System ===
Line 86: Line 103:
  
 ==== Summary ==== ==== Summary ====
-  * Edit the correct config_*.txt file under /lib/firmware/brcm/+  * Edit the correct ''config_*.txt'' file under ''/lib/firmware/brcm/''
   * Set proper ccode and regrev   * Set proper ccode and regrev
   * Reboot and verify via dmesg   * Reboot and verify via dmesg
  
Last modified: 2025/10/12 22:17 by jacobe