Skip to content

Instantly share code, notes, and snippets.

@francoism90
Last active December 22, 2024 17:49
Show Gist options
  • Save francoism90/3dede7973354d067c41bff5e54203fe9 to your computer and use it in GitHub Desktop.
Save francoism90/3dede7973354d067c41bff5e54203fe9 to your computer and use it in GitHub Desktop.
Change country to unlock channels, increase TX-power. (Use at your own risk)

Disclaimer

Following instructions are provided without any warranty, and may even get you in trouble legally. The instructions are provided for testing, learning, preventing e-waste, and should be use with care. We (including contributers + commentators) are not responsible for any damage to your device(s) or any legal issues.

Getting Started

Instructions have been moved to https://github.com/francoism90/asus-router. :)

@Warborn123
Copy link

Hi everyone, I got a dumb question. What does wl0, wl1 and wl2 stand for? Someone on the other forum said it's corresponding to 2.4GHz, 5GHz and 6GHz, but I start to think that's not the case?

@francoism90
Copy link
Author

@Warborn123 In most cases they are.

You could dump nvram before and after making changes, so check what values are being adjusted.

If I'm not mistaken commands exists as well, but I'm on mobile atm.

@Warborn123
Copy link

Warborn123 commented Dec 30, 2023

@Warborn123 In most cases they are.

You could dump nvram before and after making changes, so check what values are being adjusted.

If I'm not mistaken commands exists as well, but I'm on mobile atm.

Hmmm, interesting. I found the following code on the other forum, and applied it to my UK version AXE11000, and it worked. But I noticed that there's no wl2 command in there, but the TX power of the 6Ghz did get a massive boost. That's when I start to wonder what do wl0, wl1 and wl2 mean.

nvram set location_code=AU
nvram set wl0_country_code=AU
nvram set 0:ccode=AU
nvram set wl1_country_code=AU
nvram set 1:ccode=AU
nvram commit
service restart_wireless

Also, using this command nvram show | grep -e 'country_code\|location_code\|territory_code\|ccode', I got the following results:

0:ccode=AU
1:ccode=ALL
2:ccode=ALL
3:ccode=ALL
location_code=AU
territory_code=EU/01
size: 112260 bytes (18812 left)
wl0_country_code=ALL
wl1_country_code=ALL
wl2_country_code=ALL
wl_country_code=E0

It's quite strange, isn't it? Although the location code is AU now, but the territory code and wl_country are still EU? I was wondering if it's fine to leave it like this, or maybe I should find the command that change the territory_code and wl_country_code to AU as well? Thanks for your help!

@francoism90
Copy link
Author

@Warborn123 Unfortunately this is in most cases hardware related. They seem to force the region, with some hidden signals. Yeah, it's pretty weird.

So even when you set it, it doesn't mean it (fully) works.

@pasko-zh
Copy link

@Warborn123 : Were you also able to change 6 GHz channels on your AXE11000, i.e., to allow those US/Canada channels (channel 97, 6435 MHz and above) that are "forbidden" here in Europe?

@Warborn123
Copy link

Warborn123 commented Dec 30, 2023

@Warborn123 : Were you also able to change 6 GHz channels on your AXE11000, i.e., to allow those US/Canada channels (channel 97, 6435 MHz and above) that are "forbidden" here in Europe?

Yep, it's quite wild. I guess it has something to do with that ccode=ALL or wl2_country_code=ALL. My router now has almost all the frequency band unlocked for 2.4, 5 and 6GHz.

IMG_3481

@pasko-zh
Copy link

@Warborn123 : Were you also able to change 6 GHz channels on your AXE11000, i.e., to allow those US/Canada channels (channel 97, 6435 MHz and above) that are "forbidden" here in Europe?

Yep, it's quite wild. I guess it has something to do with that ccode=ALL or wl2_country_code=ALL. My router now has almost all the frequency band unlocked for 2.4, 5 and 6GHz.

Cool! That is good news. Thanks!

@robinjoo1
Copy link

@Warborn123 : Were you also able to change 6 GHz channels on your AXE11000, i.e., to allow those US/Canada channels (channel 97, 6435 MHz and above) that are "forbidden" here in Europe?

Yep, it's quite wild. I guess it has something to do with that ccode=ALL or wl2_country_code=ALL. My router now has almost all the frequency band unlocked for 2.4, 5 and 6GHz.

IMG_3481

thanks that worked for me and i didnt even have to include a file with that text/commands in init start :D

@nudeln
Copy link

nudeln commented Jan 15, 2024

I am a complete beginner in the field, but I think I was able to increase my signal as well on my RT-AX92U
running 3.0.0.4.388_23630-g9d6ee22, I have set nvram as per:
admin@RT-AX92U-95D0:/tmp/home/root# nvram dump | grep 'country|code|location|txpower'
1:ccode=ALL
2:ccode=ALL
3:ccode=ALL
ddns_return_code=,200
ddns_return_code_chk=,200
size: 83778 bytes (47294 left)
fb_country=
location_code=#a
modem_country=
modem_pincode=
modem_pincode_opt=1
oauth_google_auth_code=
rc_support=mssid 2.4G 5G update usbX2 switchctrl manual_stb 11AX pwrctrl WIFI_LOGO nandflash movistarTriple wifi2017 app ofdma wpa3 reboot_schedule ipv6 ipv6pt s46 ocnvc PARENTAL2 dnsfilter dnspriv dualwan pptpd openvpnd utf8_ssid printer modem webdav rrsut cloudsync media appnet timemachine hdspindown diskutility dnssec usb_bk frs_feedback dblog email 5G-2 bwdpi wrs_wbl ookla HTTPS letsencrypt ssh vpnc vpn_fusion repeater psta wl6 user_low_rssi tcode usericon cfg_wps_btn stainfo cloudcheck realip lacp wanbonding wtfast ifttt alexa ipsec_srv mumimo netool cfg_sync no_finiwl fupgrade afwupg betaupg amas bcmwifi bcmhnd mbo conndiag eula proxysta iperf3 gn_wbl amazon_wss account_binding gameMode wireguard ftp_ssl acl96 dhdlog dis11b smart_connect
secret_code=22774156
territory_code=UK/01
wl0_country_code=ALL
wl0_country_rev=0
wl0_txpower=300
wl1_country_code=ALL
wl1_country_rev=0
wl1_txpower=300
wl2_country_code=ALL
wl2_country_rev=0
wl2_txpower=300
wl_country_code=#a
wl_country_rev=0
wl_txpower=300
admin@RT-AX92U-95D0:/tmp/home/root# wl txpwr_target_max
Maximum Tx Power Target (chanspec:0x100e): 25.00 25.00 25.00

But I think location_code was the one that actually affected txpwr_target_max and had it increased from 15.25 to 25 dBm, and this also seems to be persistent. wl*_country_code are just set by the value of location_code.

Ubiquiti WiFiman also states 25 dBm, and I get the impression that my connection in the, from the router, most remote room has improved.
image

@Linden1
Copy link

Linden1 commented Feb 21, 2024

Quick question. It's great to have a little punch with the increased power, but communication works both ways. So has anyone made any beneficial changes to the rxgain settings?

@sarusani
Copy link

sarusani commented Feb 29, 2024

These settings work great on my RT-AC66U (Asuswrt-Merlin 374 LTS Beta - 374.43_53D7j9527)
I get about -20dBm on 2.4GHz and -10dBm on 5Ghz compared to stock.

#!/bin/sh

# Allow all channels
nvram set pci/1/1/ccode=#a
nvram set pci/1/1/regrev=0
nvram set pci/2/1/ccode=#a
nvram set pci/2/1/regrev=0
nvram set regulation_domain=#a
nvram set regulation_domain_5G=#a
nvram set wl_country_code=#a
nvram set wl_country_rev=0
nvram set wl0_country=#a
nvram set wl0_country_code=#a
nvram set wl0_country_rev=0
nvram set wl0_reg_mode=off
nvram set wl1_country=#a
nvram set wl1_country_code=#a
nvram set wl1_country_rev=0
nvram set wl1_reg_mode=off

# Channel selection
nvram set wl0_chanspec=1l
nvram set wl_chanspec=100/80
nvram set wl1_chanspec=100/80

# Set TX-Power
pci/1/1/maxp2ga0=0x78
pci/1/1/maxp2ga1=0x78
pci/1/1/maxp2ga2=0x78
pci/2/1/maxp5ga0=120,120,120,120
pci/2/1/maxp5ga1=120,120,120,120
pci/2/1/maxp5ga2=120,120,120,120
pci/2/1/maxp2ga0=120
pci/2/1/maxp2ga1=120
pci/2/1/maxp2ga2=120
nvram set wl0_TxPower=708
nvram set wl_TxPower=708
nvram set wl1_TxPower=708

# Commit changes
nvram commit

@pasko-zh
Copy link

pasko-zh commented Feb 29, 2024

@sarusani : Cool, let's see how much you are really blowing out 😁

  1. First check the maximal allowed dbm per channel, for 5GHz most likely eth6 is the correct interface on your router model: wl -i eth6 chanspec_txpwr_max
  2. Then check the nominal power (on some Asus models this is simply the value from 1. minus 1.5 dB): wl -i eth6 txpwr_target_max
  3. Check the maximum power with wl -i eth5 txpwr1 (Note: You can set this up to 30.75 dbm or so, but you cannot get this much of power out, because it is capped by the limit from 1.)
  4. With this you can check the last actual used power per antenna: wl -i eth6 txpwr_adj_est

@pasko-zh
Copy link

pasko-zh commented Feb 29, 2024

Quick question. It's great to have a little punch with the increased power, but communication works both ways. So has anyone made any beneficial changes to the rxgain settings?

Let's see how well your router is hearing your clients

  1. First see who is connected, for 5 GHz most likely the interface is eth6: wl -i eth6 assoclist
  2. Then for each connected client you can check: wl -i eth6 sta_info MAC ADDRESS OF CLIENT, then you see amomg many things, RSSI

In general, if your client has a very low RSSI seen from the AP, then you should try to improve Tx power on the client side. If your client runs on linux and has a wifi card which is not self-managed, then there might be options to do that, e.g., changing regulatory country settings with iw reg set XX etc. However: If your client has an Intel card, e.g., AX-2XX, with LAR (Location-Aware Regulatory), then you have to stick what LAR detects as country, you cannot override it with iw because the interface is shown as self-managed by LAR 💩

@sarusani
Copy link

I tried to get some infos, but I'm not very successful...

If I look at the nvram show data I can find eth0 & eth1 eth2:

acs_ifnames=eth1 eth2
wl_ifnames=eth1 eth2
lan_ifnames=vlan1 eth1 eth2
wl_ifname=eth2
wl0_ifname=eth1
wl1_ifname=eth2
wan_ifnames=eth0
wan0_ifname=eth0
ipv6_ifname=eth0

So eth1 is 2.4GHz and eth2 is 5GHz.

chanspec_txpwr_max, txpwr_target_max & txpwr_adj_est report
wl: Unsupported

txpwr1 reports
TxPower is 127 qdbm, 31.75 dbm, 1496 mW Override is Off

_sta_info_
5GHz (eth2)
Closest device: (about 3 meters from antennas)

rateset [ 6 9 12 18 24 36 48 54 ]
idle 10 seconds
in network 671 seconds
state: AUTHENTICATED ASSOCIATED AUTHORIZED
flags 0x613a: WME PS N_CAP
tx pkts: 437
tx failures: 0
rx ucast pkts: 861
rx mcast/bcast pkts: 42
rate of last tx pkt: 866667 kbps
rate of last rx pkt: 6000 kbps
rx decrypt succeeds: 456
rx decrypt failures: 0

Farthest device: (about 20 meters from antennas - one floor down)

rateset [ 6 9 12 18 24 36 48 54 ]
idle 1 seconds
in network 1180 seconds
state: AUTHENTICATED ASSOCIATED AUTHORIZED
flags 0x603a: WME N_CAP
tx pkts: 2772
tx failures: 0
rx ucast pkts: 3193
rx mcast/bcast pkts: 224
rate of last tx pkt: 216000 kbps
rate of last rx pkt: 200000 kbps
rx decrypt succeeds: 3535
rx decrypt failures: 0

2.4GHz (eth1)
Closest device:

rateset [ 1 2 5.5 6 9 11 12 18 24 36 48 54 ]
idle 0 seconds
in network 187 seconds
state: AUTHENTICATED ASSOCIATED AUTHORIZED
flags 0x613a: WME PS N_CAP
tx pkts: 10124
tx failures: 4
rx ucast pkts: 2582
rx mcast/bcast pkts: 55
rate of last tx pkt: 130000 kbps
rate of last rx pkt: 1000 kbps
rx decrypt succeeds: 2083
rx decrypt failures: 0

Farthest device:

rateset [ 1 2 5.5 6 9 11 12 18 24 36 48 54 ]
idle 2 seconds
in network 1707 seconds
state: AUTHENTICATED ASSOCIATED AUTHORIZED
flags 0x613b: BRCM WME PS N_CAP
tx pkts: 798
tx failures: 0
rx ucast pkts: 1570
rx mcast/bcast pkts: 593
rate of last tx pkt: 72222 kbps
rate of last rx pkt: 24000 kbps
rx decrypt succeeds: 1513
rx decrypt failures: 0

Some measurements from my phone: (about 3 meters away)
Stock:
2.4GHz & 5GHz: -37dBm

New:
2.44GHz: -14dBm
5GHz: -26dBm

@Linden1
Copy link

