TX Power for WiFi cannot be changed

I am running LEDE on a WNDR3700v2 and I live in the Netherlands. No matter what I try I cannot get the WiFi configured with a TX power of 17dBmW.

According to the output of iw reg get I should be able to set the TXpower to 20dBmW

global
country NL: DFS-ETSI
(2402 - 2482 @ 40), (N/A, 20), (N/A)
(5170 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR, AUTO-BW
(5250 - 5330 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
(5490 - 5710 @ 160), (N/A, 27), (0 ms), DFS
(5725 - 5875 @ 80), (N/A, 14), (N/A)
(57000 - 66000 @ 2160), (N/A, 40), (N/A)

phy#1
country US: DFS-FCC
(2402 - 2472 @ 40), (N/A, 30), (N/A)
(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
(5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
(5735 - 5835 @ 80), (N/A, 30), (N/A)
(57240 - 63720 @ 2160), (N/A, 40), (N/A)

phy#0
country US: DFS-FCC
(2402 - 2472 @ 40), (N/A, 30), (N/A)
(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
(5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
(5735 - 5835 @ 80), (N/A, 30), (N/A)
(57240 - 63720 @ 2160), (N/A, 40), (N/A)

In Luci I can configure the TXpower for the 2.4GHz band but the actual TXPower is never higher than 17dBmW as shown in this output of iw dev

Interface wlan0
ifindex 128
wdev 0x1b
addr XXXXXXXXXXXXXX
ssid XXXXXX
type AP
channel 11 (2462 MHz), width: 20 MHz, center1: 2462 MHz
txpower 17.00 dBm

I can get the 2.4GHz to send on 20dBm if I configure the regulatory domain in LuCi as US and set the TXpower to 20dBm.

How can I configure this correctly or is this a bug and should I report it?

same here, multiple devices.
probably a bug

fixing it would touch regulatory stuff, so noone wants to...

setting region TW fixes it for me.

On most devices you have around 2-3 dB antenna gain, which you have to subtract from the allowed figures.

@slh's brief answer means: It's working properly, and not a bug.

I believe the RF settings is one of the more carefully examined parts of LEDE, since it's against the law to operate outside of your country's regulations. This code has been exquisitely tweaked and tested so that it operates within limits.

TL;DR If your transmit power is 17dB, and you have an antenna that provides an additional 3dB of gain, then you're getting the full 20 dB injected "into the ether" which would be the legal limit in NL

@slh, @richb-hanover, thanks for your response. Yes, your answer makes perfect sense.

Is this antenna gain for my device documented somewhere?

In addition I believe tx power and antenna gain are different settings. Would it not be clearer to set the antenna gain to 3dB and txpower to 20dB? This way the matter would be clearer in my opinion.

@JeeDeWee I send you a pm to clear things up.

Seems a bit pointless to try and take into account any antennae gain as any device with detachable antennae can be easily changed to a higher gain antenna.
And yes, it does require some technical skill, but most devices can have the antennae changed fairly easily.
And for anyone, just change the default country to another that has a higher TX power limit,
Not exactly rocket science.

Ahah. I could have been more expansive. "Antenna gain" is a property of the physical dimensions and configuration of the antenna. The typical removable external stick antenna on a router has approximately 3dB gain. The manufacturer (and LEDE) assume the presence of that antenna, and then set the transmit power to a level that does not exceed the country regulations.

It is certainly possible to purchase a "high gain" antenna that, because of its physical construction, offers higher gain. You can even connect your router to a dish antenna that focusses its energy in a narrow beam, so that you can transmit across long distances. (Google "cantenna" and follow the links for a pleasant afternoon down the DIY rabbit hole.)

But... Two things to remember:

  1. The settings allowed by the manufacturer and LEDE firmware are the max allowed by the country. If you alter the router (say, with a new antenna) that causes interference with others, you can wind up in deep yogurt with your country's equivalent of the US FCC.

  2. If you're asking about this because your Wi-Fi "doesn't work well enough", be sure to eliminate other reasons for bad performance:

  • Avoid interference from your neighbor's router. Do do this, get an app that does a wireless survey. I always use Wi-Fi Analyzer by farproc on Android. It shows all the routers in the area, their channels and signal strengths.
  • Knowing about nearby routers, pick a channel that has the lowest interference. Use only Channel 1, 6, or 11 on the 2.4GHz band. The 802.11 design only gives those three as non-interfering channels. (That is, channels 2-5, and 7-10 interfere with the three main ones.)
  • Turn off the Wi-Fi on printers etc. if you're not using it.
  • Use the 5 GHz band, if available. This a) has more non-interfering channels, and b) has far fewer access points in the real world.

Good luck!

its like you're suggesting: be dumb, don't experiment

Thanks @richb-hanover, @bladeoner and @psyborg for your responses. It is clear now. Thanks!

Actually, I'm recommending people use science. A few thoughts:

  • Channels 2-5, 7-10 do interfere with each other. Their frequency bands overlap: the laws of physics say that traffic on channel 3 unarguably degrades traffic on its adjacent channels.

  • Professionals know how to minimize interference, and only use 1, 6, 11. If you go to large sites, that's what you'll see.

  • Use a wifi analyzer. If you see your neighbors are already using 1, 6, and 11, then you should consider using 5GHz.

  • I'm all for experimentation, if you can get repeatable, unambiguous results. It's not good enough to say, "Hmmm... It seems better now..." Maybe you've actually made an improvement, but perhaps your neighbor has just stepped away from the keyboard...

  • Do you have a good way to test Wi-Fi performance? Thanks.

use iperf to test performance

I know about iperf. But I'd like to learn more about how you would use it to help someone determine if their wifi was better or worse after making a change.

  • How do you invoke the test?
  • What host/server do you test against?
  • How would you determine that one test run was better than another?

Thanks.

PS I'm asking this sincerely: I would like to find a good test that I could recommend to help others measure their wifi performance.

iperf --help

if you run it on your device it should be 192.168.1.1 by default

higher throughput with less fluctuations