5

With the Raspberry Pi (latest Raspbian OS) configured as a WiFi Access Point that gives internet access through ethernet interface, I'm doing some WiFi Signal Strength testing.

In reduced space to work, I need to test quality of network with a script that can increment or decrement the signal strength, via shell script.

So, a simple use-case thought is, to drop to minimum the signal strength, in order to get a low quality connection, or disconnection from a short distance, let's say, from two to three meters.

I tried with

iwconfig wlan0 txpower 0

I get this output:

wlan0     IEEE 802.11bgn  Mode:Master  Tx-Power=0 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

And with...

iw dev wlan0 set txpower limit 0.00000000000000000000000000000000000000001

I see:

wlan0     IEEE 802.11bgn  Mode:Master  Tx-Power=1 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

But, no field effects, I can have a solid rock connection from the location an Android phone device is.

I've already read the following sources, and mapped some data from the manufacturer's specs, in order to get something, but nothing whatsoever.

Raspberry Pi 3: wrong tx-power in iwconfig

https://www.raspberrypi.org/forums/viewtopic.php?t=145607&p=959671

http://www.cypress.com/file/298756/download

So, how can the signal strength be modified with commands, in order to get a low quality WiFi Access Point?

1

Not all devices support txpower - see this superuser.com answer for the general case, and you already found the wrong txpower question.

Given your constraints, there are four easy options:

  • Try a different distribution, particularly one that might have a good focus on being able to control wifi, such as Kali
  • Check in with the Raspberry Pi wireless driver developers
  • Try several USB wifi cards to find one that does what you need
    • this link indicates that the Ralink driver for the WL0162 (chipset RT3070L) and other adapters like the AWUS051NH (chipset RT2770 RT2750) may be able to change wifi power on at least some Linux variants; the AWUS in particular is an excellent choice.
  • You need a shell script to control wifi power? Put your Pi3 on a metal baking sheet, then attach a stepper motor connected to a metal cookie tin, so that you can run your shell script to lower the cookie tin over the Pi3, or raise it up and expose the Pi3.
| improve this answer | |
  • Very illustrative. Thanks a lot for taking your time for answering this. I'll go through the four options. The last one seems fun I must say, GPIOs at finest and home made tools. – jon Jan 18 '18 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.