Linden1 commented Feb 29, 2024

Quick question. It's great to have a little punch with the increased power, but communication works both ways. So has anyone made any beneficial changes to the rxgain settings?

Let's see how well your router is hearing your clients

  1. First see who is connected, for 5 GHz most likely the interface is eth6: wl -i eth6 assoclist
  2. Then for each connected client you can check: wl -i eth6 sta_info MAC ADDRESS OF CLIENT, then you see amomg many things, RSSI

In general, if your client has a very low RSSI seen from the AP, then you should try to improve Tx power on the client side. If your client runs on linux and has a wifi card which is not self-managed, then there might be options to do that, e.g., changing regulatory country settings with iw reg set XX etc. However: If your client has an Intel card, e.g., AX-2XX, with LAR (Location-Aware Regulatory), then you have to stick what LAR detects as country, you cannot override it with iw because the interface is shown as self-managed by LAR 💩

Was just an enquiry but i hope your reply helps someone else understand too. I don't really have any connection problems, my furthest device gives an RSSI of -64dBm on 5GHz. I've also managed to tune to output power down a little to reduce interference with my wireless headphones.

@Reeplosin
Copy link

is there any way to set the territory code on an ac86u? i have also tried creating a chrono job, but nothing, once the router reboots it returns WE/02 and the AC script is not activated. also i would like to understand which country this code belongs to because it does not appear anywhere

@nudeln
Copy link

nudeln commented Mar 1, 2024

is there any way to set the territory code on an ac86u? i have also tried creating a chrono job, but nothing, once the router reboots it returns WE/02 and the AC script is not activated. also i would like to understand which country this code belongs to because it does not appear anywhere

Please try:
nvram set location_code=#a
nvram commit

And reboot. This trimmed my previously German registered RT-AX92U quite a lot.

@Reeplosin
Copy link

Reeplosin commented Mar 1, 2024 via email

@pasko-zh
Copy link

pasko-zh commented Mar 3, 2024

@Reeplosin and all fyi

In general: If you restart wireless service, you will always return to the values (country etc.) fixed in the driver/firmware (or more precise: To the specific selection burned in the ROM out of all possible values in the driver, see below) So, restarting of wireless service happens also--apart from view exceptions as mentioned above in the comments--when you change settings via GUI.

Thus, there are two ways to overcome this a) put NVRAM changes in the init-start script (and then never issue a restart of wirelss service) or b) do the changes via wl command.

For a) See comments above and follow the golden rule not to restart wireless service!

For b) :

  • make sure you have latest wl version, i.e. flash latest merlin firmware. On my AX58U and AXE11000, both on 3004.388.6_2, wl ver Broadcom BCA: 17.10 RC157.2809 wl0: Dec 15 2023 10:37:38 version 17.10.157.2809 (r801046) 8e0370b

  • check available commands of wl with: wl -h and, yes this gives a different result, wl -i eth6 -h (assuming eth6 is 5G here, you need to check devices on your router model)

  • Check which countries are available in your current firmware: wl country list You can only select one of this country listed here.

  • Each country comes with a certain list of "revisions". These are regulatory settings that have changed over time, you can check which ones are supported with e.g., wl country_rev US

  • You set a country with a specific revision as wl -i ethXX country "US/699" (For Country = ALL you don't need to specify the revision)

  • So, you can do on your asus, assuming eth6 is 5G:

wl -i eth6 down
wl -i eth6 country ALL
wl -i eth6 country_abbrev_override "US"
wl -i eth6 regulatory 1
wl -i eth6 chanspec 36/160
wl -i eth6 up
wl -i eth6 5g_rate auto
wl -i eth6 txpwr1 -o -m 1496

Result:

  1. Country ALL will result in the maximum power your device can blow out in 2G / 5G / 6G and make all channels selectable. The maximum power your router can blow out is limited in the driver/firmware for country = ALL. You cannot go higher than this, independant what you select in NVRAM or with 5. below. These values are fixed in the CLM (country locale matrix) Blob loaded into the driver. Check it wich wl clmver. Or if you manage to hack the CLM Blob, you could override and load it via wl -i eth6 clmload

  2. country_abbrev_override "US" this will make your wifi now look as if it has country US although it is set to ALL, i.e. the 802.11 beacon contains now country = US. This is very useful, if your clients in STAtion mode detect country settings based on beacon country info. If you don't send country info in the beacons, i.e. just set country to ALL, then your wifi client might switch to "world" mode. This is the least common denominator of all regulations on this planet, i.e. the most conservative setting: No (!) 6G and in 5G only very few channels with very little Tx power...

  3. regulatory 1 : Set 5G to 802.11d and disable 802.11h (DSF). You can check it with wl -i eth6 spect 802.11d mode

  4. chanspec : Set your channel here NOT in the GUI! Remember: Setting it in the GUI, will return to ROM settiings. For 80 or 160 MHz channels, you need to select a 20 MHz channel in the 80/160 MHz and not the center frequency of the 80/160 MHz channel. This will not work.
    Even on a AX58U you can use the full UNII-4 band, i.e. 165/160 is possible. Don't know if this will work on your router.
    Check settings with wl -i eth6 status Mode: Managed RSSI: 0 dBm SNR: 0 dB noise: -87 dBm Channel: 165/160 ...

  5. txpwr1 : See my comment above what this means.

NOTE: If your client uses Intel AX-2xx adpaters: You will always end up in a mess!! They use LAR... I changed to Mediatek MT7922 (RZ616). This one even gives me 6G on Windows 10 and has no LAR, so you can use all wifi channels.

@francoism90
Copy link
Author

@pasko-zh Very good info, will try to add it to the README. 👍

You could workaround LAR, but I don't think it's possible anymore, since most devices/firmwares use hidden signals as well. So even when you could disable LAR somehow, it would potentially be something else checking your country code.

Could you give more information about the county+ other nvram settings? I'd always understood CN/02 was the best one.

@Reeplosin
Copy link

@Reeplosine tutto per tua informazione

In generale: Se si riavvia il servizio wireless, si ritorneranno sempre ai valori (paese, ecc.) fissati nel driver/firmware (o più precisamente: alla selezione specifica masterizzata nella ROM tra tutti i valori possibili nel driver, vedere di seguito) Pertanto, il riavvio del servizio wireless avviene anche, a parte le eccezioni di visualizzazione come menzionato sopra nei commenti, quando si modificano le impostazioni tramite la GUI.

Pertanto, ci sono due modi per superare questo problema: a) inserire le modifiche NVRAM nello init-startscript (e quindi non riavviare mai il servizio wirelss) oppure b) eseguire le modifiche tramite wlcomando.

