1

I want to restrict the wifi range of my Pi in order to only have a really small range of around one or two meters for my access point. I'm not totally new, but I don't know any way to reach the goal or find a solution, cause somehow everyone wants to raise up the wifi range ;D Anyway, I would be glad about a solution! Cheers guys!

1

You can get info about the interface from the access point with:

rpi ~$ sudo iw dev wlan0 info
Interface wlan0
        ifindex 3
        wdev 0x1
        addr b8:27:eb:06:e8:8b
        ssid RPiNet
        type AP
        wiphy 0
        channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
        txpower 31.00 dBm
rpi ~$

The last line give you the transmit power. On my Raspberry Pi 3B+ it shows the maximum of 31.00 dBm. There is a command to set the txpower with for example:

rpi ~$ sudo iw dev wlan0 set txpower fixed 100

This will set the txpower to 1.00 dBm. It should really reduce the range to some meters. If not you are free to reduce it what you like.

The value at the end of the command to set txpower is messured in mBm, so 100 means 1.00 dBm and 50 means 0.50 dBm. Look at sudo iw help | less and search for txpower. You will find:

dev <devname> set txpower <auto|fixed|limit> [<tx power in mBm>]
        Specify transmit power level and setting type.

phy <phyname> set txpower <auto|fixed|limit> [<tx power in mBm>]
        Specify transmit power level and setting type.

I haven't tested it but it should do the thing.

  • Ach ein Landsmann! :D ok, das ist genau das, was ich gesucht habe. Wenn ich den Wert erhöhen will, muss ich einfach bloß die Zahl noch hinter ‚txpower‘ schreiben? – lpsweder Nov 14 '18 at 21:24
  • @lpsweder Du meinst die Zahl hinter fixed? Ja, das ist sie. Ich werde die Antwort ergänzen. For the community: do you mean the value behind fixed? Yes, that's it. I will update the answer. – Ingo Nov 14 '18 at 21:36
  • ok wunderbar! Danke dir! – lpsweder Nov 14 '18 at 21:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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