Skip to content

Instantly share code, notes, and snippets.

@francoism90
Last active December 6, 2024 08:16
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. :)

@Dunnaldur
Copy link

Did you reboot the router and but the values in the startup script?
An alternative is to restart the wireless service.

Hi there. I was not able to get the startup script to work, maybe because I was on stock FW, not Merlin?
but as I added in the Edit, the power and country changes did read correctly after a restart of the wireless service!

Still can't make the 5ghz channels above 140 show up in the UI. Would you guys have any idea on that?
Also tried to define them from terminal using
nvram set wl1_chanspec=161/80
but that doesn't stick either

@maghuro
Copy link

maghuro commented Jun 25, 2023

Did you reboot the router and but the values in the startup script?
An alternative is to restart the wireless service.

Hi there. I was not able to get the startup script to work, maybe because I was on stock FW, not Merlin? but as I added in the Edit, the power and country changes did read correctly after a restart of the wireless service!

Still can't make the 5ghz channels above 140 show up in the UI. Would you guys have any idea on that? Also tried to define them from terminal using nvram set wl1_chanspec=161/80 but that doesn't stick either

Only that :
nvram set location_code=#a
nvram commit
service restart_wireless

@Dunnaldur
Copy link

Only that :
nvram set location_code=#a
nvram commit
service restart_wireless

Thanks for tip, and the settings stick when reading the values, but doesn't seem to make a difference in the UI.

@ZenWiFi_Pro_XT12-2A60:/jffs/controld# nvram get location_code
#a

UI still only shows Control Channel options from 100-140.

Just to confirm, do you guys get the additional channels over 140?

@maghuro
Copy link

maghuro commented Jun 25, 2023

Only that :
nvram set location_code=#a
nvram commit
service restart_wireless

Thanks for tip, and the settings stick when reading the values, but doesn't seem to make a difference in the UI.

@ZenWiFi_Pro_XT12-2A60:/jffs/controld# nvram get location_code
#a

UI still only shows Control Channel options from 100-140.

Just to confirm, do you guys get the additional channels over 140?

Yes, but using a gt-ax6000.

You have to play with different location codes.

Are you using some aimesh node? You have to set this on them also.
Odd thing that I discovered playing - main router using #a location code.
Aimesh node, rt-ac86u, using US as location code, which gives me more throughput than using #a.

With this config, using channel 149 at 80mhz

@Dunnaldur
Copy link

Are you using some aimesh node? You have to set this on them also.

Like Homer would say "Doh!".

All good now and I can see all the channels and the UNII4 option.
Thank you very much guys!

@francoism90
Copy link
Author

@maghuro Thanks! I can see the UNII4 option now, but it doesn't let me enable it (reverts back after hitting save).

@Dunnaldur Does it gets enabled with your settings?

@Dunnaldur
Copy link

Dunnaldur commented Jul 2, 2023

@maghuro Thanks! I can see the UNII4 option now, but it doesn't let me enable it (reverts back after hitting save).

@Dunnaldur Does it gets enabled with your settings?

Not really. So I noticed there are a few things that are weird. If you just enable some settings, they will not necessarily be the same after a reboot, or a 2nd reboot.

I saw on some forum someone mentioned some bugs with the locale codes and that 2 reboots were required to 'set' the settings. Not sure if that's true or not, but mine jumped all over the place between reboots.

When try to select a channel, the UI would after a reboot sometimes only display Control Channel: "AUTO", with no ability to select a channel. Pretty sure this is a massive bug. Spinning in the chair, or rebooting the node, or rebooting the router, would sometimes let me get the UI to select another channel.

Ticking the DFS or UNII4 boxes would randomly un-tick themselves, or re-tick themselves after a reboot too.
Selecting AUTO and the genius system would select a 'best' channel WHICH WOULD NOT BE CAPABLE OF INTERACTING WITH THE NODE.

I've come to the conclusion that 1) the UNII4 feature is unreliable 2) DFS is unreliable and 3) 160mhz is unreliable. 4) Asus routers are garbage

Maybe it's worse because I'm in Europe and maybe there are radar signals that keep causing the AiMesh to collapse and disable all these features?

Anyway, it works like trash tier garbage with the advertised advanced features that I paid substantial money for. Asus XT12 is quite pricey. But with all of that fancy stuff disabled and only 80mhz, I'm at least getting 500mbit solid……………… so far.
With the features enabled I was on 850-900mbit when it worked. But minutes/hours/days later it would degrade and I'd either get 2.4ghz only to the node and get dial-up speeds+interruptions or losing the node altogether.

I'd return this Asus POS if I was within the return period, but now just going to try to live with it until I get ethernet between the areas.

@C3S4RM3W
Copy link

C3S4RM3W commented Jul 5, 2023

Hi, I also have a GT-AX11000 and followed the instructions to increase the power and I'm happy getting 23.75 with #a as the country. That being said I did not notice any extra channels or anything, probably as I have already set 160mhz on DFS channels.

I have a question tho, how to set channel 14 for 2.4Ghz? I'm around 20 wifi networks and all other channels are occupied, I have some IoT devices that only support 2.4Ghz, and would like to force it to channel 14, but manually changing wl_chanspec does nothing, changing the channel in the UI and saving the settings, will set the router back to US and lock the channel and config.

@Dunnaldur
Copy link

I have a question tho, how to set channel 14 for 2.4Ghz? I'm around 20 wifi networks and all other channels are occupied, I have some IoT devices that only support 2.4Ghz, and would like to force it to channel 14, but manually changing wl_chanspec does nothing, changing the channel in the UI and saving the settings, will set the router back to US and lock the channel and config.

If you are using AiMesh, you might need to change the node as well.
Another thing you can try is to check to read the values for wl_chanspec, wl0_chanspec, wl1_chanspec and wl2_chanspec.
I don't remember, but some of the info floating around is wrong. They are referring to wl1, when it should be wl2.

Some stuff also just doesn't work as expected. Like the reg_mode. It appears as if you can it independently, but it just bounces back to whatever after reboot. BUT if you change the country code then the reg_mode is also changed automatically.

The whole thing is a mess with limited transparency because of boards/people are afraid of getting heat from the manufacturers.

I'd do a nvram dump as they suggest in the very first top post just to see what settings are already present and defined in the config.

@francoism90
Copy link
Author

@Dunnaldur If I'm not mistaken wl0, wl1, wl2, etc. depend on your model. So yeah, a nvram dump should be good to examine the wl* you need.

But also, it's kinda buggy. Sometimes it works, and you can change the country, sometimes it doesn't work at all. My guess is also hardware limits or some additional checks, like the ones at boot time. That's why I also added them to init-start, as the bootloader can overrule values unfortunately.

@pasko-zh
Copy link

pasko-zh commented Jul 6, 2023

Confirming it works on RT-AX58U, Merlin 388.1 😁
(probably works on RT-AX3000 as well)
@barkmarkin since you wrote it won't work on your AX58U

I have two RT-AX58U and was able to increase transmit power and to select all possible 5 GHz channels. I was on country wl1_country_code=E0, wl1_country_rev=742 before.

These steps worked for me, but only exactly like this!
(also non-IT-guys should be able to follow this)

  1. In the web-GUI of your router allow User Scripts to be executed: Administration/System enable "Enable JFFS custom scripts and configs"
    Alternatively change those things via nvram set.
  2. Check with nvram dump | grep jffs you should then have jffs2_auto_erase=0 jffs2_enable=1 jffs2_format=0 jffs2_on=1 jffs2_scripts=1 jffs2_state=3 log_path=/jffs You don't need to set jffs2_exec=
  3. Put your things you would like to change in a file init-start, store it in /jffs/scripts
  4. Make sure the script is executable chmod +x init-start
  5. Check if the script runs without errors, i.e. do ./init-start
  6. Reboot via Console or Hard-reboot via power-off

DO NOT try to change channels via Web-GUI or via console after reboot! This will not work and reset back to the old country settings!!

Example of one of my init-start file, where I only wanted to change 5 Ghz channels:

#!/bin/sh
nvram set 0:ccode=#a
nvram set 0:regrev=0
nvram set 1:ccode=#a
nvram set 1:regrev=0
nvram set wl0_country_code=#a
nvram set wl0_country_rev=0
nvram set wl0_reg_mode=off
nvram set wl1_chlist="36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 149 153 157 161 165"
nvram set wl1_country_code=#a
nvram set wl1_country_rev=0
nvram set wl1_reg_mode=off
nvram set territory_code=CN/02
nvram commit
nvram set wl1_chanspec=161/80
nvram commit

Note: You select the most upper channel with nvram set wl1_chanspec=161/80, the control channel is then the lowest of those four 20 MHz channels, i.e. 149, see wikipedia

My lenovo laptop connects as (omitting some details here)

Protocol:	Wi-Fi 6 (802.11ax)
Network band:	5 GHz
Network channel:	149
Link speed (Receive/Transmit):	1201/1201 (Mbps)
Manufacturer:	Intel Corporation
Description:	Intel(R) Wi-Fi 6 AX200 160MHz

UPDATE: Asus 58U also supports UNII-4 Band!

@bubobih
Copy link

bubobih commented Jul 6, 2023

Confirming it works on RT-AX58U, Merlin 388.1 😁 (probably works on RT-AX3000 as well) @barkmarkin since you wrote it won't work on your AX58U

I have two RT-AX58U and was able to change transmit power and to select all possible 5 GHz channels. I was on country wl1_country_code=E0, wl1_country_rev=742 before. Concerning 5 GHz channels: The Broadcom BCM6750 supports max frequency of 5.85 GHz, i.e. the U-NII-3 band. Hence, the "highest" possible 80 MHz channel is nvram set wl1_chanspec=161/80.

These steps worked for me, but only exactly like this! (also non-IT-guys should be able to follow this)

  1. In the web-GUI of your router allow User Scripts to be executed: Administration/System enable "Enable JFFS custom scripts and configs"
    Alternatively change those things via nvram set.
  2. Check with nvram dump | grep jffs you should then have jffs2_auto_erase=0 jffs2_enable=1 jffs2_format=0 jffs2_on=1 jffs2_scripts=1 jffs2_state=3 log_path=/jffs You don't need to set jffs2_exec=
  3. Put your things you would like to change in a file init-start, store it in /jffs/scripts
  4. Make sure the script is executable chmod +x init-start
  5. Check if the script runs without errors, i.e. do ./init-start
  6. Reboot via Console or Hard-reboot via power-off

DO NOT try to change channels via Web-GUI or via console after reboot! This will not work and reset back to the old country settings!!

Example of one of my init-start file, where I only wanted to change 5 Ghz channels:

#!/bin/sh
nvram set 0:ccode=#a
nvram set 0:regrev=0
nvram set 1:ccode=#a
nvram set 1:regrev=0
nvram set wl0_country_code=#a
nvram set wl0_country_rev=0
nvram set wl0_reg_mode=off
nvram set wl1_chlist="36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 149 153 157 161 165"
nvram set wl1_country_code=#a
nvram set wl1_country_rev=0
nvram set wl1_reg_mode=off
nvram set territory_code=CN/02
nvram commit
nvram set wl1_chanspec=161/80
nvram commit

Note: You select the most upper channel with nvram set wl1_chanspec=161/80, the control channel is then the lowest of those four 20 MHz channels, i.e. 149, see wikipedia

My lenovo laptop connects as (omitting some details here)

Protocol:	Wi-Fi 6 (802.11ax)
Network band:	5 GHz
Network channel:	149
Link speed (Receive/Transmit):	1201/1201 (Mbps)
Manufacturer:	Intel Corporation
Description:	Intel(R) Wi-Fi 6 AX200 160MHz

Web gui reset your settings when u change channel because u are add something wrong or missing some settings try to use mine, mine work even with gui edit channels

https://gist.github.com/francoism90/3dede7973354d067c41bff5e54203fe9?permalink_comment_id=4585846#gistcomment-4585846

@HerMajestyDrMona
Copy link

@bubobih Could you please tell how do you set the maximum power?

nvram set 0:maxp2ga0=0x78
nvram set 0:maxp2ga1=0x78
nvram set 0:maxp2ga2=0x78
nvram set 1:maxp5ga0=0x78,0x78,0x78,0x78
nvram set 1:maxp5ga1=0x78,0x78,0x78,0x78
nvram set 1:maxp5ga2=0x78,0x78,0x78,0x78
nvram set wl_txpower=708
nvram set wl0_txpower=708
nvram set wl1_txpower=708

wl_txpower, wl0_txpower, wl1_txpower stands for Tx power (100 is max allowed in EU, 1000 in China/USA, right), but what are all the other values with 0x78? What should I set there if I want to use the txpower of 500?

Also, can I use some European country together with the higher txpower? I want to set the fixed channels anyway (as in my old router), I'm just curious how does it work. Does setting the wrong (European) country automatically limit the txpower?

@Dunnaldur
Copy link

@bubobih Could you please tell how do you set the maximum power?

For me on XT12 the only thing needed to change to get max power is location code. Nothing else.
Both #a and US worked for me for the power, but some of the other settings behave quite differently depending if you use #a or US

nvram set location_code=#a
nvram commit
service restart_wireless

@HerMajestyDrMona
Copy link

I noticed that on my GT-AX6000:

0:maxp2ga0
0:maxp2ga1
0:maxp2ga2

don't exist in nvram_dump.txt. Instead, I have:

1:maxp2ga0=0x76
1:maxp2ga1=0x76
1:maxp2ga2=0x76
1:maxp2ga3=0x76

and:

2:maxp5gb0a0=0x6E
2:maxp5gb0a1=0x6E
2:maxp5gb0a2=0x6E
2:maxp5gb0a3=0x6E
2:maxp5gb1a0=0x6E
2:maxp5gb1a1=0x6E
2:maxp5gb1a2=0x6E
2:maxp5gb1a3=0x6E
2:maxp5gb2a0=0x6E
2:maxp5gb2a1=0x6E
2:maxp5gb2a2=0x6E
2:maxp5gb2a3=0x6E
2:maxp5gb3a0=0x6E
2:maxp5gb3a1=0x6E
2:maxp5gb3a2=0x6E
2:maxp5gb3a3=0x6E
2:maxp5gb4a0=0x6E
2:maxp5gb4a1=0x6E
2:maxp5gb4a2=0x6E
2:maxp5gb4a3=0x6E
2:maxp5gb5a0=0x6E
2:maxp5gb5a1=0x6E
2:maxp5gb5a2=0x6E
2:maxp5gb5a3=0x6E
2:maxp5gb6a0=0x6E
2:maxp5gb6a1=0x6E
2:maxp5gb6a2=0x6E
2:maxp5gb6a3=0x6E

I wonder if I should add all of 2:maxp5gb0*=0x78 (or 0x76) to the init-start script? Or it's something else?

Since I don't need 2.4Ghz that much, I set its txpower to:

nvram set wl0_txpower=100

but it behaves weirdly. I can see the full 2.4Ghz Wi-Fi signal 3 rooms / floor away, but the phone fails to connect to it. I wonder if it's somehow related to wl_txpower which is 500.

@Armand0oooo
Copy link

Only that :
nvram set location_code=#a
nvram commit
service restart_wireless

Thanks for tip, and the settings stick when reading the values, but doesn't seem to make a difference in the UI.

@ZenWiFi_Pro_XT12-2A60:/jffs/controld# nvram get location_code
#a

UI still only shows Control Channel options from 100-140.
Just to confirm, do you guys get the additional channels over 140?

Yes, but using a gt-ax6000.

You have to play with different location codes.

Are you using some aimesh node? You have to set this on them also. Odd thing that I discovered playing - main router using #a location code. Aimesh node, rt-ac86u, using US as location code, which gives me more throughput than using #a.

With this config, using channel 149 at 80mhz

Hello Maghuro,

Would you be able to explain how you did enable the 5.9ghz band of the gt-ax6000. Is this using the procedure above to change country or something more specific?

Thank you

@FightMan01
Copy link

Hi!

Can anyone help with TUF-AX3000 (v2) as the main router and RT-AX1800U as aimesh node?
I managed to connect to both routers and set the values but I don't think it worked on the RT-AX1800U. I can't check the values with the wl txpwr_target_max command since it is a Mediatek router.

I would appreciate any help if someone knows something about asus router with mediatek.

@tommy030314
Copy link

hello, is there a solution to unlock ax5400 v2.

@Sprtop
Copy link

Sprtop commented Aug 2, 2023

Hi @Dunnaldur , can you please share your final working config for XT12.

@barkmarkin
Copy link

wl txpwr_target_max shows

Maximum Tx Power Target (chanspec:0x100b): 28.00 28.00 28.00 28.00

On my ax88u pro. Is this too high or within limtis of the router? I dont want to damage it,
Also this is from someone here who possted for their ax86u, It gave them 26.00

Put this in init-start

#!/bin/sh
nvram set location_code=US
nvram set asuscfe0:ccode=#a
nvram set asuscfe1:ccode=#a
nvram set asuscfe0:regrev=0
nvram set asuscfe1:regrev=0
nvram set asuscfecommit=1
nvram set 0:regrev=0
nvram set 1:regrev=0
nvram set 0:ccode=#a
nvram set 1:ccode=#a
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=h
nvram set wl1_country=#a
nvram set wl1_country_code=#a
nvram set wl1_country_rev=0
nvram set wl1_reg_mode=h
nvram set 0:maxp2ga0=0x78
nvram set 0:maxp2ga1=0x78
nvram set 0:maxp2ga2=0x78
nvram set 1:maxp5ga0=0x78,0x78,0x78,0x78
nvram set 1:maxp5ga1=0x78,0x78,0x78,0x78
nvram set 1:maxp5ga2=0x78,0x78,0x78,0x78
nvram set wl_txpower=708
nvram set wl0_txpower=708
nvram set wl1_txpower=708

nvram set wl1_chanspec=161/80
nvram set territory_code=US/02

nvram commit

@barkmarkin
Copy link

barkmarkin commented Aug 17, 2023

#!/bin/sh
nvram set location_code=US
nvram set asuscfe0:ccode=#a
nvram set asuscfe1:ccode=#a
nvram set asuscfe0:regrev=0
nvram set asuscfe1:regrev=0
nvram set asuscfecommit=1
nvram set 0:regrev=0
nvram set 1:regrev=0
nvram set 0:ccode=#a
nvram set 1:ccode=#a
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=h
nvram set wl1_country=#a
nvram set wl1_country_code=#a
nvram set wl1_country_rev=0
nvram set wl1_reg_mode=h
nvram set 0:maxp2ga0=0x78
nvram set 0:maxp2ga1=0x78
nvram set 0:maxp2ga2=0x78
nvram set 1:maxp5ga0=0x78,0x78,0x78,0x78
nvram set 1:maxp5ga1=0x78,0x78,0x78,0x78
nvram set 1:maxp5ga2=0x78,0x78,0x78,0x78
nvram set wl_txpower=708
nvram set wl0_txpower=708
nvram set wl1_txpower=708

nvram set wl1_chanspec=161/80
nvram set territory_code=US/02

nvram commit

This script works like charm for Asus RT-AX86U with latest firmware from Asuswrt-Merlin v388.1. wl txpwr_target_max returns 26.00 26.00 26.00 and channels unblocked. Even after router reboot or changing wifi bandwidth/channel. My router original territory_code was UK/02

This works on my ax88u pro and shows 28.00 28.00 28.00 28.00. But when I change any settings after turning it off than on, it goes back down to 24.00 24.00 24.00 24.00 how can I prevent this?

@francoism90
Copy link
Author

@barkmarkin Did you paste them in init-start as well?

A workaround (if init-start doesn't do the trick) is using a cronjob.

@barkmarkin
Copy link

@barkmarkin Did you paste them in init-start as well?

A workaround (if init-start doesn't do the trick) is using a cronjob.

İ used winscp to copy it into init start jffs folder it works what is a cronjob,? I'm code disabled

@barkmarkin
Copy link

@barkmarkin https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts#creating-scripts

Make sure the script is executable.

Well it is. Maybe it's not the right settings for ax88u pro but it's all fine unless I change a setting and if I reboot its 28 again and settings persist

@francoism90
Copy link
Author

@barkmarkin https://gist.github.com/francoism90/3dede7973354d067c41bff5e54203fe9?permalink_comment_id=4620888#gistcomment-4620888

See note/warning - changing (WiFi) settings using the UI, will overrule the nvram changes.

@francoism90
Copy link
Author

I have improved the instructions, based on comments given on this gist (many thanks for that!).

If anything is missing, please let me know. :)

@barkmarkin
Copy link

Well thank you if it says 28 then I'm getting the most out of my device correct?

@francoism90
Copy link
Author

francoism90 commented Aug 21, 2023

@barkmarkin It all depends, even if your router uses a different country, the device still can use different/legit settings. I think 28 in tx power?

I've done some reading, and tried multiple things, but it seems WiFi is able to send a signal, which make sure no one can actually change the country, as like forcing Germany when being in the EU.

As said in the disclaimer, it may work, but results may vary.

@ovidiu4
Copy link

ovidiu4 commented Sep 14, 2023

Hi guys,

None of the settings from above worked on my ASUS ZenWiFi Pro ET12.
I am trying to enable the 6GHz channel but nothing seems to work.

nvram set location_code=#a nvram set 0:ccode=#a nvram set 0:regrev=0 nvram set 1:ccode=#a nvram set 1:regrev=0 nvram set 2:ccode=#a nvram set 2:regrev=0 nvram set territory_code=CN/02 nvram set wl_country_code=#a nvram set wl_reg_mode=h nvram set wl2_country_code=#a nvram set wl2_country_rev=0 nvram set wl2_reg_mode=h nvram set acs_unii4=1 nvram set wl_acs_excl_chans_dfs= nvram set wl_acs_excl_chans= nvram set wl2_acs_dfs=1 nvram set wl2_acs_excl_chans_base= nvram set wl2_acs_excl_chans=

Does anyone have any idea what else they may be locking on this router?

@Doc-Steve
Copy link

Doc-Steve commented Nov 21, 2023

Hi, does anyone know which settings change the "PRE-ISM Channel Availability Check (CAC)" for DFS-channels? I don't want to switch DFS off with #a, In-Service-Monitoring is fine and I think necessary. But I'd like to reduce the initial wait time for the WLAN to come up scanning for 60s after every reboot or WLAN channel change. Any tips appreciated - thanks in advance.

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