Per a) Vedi i commenti sopra e segui la regola d'oro per non riavviare il servizio wireless!

Per b):

  • assicurati di avere la versione wl più recente, ad esempio installa l'ultimo firmware Merlin. Sul mio AX58U e AXE11000, entrambi su 3004.388.6_2,wl ver Broadcom BCA: 17.10 RC157.2809 wl0: Dec 15 2023 10:37:38 version 17.10.157.2809 (r801046) 8e0370b
  • controlla i comandi disponibili di wl con: wl -he, sì, questo dà un risultato diverso wl -i eth6 -h(supponendo che eth6qui sia 5G, devi controllare i dispositivi sul tuo modello di router)
  • Controlla quali paesi sono disponibili nel tuo firmware attuale: wl country listpuoi selezionare solo uno dei paesi elencati qui.
  • Ogni paese viene fornito con un determinato elenco di "revisioni". Si tratta di impostazioni normative che sono cambiate nel tempo, puoi verificare quali sono supportate con ad es.wl country_rev US
  • Imposta un paese con una revisione specifica come wl -i ethXX country "US/699"(Per Paese = TUTTI non è necessario specificare la revisione)
  • Quindi, puoi fare sul tuo Asus, supponendo eth6 che sia 5G:
wl -i eth6 down
wl -i eth6 country ALL
wl -i eth6 country_abbrev_override "US"
wl -i eth6 regulatory 1
wl -i eth6 chanspec 36/160
wl -i eth6 up
wl -i eth6 5g_rate auto
wl -i eth6 txpwr1 -o -m 1496

Risultato:

  1. Country ALL garantirà la massima potenza che il tuo dispositivo può erogare in 2G / 5G / 6G e renderà tutti i canali selezionabili. La potenza massima che il router può erogare è limitata nel driver/firmware per paese = TUTTI. Non puoi andare più in alto di questo, indipendentemente da ciò che selezioni nella NVRAM o con 5. di seguito. Questi valori sono fissi nel BLOB CLM (matrice locale paese) caricato nel driver. Controlla quale wl clmver. Oppure, se riesci ad hackerare il BLOB CLM, puoi sovrascriverlo e caricarlo tramite wl -i eth6 clmload
  2. country_abbrev_override "US"questo farà sembrare che il tuo Wi-Fi abbia il paese USA anche se è impostato su TUTTI, ovvero il beacon 802.11 contiene ora paese = USA. Ciò è molto utile se i tuoi client in modalità STAtion rilevano le impostazioni del paese in base alle informazioni del paese del beacon. Se non invii informazioni sul paese nei beacon, ovvero imposti semplicemente il paese su TUTTI, il tuo client Wi-Fi potrebbe passare alla modalità "mondo". Questo è il minimo comune denominatore di tutte le normative del pianeta, ovvero l'impostazione più conservativa: niente (!) 6G e in 5G solo pochissimi canali con pochissima potenza Tx...
  3. regulatory 1: imposta 5G su 802.11d e disabilita 802.11h (DSF). Puoi verificarlo conwl -i eth6 spect 802.11d mode
  4. chanspec: Imposta il tuo canale qui NON nella GUI! Ricorda: impostandolo nella GUI, verranno ripristinate le impostazioni della ROM. Per i canali da 80 o 160 MHz, è necessario selezionare un canale da 20 MHz nel canale 80/160 MHz e non la frequenza centrale del canale 80/160 MHz. Questo non funzionerà.
    Anche su un AX58U è possibile utilizzare l'intera banda UNII-4, ovvero è possibile 165/160. Non so se funzionerà sul tuo router.
    Controlla le impostazioni con wl -i eth6 status Mode: Managed RSSI: 0 dBm SNR: 0 dB noise: -87 dBm Channel: 165/160 ...
  5. txpwr1 : Vedi il mio commento sopra cosa significa.

NOTA : Se il tuo client utilizza adattatori Intel AX-2xx: finirai sempre nei guai!! Usano LAR... Sono passato a Mediatek MT7922 (RZ616). Questo mi dà anche il 6G su Windows 10 e non ha LAR, quindi puoi usare tutti i canali Wi-Fi.

Interesting indeed. if i understand correctly i have to enter those commands inside the router, and do nvram commit right? seeing the model not if it also applies to ac86u, but i will take a look

@pasko-zh
Copy link

pasko-zh commented Mar 4, 2024

@pasko-zh Very good info, will try to add it to the README. 👍

You could workaround LAR, but I don't think it's possible anymore, since most devices/firmwares use hidden signals as well. So even when you could disable LAR somehow, it would potentially be something else checking your country code.

Could you give more information about the county+ other nvram settings? I'd always understood CN/02 was the best one.

Well, the wl command is a difficult animal. The help file is not really correct, i.e., many commands don't work. Some work on some models and some not. If you update the readme, this has to be clearly stated.
For instance, country_abbrev_override "US works on some router models, on some not. Also txpwr1 -o, where o stands for override, does not work...

Country Code:

  • The most less restrictive country setting, wrt to channels and Tx power, is #a (#a/0) <unknown>. (Whether set via NVRAM or via WL tool does not matter). You can easily compare different country settings regarding Tx power with wl -i ethXXX chanspec_txpwr_max. See above how to set a country per interface via WL tool.
  • Also, you cannot set your router to a country which is not in your firmware. Even if you set it in NVRAM, it has no effect. You get all supported countries via country list, see example for me (E0 is a superset for some european countries)
wl -i eth8 country list
Supported countries: country code and long name
#a
CA      CANADA
E0
KR      KOREA, REPUBLIC OF
US      UNITED STATES

So, no China 😀
Trying to set to China, gives:

wl -i eth8 country "CN"
wl: Unsupported

Concerning country setting, you have to experiment, what your wifi clients accept and what is more confusing them. For instance, setting country_abbrev_override = OFF and thus transmitting no country info in the 802.11 beacons, seems to work better with Ubuntu, even for 6G, but then my Pixel 7a does not "see" my 6G AP anymore... a bit of a kindergarten...

@Reeplosin
Copy link

@Reeplosine tutto per tua informazione

In generale: Se si riavvia il servizio wireless, si ritorneranno sempre ai valori (paese, ecc.) fissati nel driver/firmware (o più precisamente: alla selezione specifica masterizzata nella ROM tra tutti i valori possibili nel driver, vedere di seguito) Pertanto, il riavvio del servizio wireless avviene anche, a parte le eccezioni di visualizzazione come menzionato sopra nei commenti, quando si modificano le impostazioni tramite la GUI.

Pertanto, ci sono due modi per superare questo problema: a) inserire le modifiche NVRAM nello init-startscript (e quindi non riavviare mai il servizio wirelss) oppure b) eseguire le modifiche tramite wlcomando.

Per a) Vedi i commenti sopra e segui la regola d'oro per non riavviare il servizio wireless!

Per b):

  • assicurati di avere la versione wl più recente, ad esempio installa l'ultimo firmware Merlin. Sul mio AX58U e AXE11000, entrambi su 3004.388.6_2,wl ver Broadcom BCA: 17.10 RC157.2809 wl0: Dec 15 2023 10:37:38 version 17.10.157.2809 (r801046) 8e0370b
  • controlla i comandi disponibili di wl con: wl -he, sì, questo dà un risultato diverso wl -i eth6 -h(supponendo che eth6qui sia 5G, devi controllare i dispositivi sul tuo modello di router)
  • Controlla quali paesi sono disponibili nel tuo firmware attuale: wl country listpuoi selezionare solo uno dei paesi elencati qui.
  • Ogni paese viene fornito con un determinato elenco di "revisioni". Si tratta di impostazioni normative che sono cambiate nel tempo, puoi verificare quali sono supportate con ad es.wl country_rev US
  • Imposta un paese con una revisione specifica come wl -i ethXX country "US/699"(Per Paese = TUTTI non è necessario specificare la revisione)
  • Quindi, puoi fare sul tuo Asus, supponendo eth6 che sia 5G:
wl -i eth6 down
wl -i eth6 country ALL
wl -i eth6 country_abbrev_override "US"
wl -i eth6 regulatory 1
wl -i eth6 chanspec 36/160
wl -i eth6 up
wl -i eth6 5g_rate auto
wl -i eth6 txpwr1 -o -m 1496

Risultato:

  1. Country ALL garantirà la massima potenza che il tuo dispositivo può erogare in 2G / 5G / 6G e renderà tutti i canali selezionabili. La potenza massima che il router può erogare è limitata nel driver/firmware per paese = TUTTI. Non puoi andare più in alto di questo, indipendentemente da ciò che selezioni nella NVRAM o con 5. di seguito. Questi valori sono fissi nel BLOB CLM (matrice locale paese) caricato nel driver. Controlla quale wl clmver. Oppure, se riesci ad hackerare il BLOB CLM, puoi sovrascriverlo e caricarlo tramite wl -i eth6 clmload
  2. country_abbrev_override "US"questo farà sembrare che il tuo Wi-Fi abbia il paese USA anche se è impostato su TUTTI, ovvero il beacon 802.11 contiene ora paese = USA. Ciò è molto utile se i tuoi client in modalità STAtion rilevano le impostazioni del paese in base alle informazioni del paese del beacon. Se non invii informazioni sul paese nei beacon, ovvero imposti semplicemente il paese su TUTTI, il tuo client Wi-Fi potrebbe passare alla modalità "mondo". Questo è il minimo comune denominatore di tutte le normative del pianeta, ovvero l'impostazione più conservativa: niente (!) 6G e in 5G solo pochissimi canali con pochissima potenza Tx...
  3. regulatory 1: imposta 5G su 802.11d e disabilita 802.11h (DSF). Puoi verificarlo conwl -i eth6 spect 802.11d mode
  4. chanspec: Imposta il tuo canale qui NON nella GUI! Ricorda: impostandolo nella GUI, verranno ripristinate le impostazioni della ROM. Per i canali da 80 o 160 MHz, è necessario selezionare un canale da 20 MHz nel canale 80/160 MHz e non la frequenza centrale del canale 80/160 MHz. Questo non funzionerà.
    Anche su un AX58U è possibile utilizzare l'intera banda UNII-4, ovvero è possibile 165/160. Non so se funzionerà sul tuo router.
    Controlla le impostazioni con wl -i eth6 status Mode: Managed RSSI: 0 dBm SNR: 0 dB noise: -87 dBm Channel: 165/160 ...
  5. txpwr1 : Vedi il mio commento sopra cosa significa.

NOTA : Se il tuo client utilizza adattatori Intel AX-2xx: finirai sempre nei guai!! Usano LAR... Sono passato a Mediatek MT7922 (RZ616). Questo mi dà anche il 6G su Windows 10 e non ha LAR, quindi puoi usare tutti i canali Wi-Fi.

I performed the operation, I understood that the router after entering the commands should never be restarted otherwise everything returns as before, if I created a script to avoid having to do it manually would it work?

@pasko-zh
Copy link

pasko-zh commented Mar 4, 2024

@Reeplosin : You can run it manually or install it in a startup script. But you might call your script services-start instead of init-start, because you can use wl tool commands only after all services are up, see https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts.

