2014-03-28 04:22:00

by Ben Greear

[permalink] [raw]
Subject: Setting txpower fails?

Any idea why this isn't working?

Kernel is 3.9.11+, driver is ath9k.

[root@ct523-9292 lanforge]# iwconfig wlan0
wlan0 IEEE 802.11abgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off

[root@ct523-9292 lanforge]# iwconfig wlan0 txpower 10
[root@ct523-9292 lanforge]# echo $?
0
[root@ct523-9292 lanforge]# iwconfig wlan0
wlan0 IEEE 802.11abgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off

[root@ct523-9292 lanforge]#

--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com



2014-03-29 05:47:03

by Kalle Valo

[permalink] [raw]
Subject: Re: Setting txpower fails?

Ben Greear <[email protected]> writes:

>>> [root@ct523-9292 lanforge]# iw dev wlan0 set txpower fixed 1000
>>> [root@ct523-9292 lanforge]# cat /debug/ieee80211/wiphy0/netdev\:wlan0/txpower
>>> 0
>>> [root@ct523-9292 lanforge]#
>>>
>>> [root@ct523-9292 lanforge]# cat /debug/ieee80211/wiphy0/netdev\:wlan0/user_power_level
>>> 10
>>>
>> Not on all systems...
>
> I suspect the difference is that my wlan0 is not actually connected,
> and it will probably show correct 'txpower' when it is connected.

I also recall openwrt having some custom tx power patches. They might
make a difference as well.

--
Kalle Valo

2014-03-28 14:39:11

by Sedat Dilek

[permalink] [raw]
Subject: Re: Setting txpower fails?

On Fri, Mar 28, 2014 at 3:18 PM, Ben Greear <[email protected]> wrote:
> On 03/28/2014 12:27 AM, Sedat Dilek wrote:
>>
>> On Fri, Mar 28, 2014 at 5:21 AM, Ben Greear <[email protected]>
>> wrote:
>>>
>>> Any idea why this isn't working?
>>>
>>> Kernel is 3.9.11+, driver is ath9k.
>>>
>>> [root@ct523-9292 lanforge]# iwconfig wlan0
>>> wlan0 IEEE 802.11abgn ESSID:off/any
>>> Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
>>> Retry short limit:7 RTS thr:off Fragment thr:off
>>> Encryption key:off
>>> Power Management:off
>>>
>>> [root@ct523-9292 lanforge]# iwconfig wlan0 txpower 10
>>> [root@ct523-9292 lanforge]# echo $?
>>> 0
>>> [root@ct523-9292 lanforge]# iwconfig wlan0
>>> wlan0 IEEE 802.11abgn ESSID:off/any
>>> Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
>>> Retry short limit:7 RTS thr:off Fragment thr:off
>>> Encryption key:off
>>> Power Management:off
>>>
>>> [root@ct523-9292 lanforge]#
>>>
>>
>> Which version of wireless-tools?
>> Why don't you use modern iw?
>
>
> Do you know the right incantation for 'iw'? From it's help, it seems
> this should work, but it throws an error. I haven't dug into the
> code to figure out why...
>
> [root@ct523-9292 lanforge]# iw dev wlan0 set txpower 10
> Invalid parameter: 10
>

I have found [1] in the wiki.
For more details and a quick answer try to ask on IRC?

- Sedat -

[1] http://wireless.kernel.org/en/users/Documentation/iw#Setting_TX_power

> [root@ct523-9292 lanforge]# iwconfig --version
> iwconfig Wireless-Tools version 29
> Compatible with Wireless Extension v11 to v22.
>
> Kernel Currently compiled with Wireless Extension v22.
>
> sta211 Recommend Wireless Extension v21 or later,
> Currently compiled with Wireless Extension v22.
> ...
>
>
> Thanks,
> Ben
>
>>
>> - Sedat -
>>
>
>
> --
> Ben Greear <[email protected]>
> Candela Technologies Inc http://www.candelatech.com
>

2014-03-28 15:15:22

by Bruno Antunes

[permalink] [raw]
Subject: Re: Setting txpower fails?


On 28 Mar, 2014, at 15:02 , Ben Greear <[email protected]> wrote:

> On 03/28/2014 07:49 AM, Bruno Antunes wrote:
>>
>> On 28 Mar, 2014, at 14:37 , Ben Greear <[email protected]> wrote:
>>
>>> On 03/28/2014 07:29 AM, Bruno Antunes wrote:
>>>> Hi Ben,
>>>> I think you are missing some parameters
>>>>
>>>> On 28 Mar, 2014, at 14:18 , Ben Greear <[email protected]> wrote:
>>>>
>>>>> On 03/28/2014 12:27 AM, Sedat Dilek wrote:
>>>>>> On Fri, Mar 28, 2014 at 5:21 AM, Ben Greear <[email protected]> wrote:
>>>>>>> Any idea why this isn't working?
>>>>>>>
>>>>>>> Kernel is 3.9.11+, driver is ath9k.
>>>>>>>
>>>>>>> [root@ct523-9292 lanforge]# iwconfig wlan0
>>>>>>> wlan0 IEEE 802.11abgn ESSID:off/any
>>>>>>> Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
>>>>>>> Retry short limit:7 RTS thr:off Fragment thr:off
>>>>>>> Encryption key:off
>>>>>>> Power Management:off
>>>>>>>
>>>>>>> [root@ct523-9292 lanforge]# iwconfig wlan0 txpower 10
>>>>
>>>> iw dev <devname> set txpower <auto|fixed|limit> [<tx power in mBm>]
>>>>
>>>> It should be something like:
>>>>
>>>> iw dev wlan0 set txpower fixed 1000
>>>
>>> Ok, that doesn't give an error, but 'iwconfig' still shows 16 dBm,
>>> and I don't see any way to get 'iw' to print out the power itself?
>>>
>>> So, not sure if it is really working or not.
>> It works , at least on iw 3.10.
>>
>> If you have debug enabled you can see the value changing.
>
> Just for posterity's sake, it seems you should really be looking
> at user_power_level:
>
> [root@ct523-9292 lanforge]# iw dev wlan0 set txpower fixed 1000
> [root@ct523-9292 lanforge]# cat /debug/ieee80211/wiphy0/netdev\:wlan0/txpower
> 0
> [root@ct523-9292 lanforge]#
>
> [root@ct523-9292 lanforge]# cat /debug/ieee80211/wiphy0/netdev\:wlan0/user_power_level
> 10
>
Not on all systems...

root@RSPro2:/etc/config# iw dev adhoc0 set txpower fixed 700
root@RSPro2:/etc/config# cat /sys/kernel/debug/ieee80211/phy0/netdev\:adhoc0/txpower
7
root@RSPro2:/etc/config# cat /sys/kernel/debug/ieee80211/phy0/netdev\:adhoc0/user_power_level
7

Bruno

> Thanks,
> Ben
>
>>
>> On a openwrt system
>>
>> root@RSPro2:/lib/wifi# iw dev adhoc0 set txpower fixed 900
>> root@RSPro2:/lib/wifi# cat /sys/kernel/debug/ieee80211/phy0/netdev:adhoc0/txpower
>> 9
>> root@RSPro2:/lib/wifi# iw dev adhoc0 set txpower fixed 1500
>> root@RSPro2:/lib/wifi# cat /sys/kernel/debug/ieee80211/phy0/netdev:adhoc0/txpower
>> 15
>>
>> And the received power changes on the station confirming that is making effect.
>>
>> Bruno
>>
>>>
>>> Thanks,
>>> Ben
>>>
>>>
>>> --
>>> Ben Greear <[email protected]>
>>> Candela Technologies Inc http://www.candelatech.com
>>>
>
>
> --
> Ben Greear <[email protected]>
> Candela Technologies Inc http://www.candelatech.com
>


2014-03-28 07:27:08

by Sedat Dilek

[permalink] [raw]
Subject: Re: Setting txpower fails?

On Fri, Mar 28, 2014 at 5:21 AM, Ben Greear <[email protected]> wrote:
> Any idea why this isn't working?
>
> Kernel is 3.9.11+, driver is ath9k.
>
> [root@ct523-9292 lanforge]# iwconfig wlan0
> wlan0 IEEE 802.11abgn ESSID:off/any
> Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
> Retry short limit:7 RTS thr:off Fragment thr:off
> Encryption key:off
> Power Management:off
>
> [root@ct523-9292 lanforge]# iwconfig wlan0 txpower 10
> [root@ct523-9292 lanforge]# echo $?
> 0
> [root@ct523-9292 lanforge]# iwconfig wlan0
> wlan0 IEEE 802.11abgn ESSID:off/any
> Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
> Retry short limit:7 RTS thr:off Fragment thr:off
> Encryption key:off
> Power Management:off
>
> [root@ct523-9292 lanforge]#
>

Which version of wireless-tools?
Why don't you use modern iw?

- Sedat -

2014-03-28 15:25:44

by Ben Greear

[permalink] [raw]
Subject: Re: Setting txpower fails?

On 03/28/2014 08:15 AM, Bruno Antunes wrote:
>
> On 28 Mar, 2014, at 15:02 , Ben Greear <[email protected]> wrote:
>
>> On 03/28/2014 07:49 AM, Bruno Antunes wrote:
>>>
>>> On 28 Mar, 2014, at 14:37 , Ben Greear <[email protected]> wrote:
>>>
>>>> On 03/28/2014 07:29 AM, Bruno Antunes wrote:
>>>>> Hi Ben,
>>>>> I think you are missing some parameters
>>>>>
>>>>> On 28 Mar, 2014, at 14:18 , Ben Greear <[email protected]> wrote:
>>>>>
>>>>>> On 03/28/2014 12:27 AM, Sedat Dilek wrote:
>>>>>>> On Fri, Mar 28, 2014 at 5:21 AM, Ben Greear <[email protected]> wrote:
>>>>>>>> Any idea why this isn't working?
>>>>>>>>
>>>>>>>> Kernel is 3.9.11+, driver is ath9k.
>>>>>>>>
>>>>>>>> [root@ct523-9292 lanforge]# iwconfig wlan0
>>>>>>>> wlan0 IEEE 802.11abgn ESSID:off/any
>>>>>>>> Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
>>>>>>>> Retry short limit:7 RTS thr:off Fragment thr:off
>>>>>>>> Encryption key:off
>>>>>>>> Power Management:off
>>>>>>>>
>>>>>>>> [root@ct523-9292 lanforge]# iwconfig wlan0 txpower 10
>>>>>
>>>>> iw dev <devname> set txpower <auto|fixed|limit> [<tx power in mBm>]
>>>>>
>>>>> It should be something like:
>>>>>
>>>>> iw dev wlan0 set txpower fixed 1000
>>>>
>>>> Ok, that doesn't give an error, but 'iwconfig' still shows 16 dBm,
>>>> and I don't see any way to get 'iw' to print out the power itself?
>>>>
>>>> So, not sure if it is really working or not.
>>> It works , at least on iw 3.10.
>>>
>>> If you have debug enabled you can see the value changing.
>>
>> Just for posterity's sake, it seems you should really be looking
>> at user_power_level:
>>
>> [root@ct523-9292 lanforge]# iw dev wlan0 set txpower fixed 1000
>> [root@ct523-9292 lanforge]# cat /debug/ieee80211/wiphy0/netdev\:wlan0/txpower
>> 0
>> [root@ct523-9292 lanforge]#
>>
>> [root@ct523-9292 lanforge]# cat /debug/ieee80211/wiphy0/netdev\:wlan0/user_power_level
>> 10
>>
> Not on all systems...

I suspect the difference is that my wlan0 is not actually connected,
and it will probably show correct 'txpower' when it is connected.

Thanks,
Ben

>
> root@RSPro2:/etc/config# iw dev adhoc0 set txpower fixed 700
> root@RSPro2:/etc/config# cat /sys/kernel/debug/ieee80211/phy0/netdev\:adhoc0/txpower
> 7
> root@RSPro2:/etc/config# cat /sys/kernel/debug/ieee80211/phy0/netdev\:adhoc0/user_power_level
> 7
>
> Bruno
>
>> Thanks,
>> Ben
>>
>>>
>>> On a openwrt system
>>>
>>> root@RSPro2:/lib/wifi# iw dev adhoc0 set txpower fixed 900
>>> root@RSPro2:/lib/wifi# cat /sys/kernel/debug/ieee80211/phy0/netdev:adhoc0/txpower
>>> 9
>>> root@RSPro2:/lib/wifi# iw dev adhoc0 set txpower fixed 1500
>>> root@RSPro2:/lib/wifi# cat /sys/kernel/debug/ieee80211/phy0/netdev:adhoc0/txpower
>>> 15
>>>
>>> And the received power changes on the station confirming that is making effect.
>>>
>>> Bruno
>>>
>>>>
>>>> Thanks,
>>>> Ben
>>>>
>>>>
>>>> --
>>>> Ben Greear <[email protected]>
>>>> Candela Technologies Inc http://www.candelatech.com
>>>>
>>
>>
>> --
>> Ben Greear <[email protected]>
>> Candela Technologies Inc http://www.candelatech.com
>>


--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com


2014-03-28 14:18:41

by Ben Greear

[permalink] [raw]
Subject: Re: Setting txpower fails?

On 03/28/2014 12:27 AM, Sedat Dilek wrote:
> On Fri, Mar 28, 2014 at 5:21 AM, Ben Greear <[email protected]> wrote:
>> Any idea why this isn't working?
>>
>> Kernel is 3.9.11+, driver is ath9k.
>>
>> [root@ct523-9292 lanforge]# iwconfig wlan0
>> wlan0 IEEE 802.11abgn ESSID:off/any
>> Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
>> Retry short limit:7 RTS thr:off Fragment thr:off
>> Encryption key:off
>> Power Management:off
>>
>> [root@ct523-9292 lanforge]# iwconfig wlan0 txpower 10
>> [root@ct523-9292 lanforge]# echo $?
>> 0
>> [root@ct523-9292 lanforge]# iwconfig wlan0
>> wlan0 IEEE 802.11abgn ESSID:off/any
>> Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
>> Retry short limit:7 RTS thr:off Fragment thr:off
>> Encryption key:off
>> Power Management:off
>>
>> [root@ct523-9292 lanforge]#
>>
>
> Which version of wireless-tools?
> Why don't you use modern iw?

Do you know the right incantation for 'iw'? From it's help, it seems
this should work, but it throws an error. I haven't dug into the
code to figure out why...

[root@ct523-9292 lanforge]# iw dev wlan0 set txpower 10
Invalid parameter: 10

[root@ct523-9292 lanforge]# iwconfig --version
iwconfig Wireless-Tools version 29
Compatible with Wireless Extension v11 to v22.

Kernel Currently compiled with Wireless Extension v22.

sta211 Recommend Wireless Extension v21 or later,
Currently compiled with Wireless Extension v22.
...


Thanks,
Ben

>
> - Sedat -
>


--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com