Changing channel using command line

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Jul 01, 2007 16:00    Post subject: Changing channel using command line Reply with quote
2 days ago I wanted to change the channel of a WDS-bridge.
This WDS-bridge is on a remote system (on the Internet)
Somehow I didn't have http-access to it.
Restarting httpd didn't work, rebooting didn't.

Shell access was still in place so I tried to do it this way.
After that I didn't have a working WDS and they had to bring it in for a reconfiguration.

WARNING: this stopped my router from functioning

Code:
~ # nvram show | grep channel | grep 10
size: 30434 bytes (2334 left)
d11g_channel=10
wl_channel=10
wl0_channel=10
~ # nvram set wl_channel=8
~ # nvram set wl0_channel=8
~ # nvram set d11g_channel=8
~ # nvram commit
~ # reboot

Can anybody tell me what is wrong with these commands?

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)


Last edited by frater on Sun Jul 01, 2007 16:08; edited 1 time in total
Sponsor
confused_user
DD-WRT User


Joined: 17 Mar 2007
Posts: 347

PostPosted: Sun Jul 01, 2007 16:08    Post subject: Reply with quote
If you like to play with the console use OpenWrt Kamikaze.
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Jul 01, 2007 16:15    Post subject: Reply with quote
It's not that I like to play...
Easiest was using the webinterface, but that wasn't an option as http-access didn't work out.

I grew up using command-line and it wasn't until GEM and later Windows 1.x that I started using GUI's. I still regret how I whole-heartedly embraced Windows 3.0.
I wish I started programming in Unix (later Linux) instead of MS-DOS.
Now I'm not a programmer anymore...

But... that's all a bit off topic. Shell access itself isn't the problem here... I wonder what I'm doing wrong here...

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Tue Jul 03, 2007 18:10    Post subject: Reply with quote
Anyone knows what was wrong with changing channels this way?
_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
sputy
DD-WRT Novice


Joined: 08 Jun 2006
Posts: 36

PostPosted: Tue Jul 03, 2007 22:01    Post subject: Reply with quote
This does it for me "live" and you don't even need to reboot. If you have the wds watchdog running and haven't typed nvram commit if it doesn't work it reboots itself with the old config.

Code:

#!/bin/sh
# sets channel for ap, andy gale

echo -n "setting channel to $1"
nvram set d11g_channel=$1
nvram set wl_channel=$1
nvram set wl0_channel=$1

ssid=`nvram get wl0_ssid`

wl channel $1
wl ssid $ssid
arp -d `nvram get lan_gateway`
freezer
DD-WRT Novice


Joined: 05 Jan 2013
Posts: 7

PostPosted: Tue Sep 24, 2019 2:01    Post subject: Reply with quote
sputy wrote:
This does it for me "live" and you don't even need to reboot. If you have the wds watchdog running and haven't typed nvram commit if it doesn't work it reboots itself with the old config.

Code:

#!/bin/sh
# sets channel for ap, andy gale

echo -n "setting channel to $1"
nvram set d11g_channel=$1
nvram set wl_channel=$1
nvram set wl0_channel=$1

ssid=`nvram get wl0_ssid`

wl channel $1
wl ssid $ssid
arp -d `nvram get lan_gateway`


sputy, could I ask you to add some details as what line/code does what please? I'm trying to learn this stuff and STILL can't change my wl0 or wl1 channels to a less busy freq.

Appreciate it.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum