[resolved]iwconfig not running as before on TP-Link 841N v9

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
numerci
DD-WRT User


Joined: 02 May 2012
Posts: 134

PostPosted: Tue Sep 12, 2017 18:02    Post subject: [resolved]iwconfig not running as before on TP-Link 841N v9 Reply with quote
On my TP-Link 841N v9 I used to have some cron scripts to lower the WiFi power during the night when I do not need it to be at full power:

00 22 * * * root iwconfig ath0 txpower 5
00 07 * * * root iwconfig ath0 txpower 20

This has used to work fine till the 33xxx versions. Also still works well on Archer C7 on builds 33xxx, but not with 841N.

I do not think that the cron jobs are at fault but the commands are not accepted anymore. If I try to run them from the run command the following error is displayed:

Command: iwconfig ath0 txpower 5
Error: sh: eval: line 1: iwconfig: not found

Any hints how to get around this error?


Last edited by numerci on Thu Sep 14, 2017 17:16; edited 2 times in total
Sponsor
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Wed Sep 13, 2017 14:27    Post subject: Re: Cron scripts not running as before Reply with quote
numerci wrote:
...
00 22 * * * root iwconfig ath0 txpower 5
00 07 * * * root iwconfig ath0 txpower 20
....
I do not think that the cron jobs are at fault but the commands are not accepted anymore. If I try to run them from the run command the following error is displayed:

Command: iwconfig ath0 txpower 5
Error: sh: eval: line 1: iwconfig: not found

Any hints how to get around this error?

Try specifying full path to iwconfig, for example,
Code:
00 22 * * * root /sbin/iwconfig ath0 txpower 5

A Google search (keywords: "iwconfig not found") result that might interest you:
https://www.reddit.com/r/debian/comments/3eadkg/wirelesstools_installed_iwconfig_not_found/

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
numerci
DD-WRT User


Joined: 02 May 2012
Posts: 134

PostPosted: Wed Sep 13, 2017 16:00    Post subject: Reply with quote
Thanks for the hint but this does not help. There is still the same message:

DD-WRT v3.0-r33006 std (c) 2017 NewMedia-NET GmbH
Release: 08/03/17

DD-WRT login: root
Password:
==========================================================

___ ___ _ _____ ______ ____ ___
/ _ \/ _ \___| | /| / / _ \/_ __/ _ __|_ / / _ \
/ // / // /___/ |/ |/ / , _/ / / | |/ //_ <_/ // /
/____/____/ |__/|__/_/|_| /_/ |___/____(_)___/

DD-WRT v3.0
http://www.dd-wrt.com

==========================================================


BusyBox v1.27.1 (2017-08-03 05:02:44 CEST) built-in shell (ash)

root@DD-WRT:~# /sbin/iwconfig ath0 txpower 5
-sh: /sbin/iwconfig: not found
root@DD-WRT:~#


I am afraid that not the entire Wireless tools package is installed anymore on this router. Could be that they have tried to save the space.
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Wed Sep 13, 2017 16:17    Post subject: Reply with quote
numerci wrote:
Thanks for the hint but this does not help. There is still the same message:
....
Code:
BusyBox v1.27.1 (2017-08-03 05:02:44 CEST) built-in shell (ash)

root@DD-WRT:~# /sbin/iwconfig ath0 txpower 5
-sh: /sbin/iwconfig: not found
root@DD-WRT:~#


I am afraid that not the entire Wireless tools package is installed anymore on this router. Could be that they have tried to save the space.

Maybe iwconfig was deprecated?? Google-d "iwconfig replacement" and this result looks interesting:

https://dougvitale.wordpress.com/2011/12/21/deprecated-linux-networking-commands-and-their-replacements/

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
numerci
DD-WRT User


Joined: 02 May 2012
Posts: 134

PostPosted: Wed Sep 13, 2017 16:20    Post subject: Reply with quote
Ok, it seem that iwconfig command is deprecated and was replaced by iw. On this command the router seem to respond but I need to see how it can be correctly used.
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Wed Sep 13, 2017 16:21    Post subject: Reply with quote
numerci wrote:
Ok, it seem that iwconfig command is deprecated and was replaced by iw. On this command the router seem to respond but I need to see how it can be correctly used.

Glad to know it helps.

BTW, some Linux distributions might put iwconifg in directories other than /sbin. So don't just assume the locations of certain commands. Search for it using find or ls.

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
numerci
DD-WRT User


Joined: 02 May 2012
Posts: 134

PostPosted: Wed Sep 13, 2017 17:49    Post subject: Reply with quote
For iw these would be the options:

Setting TX power

You can set the txpower by using either the device interface name of the respective phy.

iw dev <devname> set txpower <auto|fixed|limit> [<tx power in mBm>]
iw phy <phyname> set txpower <auto|fixed|limit> [<tx power in mBm>]
(Note that the value this commands takes is in millibel-milliwatts (mBm) instead of the commonly used decibel-milliwatts (dBm). <power in mBm> = 100 * <power in dBm>)


The command was accepted but has not changed anythig.

iw dev ath0 set txpower fixed [500]

Maybe I have misunderstood the 500 value.
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Wed Sep 13, 2017 19:48    Post subject: Reply with quote
numerci wrote:
For iw these would be the options:

Setting TX power

You can set the txpower by using either the device interface name of the respective phy.

iw dev <devname> set txpower <auto|fixed|limit> [<tx power in mBm>]
iw phy <phyname> set txpower <auto|fixed|limit> [<tx power in mBm>]
(Note that the value this commands takes is in millibel-milliwatts (mBm) instead of the commonly used decibel-milliwatts (dBm). <power in mBm> = 100 * <power in dBm>)


The command was accepted but has not changed anythig.

iw dev ath0 set txpower fixed [500]

Maybe I have misunderstood the 500 value.

Or maybe DD-WRT doesn't understand iw but iwconfig? Need expert opinions! Smile

BTW, you might wanna update the subject of your post. It's no longer about cron but iwconfig!

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
numerci
DD-WRT User


Joined: 02 May 2012
Posts: 134

PostPosted: Wed Sep 13, 2017 20:04    Post subject: Reply with quote
It used to work fine with iwconfig on TP_link 841N v9 and it still works fine on Archer C7 v2. Is not a big issue but would be nice to have this working again.

Problem is that I do not understand what is wrong.

PS: the subject of the thread was updated.
numerci
DD-WRT User


Joined: 02 May 2012
Posts: 134

PostPosted: Thu Sep 14, 2017 17:05    Post subject: Reply with quote
Problem solved!

Old entry that was needed on the Cron jobs that is not working anymore:
00 22 * * * root iwconfig ath0 txpower 5
00 07 * * * root iwconfig ath0 txpower 20

Needs to be replaced with:
00 22 * * * root iw dev ath0 set txpower fixed 500
00 07 * * * root iw dev ath0 set txpower fixed 2000

And it works as before. Smile
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC 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 cannot attach files in this forum
You cannot download files in this forum