Since I did a lot of tests, I just put everything in a bash script and execute it manually. (I don't reboot my routers for months).

So, here is one example of mine for one of my AX58U:

#!/bin/sh

# This does not work, if 2G is up
# wl country ALL

# Settings for 2G
wl -i eth5 down
wl -i eth5 country ALL
wl -i eth5 country_abbrev_override OFF
wl -i eth5 regulatory 1
wl -i eth5 chanspec -c 3 -b 2 -w 40 -s 1
wl -i eth5 up
wl -i eth5 2g_rate auto
wl -i eth5 txpwr1 -o -m 1496

# settings for 5G
wl -i eth6 down
wl -i eth6 country ALL
wl -i eth6 country_abbrev_override OFF

# set 802.11d only and disable 802.11h
wl -i eth6 regulatory 1
wl -i eth6 spect 0

wl -i eth6 chanspec 36/160
wl -i eth6 up
wl -i eth6 5g_rate auto
wl -i eth6 txpwr1 -o -m 1496

@Reeplosin
Copy link

Reeplosin commented Mar 6, 2024 via email

@Reeplosin
Copy link

anyway Just for information; i was checking some old tweaks for the AC68u transmission power and i came across a command that i didn't see used here "nvram set pa0maxpwr=708" it's strange because many nvram commands tried by users here come from that list of tweak commands that worked for the old 68u, this is one of them but i don't see it used, maybe for current devices it's not needed anymore i don't know

@pasko-zh
Copy link

pasko-zh commented Mar 8, 2024

@Reeplosin
Well, it all depends on your router model and OS, driver (and also wl) version. On my AXE11000 and AX58U pa0maxpwr doesn't exist in NVRAM.

Since we don't have an official documentation by broadcom, it's a bit shooting in the dark... or to put it differently try & error :-/

If you find comands working for you -- please share :)

@Reeplosin
Copy link

Reeplosin commented Mar 9, 2024 via email

@francoism90
Copy link
Author

@pasko-zh What's funny, is that I do have China as an option:

# wl -i eth6 country list
Supported countries: country code and long name
#a	
AU	AUSTRALIA
CA	CANADA
CN	CHINA
DE	GERMANY
E0	
FR	FRANCE
GB	UNITED KINGDOM
JP	JAPAN
KR	KOREA, REPUBLIC OF
Q1	Q1
SG	SINGAPORE
TW	TAIWAN, REPUBLIC OF CHINA
US	UNITED STATES

Was this from your AX-58U?

I think the nvram controls the hardware limits/bars, and with iw you actually boost them (or force some overriding).

I'll try to test later this weekend, and adjust the README.md.

Thanks again!

@pasko-zh
Copy link

pasko-zh commented Mar 9, 2024

@francoism90
Now it is getting political 🤣 I live in Switzerland, so I have :

ASUSWRT-Merlin GT-AXE11000 3004.388.6_0_rog Sat Jan 20 18:44:34 UTC 2024
pesce@GT-AXE11000-9520:/tmp/home/root# wl country list
Supported countries: country code and long name
#a
CA      CANADA
E0
KR      KOREA, REPUBLIC OF
US      UNITED STATES

pesce@GT-AXE11000-9520:/tmp/home/root# wl ver
Broadcom BCA: 17.10 RC157.2809
wl0: Dec 12 2023 09:43:28 version 17.10.157.2809 (r801046) FWID 01-0

pesce@GT-AXE11000-9520:/tmp/home/root# wl clmver
API: 25.0
Data: 10.10.78
Compiler: 1.68.6
ClmImport: 1.68.6
Customization: v2 221028
Creation: 2023-07-24 10:10:20

and

ASUSWRT-Merlin RT-AX58U 3004.388.6_2 Tue Feb 27 02:43:33 UTC 2024
pesce@RT-AX58U-D440:/tmp/home/root# wl country
#a (#a/0) <unknown>
pesce@RT-AX58U-D440:/tmp/home/root# wl country list
Supported countries: country code and long name
#a
AU      AUSTRALIA
CA      CANADA
CN      CHINA
DE      GERMANY
E0
FR      FRANCE
GB      UNITED KINGDOM
JP      JAPAN
KR      KOREA, REPUBLIC OF
Q1      Q1
SG      SINGAPORE
TW      TAIWAN, REPUBLIC OF CHINA
US      UNITED STATES

pesce@RT-AX58U-D440:/tmp/home/root# wl ver
Broadcom BCA: 17.10 RC157.2809
wl0: Dec 15 2023 10:37:38 version 17.10.157.2809 (r801046) 8e0370b

pesce@RT-AX58U-D440:/tmp/home/root# wl clmver
API: 25.0
Data: 10.10.652
Compiler: 1.59.9
ClmImport: 1.63.5
Creation: 2021-10-29 10:21:23

Well, on my linux machines I use iw a lot. But here on asus merlin, I was only trying it a bit, and most things were not working

@francoism90 Let me know if shall test anything. Happy to support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment