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

@omrij
Copy link

omrij commented May 3, 2024

Thanks, I guess I'll stick with wl method using services-start which works for me (but I wish it was persistent)

@pasko-zh
Copy link

pasko-zh commented May 4, 2024

Hi Does anyone know how to disable DFS using nvram without changing country/local/transmit power? I can do it using wl command but it's not persistent.

Just put all your WL commands in a bash script. Run it manually after a reboot of your router. I mean, I reboot my router once year or so...
Or, put in a script which is run after reboot, see documentation here https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts

@omrij
Copy link

omrij commented May 4, 2024

That's the way I do it now
Using services-start script and also service-event-end script (so it's running after every change made in wireless settings).
It's still more convinent to make the changes once using nvram which is also applicable to asuswrt and not only Merlin.

@825i
Copy link

825i commented May 29, 2024

This doesn't seem to work for my original AX88U (non pro). Which is originally set to "DE" (Germany) region.

Trying nvram command

I followed all the steps above and uncommented:
nvram set wl0_sel_channel=14/80 # force 2.4GHz channel

To try and set the 2.4Ghz channel to 14. After rebooting the router, it is still set to 13.

Trying Web GUI

I can see 14 as an option the "Wireless" tab in the router control panel.
If I try to set it to 14 in the Web GUI it reboots and sets it to 5 (Auto)...

If I go to Wireless > Professional > Right Click "Inspect" > CTRL+F "Country" > It shows "#a" like it should in the hidden setting.

Any other suggestions? I am just trying to get channel 14 because in the capital city every single other channel is completely saturated...


Here is my script. Do I need to replace the country code #a with something else? Is that why it's not working?

#!/bin/sh

# Allow all channels
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 territory_code=CN/02 # or US/02
nvram set wl_country_code=#a
nvram set wl_reg_mode=h
nvram set wl0_chlist="1 2 3 4 5 6 7 8 9 10 11 12 13 14"
nvram set wl0_country_code=#a
nvram set wl0_country_rev=0
nvram set wl0_reg_mode=h
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 169 173 177"
nvram set wl1_country_code=#a
nvram set wl1_country_rev=0
nvram set wl1_reg_mode=h
nvram set acs_dfs=0
nvram set wl_acs_excl_chans_dfs=
nvram set wl_acs_excl_chans=
nvram set wl0_acs_dfs=0
nvram set wl0_acs_excl_chans_base=
nvram set wl0_acs_excl_chans=
nvram set wl1_acs_dfs=0
nvram set wl1_acs_excl_chans_base=
nvram set wl1_acs_excl_chans=
nvram set acs_unii4=1

# Channel selection (these don't seem to do anything, so they're commented out)
# nvram set wl0_chanspec=0 # auto select
# nvram set wl1_chanspec=0 # auto select
# nvram set wl_chanspec=0 # auto select
# nvram set wl0_sel_channel=14/80 # force 2.4GHz channel
# nvram set wl1_sel_channel=149/80 # force 5GHz channel

Seems there's nothing I can do to actually use Channel 14 for 2.4Ghz.

@825i
Copy link

825i commented May 29, 2024

Ok adding on to what I have learned from fooling around a bit.

My AX88U shipped with "DE" country. This limited transmission power to 12, i.e.:

admin@RT-AX88U-9B20:/tmp/home/root# wl txpwr_target_max
Maximum Tx Power Target (chanspec:0x100d):      12.00  12.00  12.00  12.00

After copying the example script and rebooting the router:

admin@RT-AX88U-9B20:/tmp/home/root# wl txpwr_target_max
Maximum Tx Power Target (chanspec:0x100d):      26.00  26.00  26.00  26.00

So the Tx power has increased by a bit over double. I can also see from numerous WiFi apps and also the Asus Site Survey/WiFi Radar that my transmission power has increased massively. Note that I have not copied any of the "Risky" transmission lines into my start script. All I have in my start script is what I have in the reply above.

2.4Ghz

  • Xperia 1V previously reported the signal strength at -33dBm even at 1ft from the router.
  • It now reports -23dBm which I am sure is as sensitive/low as it can record. Remembering that dBm is logarithmic, a 3dBm increase is essentially a 100% improvement, so this is a huge improvement for 2.4Ghz.

5Ghz

  • Xperia 1V previously reported the signal strength at -38dBm
  • It now reports -30dBm. Still a massive improvement.

I am pretty satisfied with this. It would have been nice to use Channel 14, but I can concur and confirm with others. Setting the channel to 14 will generally reset my router to "DE" region again and put the Tx power back to 12 from 26. This is generally good enough for me.

Hopefully there's no health risks from setting the Tx power so high. I sit about 1.2m from my router. Though I plan to move it into another room when I move my study area. Hence part of the reason why I started investigating this in the first place.

@825i
Copy link

825i commented May 29, 2024

I forgot to add the speeds before and after the 12 -> 26mW change:

Result (Xperia 1V):

  • 689/492mbps - 12mW Tx Power
    • 707/485
  • 802/460 - 26mW Tx Power
    • 805/481

Result (S7 Tab):

  • 763/492mbps - 12mW Tx Power
    • 739/481
  • 756/481 - 26mW Tx Power

@francoism90
Copy link
Author

@825i Increasing Tx Power leads to more noise, it may/may not increase performance. It's basically aim is to increase the range of your router. However, this could also increase heat and load.

If I'm not mistaken, the txpwr_target_max key only indicates the maximum allowed Tx Power, it doesn't increase the value. It's a dynamic value based on the selected country, etc.

Thanks for posting your findings and results. Like said in the disclaimer, it may work for you or not.
In most cases unfortunately it doesn't work, because many WiFi-chipsets have hidden/unknown abilities to check if the receiving/sending values are valid. So even changing the country or Tx Power, it may not change anything to your end-devices.

@QaDoPL
Copy link

QaDoPL commented Jun 10, 2024

AX1100 Merlin 388.7 - so far no luck with unlock TX,
wl txpwr_target_max Maximum Tx Power Target (chanspec:0x1003): 12.00 12.00 12.00 12.00

Power really sucks, even cheap router totolink has 100% more efficient at my home.
One wall and AX don't have 2.4Ghz,,,

I tried downgrade to 388.1 and same issue can't change territory and tx.

nvram show | grep -e 'country_code|location_code|territory_code|ccode'
0:ccode=#a
1:ccode=E0
2:ccode=E0
3:ccode=E0
location_code=#a
territory_code=EU/01
wl0_country_code=E0
wl1_country_code=#a
wl2_country_code=E0
wl_country_code=#a

@QaDoPL
Copy link

QaDoPL commented Jun 19, 2024

I have Asus GT AXE16000 with Merlin 388.7 Are you able to change region successfully if yes then which method worked for you ?

Finally i found solution, FW is not problem. But seems change parameters by wl -i eth6 and rest (7) (8) doing job, higher tx power can be achieved. And lucky have much more efficient wirelesses network with good range.
When i fully and permanent solve it will post here.
Adapter Temp 45C

@pewpewpew47
Copy link

Followed steps on a GT-AX6000 from Germany. Tx power did increase and better signal (signal strength from same spot -58dbm to -44dbm). New channels (149 and up) appeared as well. GUI changes seems to not cause issues and I can swap to other channels in GUI. However, whenever I try to connect to channel 149 from an Intel AX211 card, Windows shows I am using wifi 4 instead of wifi 6. Lower channels (36, 44, 48 etc) are fine. Is this an Intel issue like the previous posts indicated? Thanks for the help and good luck everyone.

@francoism90
Copy link
Author

@pewpewpew47 Could you try forcing 802.11ax in the WiFi settings? You may also need to adjust some parameters.

It could indeed also be the Intel card not accepting the connection as it should.

@francoism90
Copy link
Author

@QaDoPL Thanks for sharing, I think I'll add the WiFi settings to the README.

@pasko-zh
Copy link

pasko-zh commented Jun 20, 2024

Followed steps on a GT-AX6000 from Germany. Tx power did increase and better signal (signal strength from same spot -58dbm to -44dbm). New channels (149 and up) appeared as well. GUI changes seems to not cause issues and I can swap to other channels in GUI. However, whenever I try to connect to channel 149 from an Intel AX211 card, Windows shows I am using wifi 4 instead of wifi 6. Lower channels (36, 44, 48 etc) are fine. Is this an Intel issue like the previous posts indicated? Thanks for the help and good luck everyone.

Most likely yes. And or a combination with the OS. You can try with another client and see if it works as expected.

You can check on our router how your client is connected, this gives you all the details.
Here for eth7 on my router:

wl -i eth7 assoclist
=> MAC_ADR

 wl -i eth7 sta_info MAC_ADR

If you want to dig deeper: Capture 802.11 beacon frames with wireshark. Then you will see what your router is advertising, and how the handshake with the client goes on....

@francoism90
Copy link
Author

I have updated the instructions to use events, meaning it should work when changing Wireless settings in the GUI.

Could you please test? I have also added to multiple places, as it seems to be the only way to make sure settings are set on boot and such.

@Reeplosin
Copy link

however it would be more practical to have an archive containing all the scripts that work for a specific model with their respective instructions for use. not all scripts work for everything in most cases if for example you used a script for an AX6000 on an AC86u the gui becomes in Chinese language and that's it

@pewpewpew47
Copy link

Followed steps on a GT-AX6000 from Germany. Tx power did increase and better signal (signal strength from same spot -58dbm to -44dbm). New channels (149 and up) appeared as well. GUI changes seems to not cause issues and I can swap to other channels in GUI. However, whenever I try to connect to channel 149 from an Intel AX211 card, Windows shows I am using wifi 4 instead of wifi 6. Lower channels (36, 44, 48 etc) are fine. Is this an Intel issue like the previous posts indicated? Thanks for the help and good luck everyone.

Most likely yes. And or a combination with the OS. You can try with another client and see if it works as expected.

You can check on our router how your client is connected, this gives you all the details. Here for eth7 on my router:

wl -i eth7 assoclist
=> MAC_ADR

 wl -i eth7 sta_info MAC_ADR

If you want to dig deeper: Capture 802.11 beacon frames with wireshark. Then you will see what your router is advertising, and how the handshake with the client goes on....

Thanks Pasko! After some digging with your command line, I found that 149-169 does not work when 160mHz bandwidth is selected. Currently I just run my router on auto channel and auto bandwidth (been on channel 100/160 since last reboot). I live close to airport so DFS may also have something to do with the issue.

@pewpewpew47
Copy link

I have updated the instructions to use events, meaning it should work when changing Wireless settings in the GUI.

Could you please test? I have also added to multiple places, as it seems to be the only way to make sure settings are set on boot and such.

Redid all the nvram changes after your update. Can confirm GUI changes persist after restart on GT-AX6000. Thanks mate!

@francoism90
Copy link
Author

@pewpewpew47 Thanks for testing! Yeah, it seems to be persistent now. :)

@argh0815
Copy link

Hi Does anyone know how to disable DFS using nvram without changing country/local/transmit power? I can do it using wl command but it's not persistent.

@omrij, can you share the wl command you're using to disable DFS? Thanks!

@omrij
Copy link

omrij commented Jul 10, 2024

Hi Does anyone know how to disable DFS using nvram without changing country/local/transmit power? I can do it using wl command but it's not persistent.

@omrij, can you share the wl command you're using to disable DFS? Thanks!

Something like this (adjust channel and other things you need)

settings for 5G

wl -i eth7 down
wl -i eth7 regulatory 1
wl -i eth7 spect 0
wl -i eth7 chanspec 100/160
wl -i eth7 up

@argh0815
Copy link

Great, tried and working, thanks again!

@Hellohi3654
Copy link

confirmed working on ax86u pro

@Squall-Leonhart
Copy link

enabling the missing channels doesn't seem to work on my ac68u, did on my ac88u both on merlin 386.14,

the country codes reset on reboot,

@dionvl
Copy link

dionvl commented Aug 7, 2024

settings for 5G

wl -i eth7 down wl -i eth7 regulatory 1 wl -i eth7 spect 0 wl -i eth7 chanspec 100/160 wl -i eth7 up

Thanks @omrij ! Had to change eth7 to eth6 for the AX82U. DFS is borked on this model so I'm glad my WiFi will now stay up.

@francoism90
Copy link
Author

@Squall-Leonhart Please dump the unmodified first nvram dump, and compare the values with the provided one. You may need to have different values, my model isn't that new, so I cannot test unfortunately.

@Squall-Leonhart
Copy link

Squall-Leonhart commented Aug 7, 2024

found the reason, unlike ac88u which can retain these values over reboot, the ac68u forcibly copies the cfe values back to nvram, so you have to add them to init-start.

@francoism90
Copy link
Author

@Squall-Leonhart Yes, see updated instructions, because you basically have to add them all of the place lol.

@Euri007
Copy link

Euri007 commented Aug 23, 2024

Hy,
Is there a solution to change country code in asus tuf-ax5400?
Thanks

@Linden1
Copy link

Linden1 commented Aug 23, 2024

Hy, Is there a solution to change country code in asus tuf-ax5400? Thanks

Unfortunately not. Only works with Merlin firmware, for which there are no releases for non-broadcom routers.

@Euri007
Copy link

Euri007 commented Aug 23, 2024

Hy, Is there a solution to change country code in asus tuf-ax5400? Thanks

Unfortunately not. Only works with Merlin firmware, for which there are no releases for non-broadcom routers.

Thans fiend

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