Increasing txpower

Posted by BillB 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Increasing txpower
April 01, 2018 04:34PM
Apparently, all Linux distributions limit the amount of wifi power that you can transmit ("Tx-Power" from the iwconfig command), regardless of the capability of your wifi adapter. This is apparently legally required. Unfortuanately, for some reason that I can't fathom, although the Raspberry Pi PirateBox knows that I am in the United States, it limits my wifi power to 20 dB, even though the legal limit in the United States is actually above 30 dB. I know increasing txpower involves downloading, compiling, and installing some packages like python-m2crypto, the crda regulatory package, and the wireless regulatory database. Is there some easy way of fixing this without going through what I'm afraid may be a lengthy and frustrating process involving the above named packages, which may be incompatable with the Archlinux distribtion on the Raspberry Pi PirateBox?
Re: Increasing txpower
April 04, 2018 07:31AM
Hi,
the first approach is using "iw reg set GY" and channel 13 . Is channel 13 suitable in your case? If yes, you have to do some adjustments in the hostap config.
If not, then you have to rebuild a custom CRDA database (you can blacklist the original crda in pacman.conf for being updated later). :-/

best regards Matthias
Re: Increasing txpower
April 08, 2018 07:08PM
The first approach worked. Thank you for the easy solution!
Re: Increasing txpower
April 14, 2018 07:36PM
Looking at this more carefully, I noticed that although iwconfig reports an increased txpower, the PirateBox wifi signal strength at my laptop does not actually appear to have increased. I'm using an AWUS036NH wifi adapter. Is the value of txpower reported by iwconfig the transmitted power REPORTED by the wifi adapter, or is it the transmitted power COMMANDED to the wifi adapter? If the latter, is there something else preventing the wifi adapter from actually transmitting the power that it is commanded to transmit?
Re: Increasing txpower
April 19, 2018 06:29AM
good question. I guess (!) if you set the txpower, you command it over to the chip and later you are actually reading it from the driver&chip.
I had effects where I set a higher value with no error messages, but the old value still existed on the iwconfig output.

There also exists a kind of calculation, which accounts the dBi increase through the antenna(s) to the txpower value. eye popping smiley

Last but not least, you can try to compile the fixed crda and try to set any value the driver&the chip permits. I haven't tried such a thing for myself yet.. but I read the ALFAs should be handle alot.


BTW: Just increasing the txpower doesn't necessarily help you. Only if you have two parties with higher txpower, you benefit from it. It is like two people standing on huge field pretty much away from each other. One is having a megaphone and the other not. Guess what happens? The guy without the megaphone always wants to answer the other one, but this one does simply not hear the answers.
That will likely happen to far away wifi clients in such a scenario and keep a uer experience of a not working wifi.

best regards Matthias
Re: Increasing txpower
April 21, 2018 05:51PM
I am aware of the problem of the other person not having enough power to transmit back to the PiratreBox. But I figure that if they at least know that the PirateBox is there (because it is putting out a lot of power), then they may be motivated to take steps to communicated back (by moving closer or generating more power themselves--assuming they are smart enough to realize why they can't communicate in the first place).

One thing I noticed yesterday was that the command "ifconfig wlan1 down" (where wlan1 is the Alfa) does not seem to work (I don't know why). And the iwconfig command does not recognize the "down" modifier. So, I have no way of taking down wlan1, increasing txpower, and bringing wlan1 back up again. That may be what is causing the problem, but I don't know how to fix it.

It's a long shot, but I have also noticed strange effects due to repeated powering down and powering up of the PirateBox, even when done correctly. Perhaps I should make a fresh install and see if the problem persists.
Re: Increasing txpower
April 21, 2018 05:56PM
By the way, the python-m2crypto/CRDA/wireless regulatory database approach doesn't seem to be an option--at least with my level of experience with Linux. The version of the code I downloaded wouldn't even compile on the PirateBox.
Re: Increasing txpower
May 10, 2018 06:14PM
Other people are also reporting that the Alfa AWUS036NH wifi adapter seems to be limited to a power output of around 50mW (17dBm), not the 2000mW that the manufacturer claims:

[xiaopan.co]

So, even though iwconfig can report a power output of 30dBm, the actual maximum power output is only around 17dBm.

Wouldn't it be nice if we lived in a world where manufacturers didn't lie about their products?
Re: Increasing txpower
May 11, 2018 05:18PM
yep. Just one name: Volkswagen.

:-(
Re: Increasing txpower
November 11, 2018 11:33PM
There's a better way, but you're not going to like it.

The Pi's onboard antenna sucks, on all pis. This is not the Pi designer's fault - there's simply no way to make a good antenna in such a tiny amount of space. They tried, and they did a good job too - but there's no way that a dinky little PCB antenna can match the performance of a full-sized one.

The designers are well aware of this, and helpfully provided an unpopulated space on the board for a u.fl connector, for attaching an external antenna. However, to use this you need to solder the u.fl connector in place with some really precise soldering - and then remove and reposition a zero-ohm resistor to switch from onboard to external antenna, a procedure which involves manipulating a component so tiny that it is similar in size to the tip of a sewing needle.

If you do have that level of soldering ability, or know someone who does, then performing this modification to your pi zero w (assuming you don't break it in the attempt) would allow the use of an external antenna which would increase wireless performance far more than anything you could possibly do in software.

This picture shows what needs to be done:
[www.briandorey.com]
As you can see, the PCB traces are already present - the pi designers intended for this to be doable, so it's a simple mod. It just requires the type of work that can only be done under a microscope.