Skip to content

Instantly share code, notes, and snippets.

@dvdrhr
Forked from francoism90/README.md
Last active November 11, 2024 08:53
Show Gist options
  • Save dvdrhr/aa0497bae89cbf867a6cdce690061d5c to your computer and use it in GitHub Desktop.
Save dvdrhr/aa0497bae89cbf867a6cdce690061d5c to your computer and use it in GitHub Desktop.
Change country to unlock channels, increase TX-power. (Use at your own risk)

EDITS

  • ADDED MANUAL SETTING OF TRANSMISSION POWER & DSF TURN-OFF
  • ADDED DISABLING OF ALL ENERGY SAVING FEATURES

Warning

Following instructions are provided without any warranty, and may even get you in trouble legally. The instructions are provided for testing, and should be use with care. We (including commentators) are not responsible for any damage to your device(s).

Introduction

This may enable additional channels and power (in most cases don't) on ASUS Merlin provided routers.

The nvram settings have been tested on a ASUS RT-AX58U, they may work on other models as well (ASUS RT-AC78U).

Please use nvram dump and adjust when needed, as they may differ on your device!

Credits to the commentators below, and members on the SNBForums posting instructions. Please post your findings, and help others when needed. :)

Login into router using SSH

See https://www.htpcguides.com/enable-ssh-asus-routers-without-ssh-keys/ for instructions.

Backup current settings

nvram dump > dump.txt

NOTE: You need to copy the dump.txt (or output by nvram dump to somewhere else), as they will be lost on reboot

JFFS custom scripts and configs

Make sure Enable JFFS custom scripts and configs, is enabled in System settings. See https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts for details.

Make sure to also run the following commands:

nvram set jffs2_scripts="1"
nvram commit

User-scripts

Create the /jffs/scripts/wl file, and paste the nvram overwrites into this file (see given example file).

Create/adjust /jffs/scripts/init-start:

#!/bin/sh

[ -x /jffs/scripts/wl ] && /jffs/scripts/wl &
# [ -x /jffs/addons/AdGuardHome.d/AdGuardHome.sh ] && /jffs/addons/AdGuardHome.d/AdGuardHome.sh init-start & # place before addons

Create/adjust /jffs/scripts/services-start:

#!/bin/sh

/jffs/scripts/wl >/dev/null 2>&1 & # wl
# /jffs/scripts/scmerlin startup & # scMerlin

Create/adjust /jffs/scripts/service-event:

#!/bin/sh

if echo "$2" | /bin/grep -q "wireless"; then { /jffs/scripts/wl service_event "$@" & }; fi # wl

Create/adjust /jffs/scripts/service-event-end:

#!/bin/sh

if echo "$2" | /bin/grep -q "wireless"; then { /jffs/scripts/wl service_event "$@" & }; fi # wl

Make sure the scripts are executable:

chmod a+rx /jffs/scripts/*

Applying changes

You need to reboot the router to apply changes:

reboot

To make the changes persistent, make sure to add them to the jffs/scripts/wl script.

#!/bin/sh
########################################################
# SET CONFIG VALUES THAT GET PICKED UP BY THE FIRMWARE #
########################################################
# Allow all channels
nvram set territory_code=CN/02
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 wl_country_code=#a
nvram set wl_country_rev=0
nvram set wl0_country_code=#a
nvram set wl0_country_rev=0
nvram set wl0_chlist="1 2 3 4 5 6 7 8 9 10 11 12 13 14"
nvram set wl1_country_code=#a
nvram set wl1_country_rev=0
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"
# Set TX-Power (risky!)
nvram set 0:maxp2ga0=120
nvram set 0:maxp2ga1=120
nvram set 1:maxp5gb0a0=120
nvram set 1:maxp5gb0a1=120
nvram set 1:maxp5gb0a2=120
nvram set 1:maxp5gb0a3=120
nvram set 1:maxp5gb1a0=120
nvram set 1:maxp5gb1a1=120
nvram set 1:maxp5gb1a2=120
nvram set 1:maxp5gb1a3=120
nvram set 1:maxp5gb2a0=120
nvram set 1:maxp5gb2a1=120
nvram set 1:maxp5gb2a2=120
nvram set 1:maxp5gb2a3=120
nvram set 1:maxp5gb3a0=120
nvram set 1:maxp5gb3a1=120
nvram set 1:maxp5gb3a2=120
nvram set 1:maxp5gb3a3=120
nvram set 1:maxp5gb4a0=120
nvram set 1:maxp5gb4a1=120
nvram set 1:maxp5gb4a2=120
nvram set 1:maxp5gb4a3=120
# commented out because we set it manually below using the wl command
# nvram set wl0_txpower=708
# nvram set wl1_txpower=708
# nvram set wl_txpower=708
# Commit changes
nvram commit
########################
# "MANUAL" WL COMMANDS #
########################
# TURN OFF DSF SCANNING
wl -i eth6 down
wl -i eth6 country ALL
wl -i eth6 country_abbrev_override "US"
wl -i eth6 regulatory 1
wl -i eth6 spect 0
wl -i eth6 up
wl -i eth7 down
wl -i eth7 country ALL
wl -i eth7 country_abbrev_override "US"
wl -i eth7 regulatory 1
wl -i eth7 spect 0
wl -i eth7 up
# SET TRANSMISSION POWER (eth6=2,4ghz=2,5x; eth7=5ghz=max)
# MAY INCREASE HEAT, KEEP WIFI CHIPS BELOW 50°C
# double the power (mW) for the 2,4 ghz transmission
wl -i eth6 txpwr1 -m 200 -o
# reduced from 500 to 200 because it was too much and my smartphone
# wanted to connect to it when I was outside but failed because its
# own transmission power was proably to weak to 'answer'
# wl -i eth6 txpwr1 -m 500 -o
# max txpower for the 5g transmission
wl -i eth7 txpwr1 -m 1500 -o
#########################################################
# TURN OFF EVERYTHING ENERGY SAVING (MAY INCREASE HEAT) #
#########################################################
/bin/pwr config --cpuwait off
/bin/pwr config --phy off
/bin/pwr config --eee off
/bin/pwr config --apd off
/bin/pwr config --dgm off
### END SCRIPT ###
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment