Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

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

This is an old revision of the document!


Wi-Fi Country Code Configuration Guide

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.

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. This is the standard path used across the system.

/lib/firmware/brcm/

3. Identifying the Configuration File

The configuration file for a specific Wi-Fi module follows the naming convention:

config_xxxxx.txt

where xxxxx corresponds to the module's firmware filename.

Examples

  • AP6275S → config_bcm43752a2_ag.txt
  • AP6275P → config_bcm43752a2_pcie_ag.txt
  • AP6398S → config_bcm4359c0_ag.txt

4. How to Set the Country Code

You can change the Country Code by editing the appropriate configuration file.

Example: Setting Country Code for Italy (IT)

Check ccode and regrev correspondence

Note: For AP6275S and AP6275P, the regrev value for all countries is 0, such as the United States: US/0.

1. Open the configuration file with a text editor.

For the AP6398S module, use:

sudo nano /lib/firmware/brcm/config_bcm4359c0_ag.txt

2. Modify the file content 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 and country. You must consult the appropriate regulatory documentation or tables for your hardware. Using incorrect values may result in improper device operation.

5. Apply and Verify the Changes

Step 1: Reboot the System

After saving the configuration file, reboot the device for the changes to take effect.

sudo reboot

Step 2: Verify the Setting

After rebooting, confirm that the new Country Code has been applied by checking the kernel messages:

dmesg | grep 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

  • Edit the correct config_*.txt file under /lib/firmware/brcm/
  • Set proper ccode and regrev
  • Reboot and verify via dmesg
Last modified: 2025/10/12 22:22 by jacobe