Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:edge2:configurations:wi-fi-country-code-configuration-guide

Edge2 Wi-Fi Country Code Configuration Guide

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

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

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 (Edge-2L) - config_bcm43752a2_pcie_ag.txt
  AP6398S (VIM3/VIM3L) - config_bcm4359c0_ag.txt

4. 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. 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:

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.

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

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: Check ccode and regrev correspondence

For VIM4 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 ccodeand 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.

6. 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 -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.
2025/10/12 21:33 · jacobe
Last modified: 2025/10/13 06:05 by jacobe