Jump to content

txpower woes


Crypiehef

Recommended Posts

When committing the following commands the txpower never changes and is showing 18.

iw reg set BO

iwconfig wlan0 txpower "anything from 20-30"

iwconfig wlan0 still shows txpower=18.

MKV with the latest infusion updates.

-Crypiehef

Link to comment
Share on other sites

Are you downing the wlan0 first?

ifconfig wlan0 down

Yes, I tried it both ways. While it was up. When that didn't work I issued ifconfig wlan0 down then iw reg set BO then iwconfig wlan0 txpower 30 (other values as well) then ifconfig wlan0 up. Still reports txpower=18.

Link to comment
Share on other sites

When committing the following commands the txpower never changes and is showing 18.

iw reg set BO

iwconfig wlan0 txpower "anything from 20-30"

iwconfig wlan0 still shows txpower=18.

MKV with the latest infusion updates.

-Crypiehef

Crypiehef,

The new TX-Power setting will not be reflected until after you put your radio back up. Try this:

1) Connect to your Pineapple via ethernet cable (assuming wlan0 is your AP)

2) SSH into your Pineapple - "ssh root@172.16.42.1"

3) Put wlan0 down - "ifconfig wlan0 down"

4) Set the region to Bolivia - "iw reg set BO"

5) Confirm that the region was changed - "iw reg get"

Note: You should see "Country BO:"

6) Set wlan0's TX-Power to 30dBm - "iwconfig wlan0 txpower 30dBm"

7) Put wlan0 up - "ifconfig wlan0 up"

8) Now confirm the TX-Power change - "iwconfig wlan0"

I know wlan1 can max at 30dBm but I'm not sure what wlan0 can max at; maybe 20 or 27dBm if not 30.

Link to comment
Share on other sites

Crypiehef,

The new TX-Power setting will not be reflected until after you put your radio back up. Try this:

1) Connect to your Pineapple via ethernet cable (assuming wlan0 is your AP)

2) SSH into your Pineapple - "ssh root@172.16.42.1"

3) Put wlan0 down - "ifconfig wlan0 down"

4) Set the region to Bolivia - "iw reg set BO"

5) Confirm that the region was changed - "iw reg get"

Note: You should see "Country BO:"

6) Set wlan0's TX-Power to 30dBm - "iwconfig wlan0 txpower 30dBm"

7) Put wlan0 up - "ifconfig wlan0 up"

8) Now confirm the TX-Power change - "iwconfig wlan0"

I know wlan1 can max at 30dBm but I'm not sure what wlan0 can max at; maybe 20 or 27dBm if not 30.

Already did that. Thanks though. It still not going higher than 18. I'll keep trying other things. Oh and WLAN1 works without issues changing the regulatory domain and issuing the txpower command. Just having the problem with WLAN0.

Link to comment
Share on other sites

Already did that. Thanks though. It still not going higher than 18. I'll keep trying other things. Oh and WLAN1 works without issues changing the regulatory domain and issuing the txpower command. Just having the problem with WLAN0.

Thanks Chriswhat... What I was doing wrong (after being so used to debian/kali linux) was not including dBm in the command. After including dBM in the iwconfig wlan0 txpower 30dBm it worked like a charm. Thanks! I should have thought of that. LOL.

Link to comment
Share on other sites

Good Day All,

I've been working adjusting the power of my AP wlan0. I've had good luck increasing the power by simply changing the region setting to Bolivia

"iw reg set BO"

Then adjusting the power to something higher than the default 18 dBm

"ifconfig wlan0 down"

"iwconfig wlan0 txpower 25"

"ifconfig wlan0 up"

This didn't do much for me because the AP did not come backup, and the blue light didn't turn back on. From reading other posts I understand that I must also run the "wifi" command. This worked great and brought up both wlan0 and wlan1. However, once I changed the region code to "BO" the power on both wlan1 and wlan0 MAXED.

wlan0 = 27

wlan1 = 30

I've been doing some reading and I actually do not want to run on full power all the time. I would like granular control over the settings. I would much rather run my wlan0 at 25 dBm, and leave wlan1 at 27dBm.

It appears that the "wifi" command sets the power to the max depending on the region. I've looked through the script and don't see anything obvious that adjusting the settings.

Is there a way to bring down wlan0 adjust the power settings and bring it back up without running the "wifi" command? I must be missing something somewhere.

Note: I also tried " "iwconfig wlan0 txpower 25dBm" with not difference. Both commands appear to be accepted.

Thank You

Link to comment
Share on other sites

I got this one figured out. The problem I was running into is when I would run the following code the power of the radio's were at their MAX. With a little reading I found out that OpenWRT always defaults to MAX power. However, trying to change the power to anything else didn't work for me using "iwconfig wlan0 txpower 29" The settings were just ignored.

The following code works for me:

uci set wireless.@wifi-device[0].country=BO
uci set wireless.@wifi-device[0].txpower=24
uci set wireless.@wifi-device[1].country=BO
uci set wireless.@wifi-device[1].txpower=29
uci commit wireless
wifi
Link to comment
Share on other sites

I got this one figured out. The problem I was running into is when I would run the following code the power of the radio's were at their MAX. With a little reading I found out that OpenWRT always defaults to MAX power. However, trying to change the power to anything else didn't work for me using "iwconfig wlan0 txpower 29" The settings were just ignored.

The following code works for me:

uci set wireless.@wifi-device[0].country=BO
uci set wireless.@wifi-device[0].txpower=24
uci set wireless.@wifi-device[1].country=BO
uci set wireless.@wifi-device[1].txpower=29
uci commit wireless
wifi

just wondering how you decided on the optimum power settings?

Link to comment
Share on other sites

I got this one figured out. The problem I was running into is when I would run the following code the power of the radio's were at their MAX. With a little reading I found out that OpenWRT always defaults to MAX power. However, trying to change the power to anything else didn't work for me using "iwconfig wlan0 txpower 29" The settings were just ignored.

The following code works for me:

uci set wireless.@wifi-device[0].country=BO
uci set wireless.@wifi-device[0].txpower=24
uci set wireless.@wifi-device[1].country=BO
uci set wireless.@wifi-device[1].txpower=29
uci commit wireless
wifi

I would like to have these same power specs on boot as well. I also have another interface plugged into the USB port (wlan2) I could add another entry for. Where are/how are you entering this code? Is it a boot config file somewhere? Sorry if this answer is obvious, I'm still learning the Pineapple.

Link to comment
Share on other sites

i am not in front of my pineapple right now to test but the code is entered into ssh or through execute command from the web gui all on one line wit ; separating them

what its doing is changing your config file located at /etc/config/wireless and then restarting the wireless

to add wlan2 to the config you could do

wifi detect > /etc/config/wireless && reboot

that will check for all wireless hardware and rebuild the config file including your wlan2 device and reboot with the correct config. then you could add

uci set wireless.@wifi-device[2].country=BO
uci set wireless.@wifi-device[2].txpower=24

so then you could enter

uci set wireless.@wifi-device[0].country=BO; uci set wireless.@wifi-device[0].txpower=24; uci set wireless.@wifi-device[1].country=BO; uci set wireless.@wifi-device[1].txpower=29; uci set wireless.@wifi-device[2].country=BO; uci set wireless.@wifi-device[2].txpower=24; uci commit wireless; wifi

all one line in a dip switch or through the gui's execute command.

again I am not in front of my pineapple but this should work.

the only thing i am unsure about if if you can leave the config with the wlan2 in it after you remove the device or if you will have to reset the config again.... i would think it should not be an issue having the extra device in the config even when not connected.

Edited by jjd
Link to comment
Share on other sites

Thanks for the reply! I did every step via SSH, and after the last (long) line I got this: Failed to start hostapd for phy2

Rebooted, ran iwconfig, and

wlan2 = 30dbm,

wlan1 = 29dbm,

wlan0 = 18dbm.

Thoughts?

Link to comment
Share on other sites


config wifi-device 'radio0'

option type 'mac80211'

option hwmode '11ng'

option macaddr '---------'

option htmode 'HT20'

list ht_capab 'SHORT-GI-20'

list ht_capab 'SHORT-GI-40'

list ht_capab 'RX-STBC1'

list ht_capab 'DSSS_CCK-40'

option country 'BO'

option txpower '24'

option channel '6'

option disabled '0'

config wifi-iface

option device 'radio0'

option network 'lan'

option mode 'ap'

option ssid '---------'

option hidden '0'

option key '------'

option encryption 'psk2+aes'

config wifi-device 'radio1'

option type 'mac80211'

option hwmode '11ng'

option macaddr '-------'

option htmode 'HT20'

list ht_capab 'GF'

list ht_capab 'SHORT-GI-20'

list ht_capab 'SHORT-GI-40'

list ht_capab 'RX-STBC1'

option country 'BO'

option txpower '29'

option disabled '0'

option channel '6'

config wifi-iface

option device 'radio1'

option hidden '0'

option ssid '-----'

option mode 'sta'

option network 'wan'

option key '-------'

option encryption 'psk2+aes'

config wifi-device 'radio2'

option type 'mac80211'

option channel '11'

option hwmode '11g'

option macaddr '0-----------'

option country 'BO'

option txpower '24'

option disabled '0'

config wifi-iface

option device 'radio2'

option network 'lan'

option hidden '0'

option mode 'sta'

Link to comment
Share on other sites

Does anyone else have their ssh session hang when issuing a "ifconfig wlan0 up/down"? The command works but i have to reloggin. Not the end of the world but definantly annoying to be sure. :-/

Addendum: The instructions work like a charm, but at 30, I definantly felt the bottom of my pineapple heating up. Changed back to US for further investigation.

Edited by King Crimson
Link to comment
Share on other sites

Iv'e been using SSH, no problems with hanging while connected over hard line. I played with it off an on this morning, couldn't get anything going. Had the file looking perfect, but wlan0 was still at 18dbm, and my other two were maxed. So I reset the config file. I'm going to try adding a line to one of the dip switches, and see how that does.

I decided to take the pineapple with me to my dentist appointment today to leave in the car. I wasn't far away at all, and the AP was too weak to be able to connect to with my phone. I had tons of other APs coming in, but not mine. My pineapple was setup in the travel bag, on battery, and up in the front window.

So it is looking like turning wlan0 up a bit would be a good idea. Especially if that's the interface clients would be connecting too? (I haven't really done any MITM stuff yet)

Link to comment
Share on other sites

Okay, I've got it where I want it now.

Reset the wifi config file. Then setup a DIP switch with this command:

iw reg set BO; ifconfig wlan0 down; iwconfig wlan0 txpower 27dbm; ifconfig wlan0 up

So wlan0 boots at 27dbm, and both wlan1 and wlan2 boot to 27dbm by default.

Link to comment
Share on other sites

Okay, let me throw this out there. What's the end goal of cranking up the power?

Well, like I posted up above. I wasn't that far away, and I couldn't connect to it. My car was in the parking lot, and it was being drowned out by AP's in surrounding buildings.

I know that blindly cranking the power may not help, but I wanted the option to try. I have had good results with routers (w/ DD-WRT) changing the power output. I really don't know anything about this chipset, and how high it can go before we are just heating things up for nothing. I also realize that there are a trillion other variables at play here.

I do know most routers I've played with start in the 70mw range (18-19dbm) and work well in the 125-150mw (21-22dbm) range. I have my Asus RT-AC66R at 120mw with great results. I also have a 2nd router (older Netgear WNDR3700) set at 40mw. I've configured several older WRT-54G routers for friends as wireless repeaters using 150mw power.

Thinking about it now, 27dbm is a bit excessive. That's half a watt, probably wasting power which is not a brilliant idea while on the battery.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...