Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignored txpower offset on Ubiquiti NanoStation M2 #94

Open
T-X opened this issue Apr 12, 2014 · 26 comments
Open

ignored txpower offset on Ubiquiti NanoStation M2 #94

T-X opened this issue Apr 12, 2014 · 26 comments
Labels
0. type: bug This is a bug 3. topic: hardware Topic: Hardware Support 9. meta: known issue Known issue which should be mentioned in release notes 9. meta: upstream issue Issue pertains to an upstream project

Comments

@T-X
Copy link
Contributor

T-X commented Apr 12, 2014

It seems that the 12 dBi antenna of the Ubiquiti NanoStation M2 is properly set in the firmware, at least a 12dB txpower offset is noted in iwinfo. However, the txpower is not reduced accordingly:

$ iwinfo
wlan0     ESSID: "luebeck.freifunk.net"
          Access Point: 24:A4:3C:AC:F4:AC
          Mode: Master  Channel: 1 (2.412 GHz)
          Tx-Power: 30 dBm  Link Quality: 40/70
          Signal: -70 dBm  Noise: -89 dBm
          Bit Rate: 43.6 MBit/s
          Encryption: none
          Type: nl80211  HW Mode(s): 802.11bgn
          Hardware: 168C:002A 0777:E012 [Ubiquiti NanoStation M2]
          TX power offset: 12 dB
          Frequency offset: none
          Supports VAPs: yes

wlan0-1   ESSID: "02:d1:11:37:fc:38"
          Access Point: 02:D1:11:37:FC:38
          Mode: Ad-Hoc  Channel: 1 (2.412 GHz)
          Tx-Power: 30 dBm  Link Quality: 69/70
          Signal: -41 dBm  Noise: -89 dBm
          Bit Rate: 102.3 MBit/s
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11bgn
          Hardware: 168C:002A 0777:E012 [Ubiquiti NanoStation M2]
          TX power offset: 12 dB
          Frequency offset: none
          Supports VAPs: yes

The "Tx-Power" field seems to include the tx power offset (https://dev.openwrt.org/browser/branches/attitude_adjustment/package/iwinfo/src/iwinfo_cli.c?rev=36121#L433). However it should say "Tx-Power: 20 dBm".

The reg domain is set correctly, too:

$ iw reg get
country DE:
        (2400 - 2483 @ 40), (N/A, 20)
        (5150 - 5250 @ 80), (N/A, 20), NO-OUTDOOR
        (5250 - 5350 @ 80), (N/A, 20), NO-OUTDOOR, DFS
        (5470 - 5725 @ 80), (N/A, 27), DFS
        (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
$ iwinfo wlan0-1 txpowerlist
  12 dBm (  15 mW)
  13 dBm (  19 mW)
  14 dBm (  25 mW)
  15 dBm (  31 mW)
  16 dBm (  39 mW)
  17 dBm (  50 mW)
  18 dBm (  63 mW)
  19 dBm (  79 mW)
  20 dBm ( 100 mW)
  21 dBm ( 125 mW)
  22 dBm ( 158 mW)
  23 dBm ( 199 mW)
  24 dBm ( 251 mW)
  25 dBm ( 316 mW)
  26 dBm ( 398 mW)
  27 dBm ( 501 mW)
  28 dBm ( 630 mW)
  29 dBm ( 794 mW)
* 30 dBm (1000 mW)
@T-X T-X added the bug label Apr 12, 2014
@ohrensessel
Copy link
Contributor

Is there a fix for this bug on the horizon? Or is this an openwrt issue?

@tcatm
Copy link

tcatm commented Jun 9, 2014

All OpenWRT builds for Ubiquiti devices are affected so it would be best to fix it upstream.

@ohrensessel
Copy link
Contributor

is there an openwrt bug report already or should we create one?

@T-X
Copy link
Contributor Author

T-X commented Jun 9, 2014

Sorry, had forgotten to forward it to OpenWRT, here it is now: https://dev.openwrt.org/ticket/16744

@corny
Copy link
Contributor

corny commented Jun 19, 2014

This problem does also appear on my Ubiquiti PicoStation M2. Probably more Ubiquiti devices are affected.

@neocturne neocturne added this to the 2014.3 milestone Jul 2, 2014
@tcatm tcatm added the upstream label Jul 11, 2014
@neocturne neocturne modified the milestones: 2014.3, 2014.4 Jul 29, 2014
@neocturne neocturne modified the milestones: 2015.1, 2014.4 Dec 14, 2014
@tcatm
Copy link

tcatm commented Feb 16, 2015

Upstream has changed the issue to "wontfix" a few days ago. Any suggestions on what do to next?

@ohrensessel
Copy link
Contributor

bekommen wir das nicht gelöst, in dem wir $irgendwie für die betroffenen geräte die sendeleistung manuell festlegen, ohne uns auf upstream zu verlassen?

ähnlich zu https://github.com/freifunk-gluon/gluon/wiki/Commandline-administration#sendeleistung-auf-nanostation-m2

@tcatm
Copy link

tcatm commented Feb 19, 2015

Wenn wir das tun, können wir den Patch auch gleich Upstream einreichen. Im Endeffekt läuft es ja wirklich nur auf eine Liste mit den Verstärkungsfaktoren der Geräte hinaus.

@neocturne
Copy link
Member

Such a list does exist in libiwinfo (although entries for many Ubiquiti devices are missing at the moment).

We'd just need to think of a nice way to use this list for the default settings.

@neocturne
Copy link
Member

I've added some updated offsets for the NanoStation M2, M5 and Loco M2. The txpower offsets should be included in the values in the new wifi-config LuCI module, so hopefully those values are accurate now. In particular, the NanoStation M5 value was updated from 5 to 16 dBi.

Please test if the new values make any sense; if they do, we might start to think about ways to base the default txpower setting on them.

@neocturne
Copy link
Member

Okay, I've found a way to set the correct txpower offsets by default. Still, we need to find out what the correct offsets are.

The current data file can be found at: http://git.openwrt.org/?p=project/iwinfo.git;a=blob;f=hardware.txt;h=4cac0a1258e266e6d2f5de0f601274f3cd11e31a;hb=HEAD

As you can see, only a few devices of the Airmax series have txpower offsets defined. The hardware IDs (the first 4 columns) can be found out using the iwinfo command.

We will need the correct offsets for the following devices:

  • NanoStation
  • NanoStation Loco
  • PicoStation
  • M2/M5, XM/XW for all of these if they exist
  • Other variants like Ti?

The bullet and the rocket are a bit special as they don't come with an antenna, but getting the offsets between AirOS and OpenWrt with the same antenna would be interesting here too.

We are not sure if the offsets are just antenna gain, or if there is an additional offset. The most effective way to determine this offset is setting the device to maximum power on OpenWrt while measuring the received signal on another device, and then repeating this from AirOS, setting the same power that iwinfo reported on OpenWrt. The difference between the measured signal levels is the offset.

To get the best results, the test setup should be as reproducible as possible, but it is also advisable to repeat this test with different setups and at different times.

@rotanid
Copy link
Member

rotanid commented Mar 14, 2016

hierzu gekürztes Zitat aus dem IRC-Channel vom 4. März:

01:25 < rotanid> also eine NSM2 mit firmware 5.6.3 zeigt im webinterface bei germany an 9dbm max. leistung, 11dbi antenne. aus einer messposition hat das smartphone -20dbm angezeigt
01:25 < rotanid> mit gluon 2016.1.1 zeigt das smartphone an der selben Position -8dBm an
01:27 < rotanid> iwinfo sagt: Tx-Power: 29 dBm, TX power offset: 11 dB
[...]
01:29 @neoraider Was sagt denn iwinfo txpowerlist als unterstützte Werte? Und welche Regdom hast du eingestellt?
01:29 < rotanid> 11 bis 29 werden aufgelistet, regdom DE ist eingestellt
01:32 @neoraider Okay, dann sind die da schon drin, und die 11 bis 29 entsprechen 0 bis 18 als tatsächliche Einstellung der WLAN-Karte, vermute ich
[...]
01:34 @neoraider Ok, dann kommt das Offest von 12, was OpenWrt da hat, ja sogar besser hin als die 11, die wir in Gluon benutzen. Aber zumindest liegen beide Werte nicht völlig daneben
01:36 @neoraider Vielleicht.
01:36 @neoraider Andererseits würden die 11 der Antenne entsprechen.

@yanosz
Copy link
Contributor

yanosz commented Mar 22, 2016

I do have access to some hardware at our hackerspace, but no idea how to measure the correct(!) offset - can I help somehow?

I'm somewhat missing details on that issue - all is very confusing.

And there are some bugs:

Are you aware of any errata page, here? What is your proposal for operating Ubnt-HW using OpenWRT.

Thanks,
yanosz

@rotanid
Copy link
Member

rotanid commented Apr 4, 2016

da wurde auch schon ein wenig dokumentiert zu dem Thema, fand ich gerade:
https://www.freifunk-gera-greiz.de/wiki/-/wiki/Allgemein/Sendeleistung

@DaCHRIS
Copy link

DaCHRIS commented Apr 4, 2016

Rocket M2 only shows up ('iw list') with 18dbm on all channels instead of 28dbm.

                Frequencies:
                        * 2412 MHz [1] (18.0 dBm)
                        * 2417 MHz [2] (18.0 dBm)
                        * 2422 MHz [3] (18.0 dBm)
                        * 2427 MHz [4] (18.0 dBm)
                        * 2432 MHz [5] (18.0 dBm)
                        * 2437 MHz [6] (18.0 dBm)
                        * 2442 MHz [7] (18.0 dBm)
                        * 2447 MHz [8] (18.0 dBm)
                        * 2452 MHz [9] (18.0 dBm)
                        * 2457 MHz [10] (18.0 dBm)
                        * 2462 MHz [11] (18.0 dBm)
                        * 2467 MHz [12] (18.0 dBm)
                        * 2472 MHz [13] (18.0 dBm)
                        * 2484 MHz [14] (disabled)

@neocturne neocturne modified the milestones: next, 2016.2 Sep 17, 2016
@SvenRoederer
Copy link
Contributor

@neocturne neocturne modified the milestones: 2016.3, next Dec 18, 2016
@neocturne neocturne modified the milestones: next, 2017.1 Feb 8, 2017
@rotanid rotanid added the 9. meta: known issue Known issue which should be mentioned in release notes label Jun 5, 2018
@rotanid rotanid removed this from the next milestone Mar 9, 2019
@CodeFetch
Copy link
Contributor

CodeFetch commented Mar 15, 2019

@NeoRaider Here are the power offsets. Ubiquity seems to ignore the device ID. I think some of the existing OpenWrt entries are wrong and I assume that they do not contain the antenna gains as equal boards used in products with different antennas have the same offsets. These values seem to be PA values.

0x168c 0xffff 0x0777 0xe002    6  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe003    3  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe005    5  "Ubiquity" "airOS XM" /* e.g. NanoStation M5 */
0x168c 0xffff 0x0777 0xe006    5  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe009    6  "Ubiquity" "airOS XM" /* e.g. NanoStation Loco M9 */
0x168c 0xffff 0x0777 0xe012   10  "Ubiquity" "airOS XM" /* e.g. NanoStation M2 */
0x168c 0xffff 0x0777 0xe035    3  "Ubiquity" "airOS XM" /* e.g. NanoStation M3 */
0x168c 0xffff 0x0777 0xe0a2    2  "Ubiquity" "airOS XM" /* e.g. NanoStation Loco M2*/
0x168c 0xffff 0x0777 0xe0a5    1  "Ubiquity" "airOS XM" /* e.g. NanoStation Loco M5 */
0x168c 0xffff 0x0777 0xe102    6  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe105    5  "Ubiquity" "airOS XM" /* e.g. Rocket M5 */
0x168c 0xffff 0x0777 0xe112   10  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe115    3  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe1a3    3  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe1a5    5  "Ubiquity" "airOS XM" /* e.g. PowerBridge M5 */
0x168c 0xffff 0x0777 0xe1b2   10  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe1b3    3  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe1b5    5  "Ubiquity" "airOS XM" /* e.g. Rocket M5 */
0x168c 0xffff 0x0777 0xe1b6    5  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe1b9    6  "Ubiquity" "airOS XM" /* e.g. Rocket M9 */
0x168c 0xffff 0x0777 0xe1c2   10  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe1c3    3  "Ubiquity" "airOS XM" /* e.g. Rocket M3 */
0x168c 0xffff 0x0777 0xe1c5    5  "Ubiquity" "airOS XM" /* e.g. Rocket M5 GPS */
0x168c 0xffff 0x0777 0xe1c5    5  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe1d2   10  "Ubiquity" "airOS XM/XW" /* e.g. Rocket M2 Titanium */
0x168c 0xffff 0x0777 0xe1d3    3  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe1d5    5  "Ubiquity" "airOS XM/XW"
0x168c 0xffff 0x0777 0xe1d9    6  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe1e3    3  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe1e5    5  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe202   12  "Ubiquity" "airOS XM" /* e.g. Bullet M2 */
0x168c 0xffff 0x0777 0xe205    6  "Ubiquity" "airOS XM" /* e.g. Bullet M5 */
0x168c 0xffff 0x0777 0xe212    1  "Ubiquity" "airOS XM" /* e.g. AirGrid M2 */
0x168c 0xffff 0x0777 0xe215    1  "Ubiquity" "airOS XM" /* e.g. AirGrid M5 */
0x168c 0xffff 0x0777 0xe232    2  "Ubiquity" "airOS XM" /* e.g. NanoBridge M2 */
0x168c 0xffff 0x0777 0xe233    3  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe235    1  "Ubiquity" "airOS XM" /* e.g. NanoBridge M5 */
0x168c 0xffff 0x0777 0xe239    6  "Ubiquity" "airOS XM" /* e.g. NanoBridge M9 */
0x168c 0xffff 0x0777 0xe242    9  "Ubiquity" "airOS XM" /* e.g. AirGrid M2 HP */
0x168c 0xffff 0x0777 0xe243    3  "Ubiquity" "airOS XM" /* e.g. NanoBridge M3 */
0x168c 0xffff 0x0777 0xe245    6  "Ubiquity" "airOS XM" /* e.g. AirGrid M5 HP */
0x168c 0xffff 0x0777 0xe252    9  "Ubiquity" "airOS XM" /* e.g. AirGrid M2 HP */
0x168c 0xffff 0x0777 0xe255    6  "Ubiquity" "airOS XM" /* e.g. AirGrid M5 HP */
0x168c 0xffff 0x0777 0xe2a3    3  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe2a5    5  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe2b2   10  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe2b5    1  "Ubiquity" "airOS XM" /* e.g. NanoBridge M5 */
0x168c 0xffff 0x0777 0xe2b9    6  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe2c2   10  "Ubiquity" "airOS XW" /* e.g. NanoBeam M2 Int. */
0x168c 0xffff 0x0777 0xe2c3    6  "Ubiquity" "airOS XW" /* e.g. Bullet M2 XW */
0x168c 0xffff 0x0777 0xe2c4    6  "Ubiquity" "airOS XW"
0x168c 0xffff 0x0777 0xe2d2   12  "Ubiquity" "airOS XM" /* e.g. Bullet M2 Titanium HP */
0x168c 0xffff 0x0777 0xe2d4    6  "Ubiquity" "airOS XW"
0x168c 0xffff 0x0777 0xe2d5    6  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe2e5    4  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe302   12  "Ubiquity" "airOS XM" /* e.g. PicoStation M2 */
0x168c 0xffff 0x0777 0xe305    6  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe345    6  "Ubiquity" "airOS XM" /* e.g. WispStation M5 */
0x168c 0xffff 0x0777 0xe3a5    5  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe3b5    6  "Ubiquity" "airOS XM/XW"
0x168c 0xffff 0x0777 0xe3e5    4  "Ubiquity" "airOS XW" /* e.g. PowerBeam M5 300 XW */
0x168c 0xffff 0x0777 0xe402   10  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe405    1  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe4a2    1  "Ubiquity" "airOS XM" /* e.g. AirRouter */
0x168c 0xffff 0x0777 0xe4a5    1  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe4b2    9  "Ubiquity" "airOS XM" /* e.g. AirRouter HP */
0x168c 0xffff 0x0777 0xe4d5    5  "Ubiquity" "airOS XW" /* e.g. Rocket M5 Titanium */
0x168c 0xffff 0x0777 0xe4e5    4  "Ubiquity" "airOS XW" /* e.g. PowerBeam M5 400 */
0x168c 0xffff 0x0777 0xe5e5    4  "Ubiquity" "airOS XW"
0x168c 0xffff 0x0777 0xe6a2    1  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe6b2    1  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe6b5    5  "Ubiquity" "airOS XW" /* e.g. Rocket M5 XW */
0x168c 0xffff 0x0777 0xe6c2    6  "Ubiquity" "airOS XM"
0x168c 0xffff 0x0777 0xe6e5    4  "Ubiquity" "airOS XW" /* e.g. PowerBeam M5 400 ISO */
0x168c 0xffff 0x0777 0xe7f8    2  "Ubiquity" "airOS XW"
0x168c 0xffff 0x0777 0xe805    5  "Ubiquity" "airOS XM" /* e.g. NanoStation M5, Bullet M5 */
0x168c 0xffff 0x0777 0xe812    6  "Ubiquity" "airOS XW" /* e.g. NanoBeam M2 13 */
0x168c 0xffff 0x0777 0xe815    4  "Ubiquity" "airOS XW" /* e.g. NanoBeam M5 16 */
0x168c 0xffff 0x0777 0xe825    4  "Ubiquity" "airOS XW" /* e.g. NanoBeam M5 19 */
0x168c 0xffff 0x0777 0xe835    6  "Ubiquity" "airOS XW" /* e.g. AirGrid M5 XW */
0x168c 0xffff 0x0777 0xe845    1  "Ubiquity" "airOS XW" /* e.g. NanoStation Loco M5 XW */
0x168c 0xffff 0x0777 0xe855    5  "Ubiquity" "airOS XW" /* e.g. NanoStation M5 XW */
0x168c 0xffff 0x0777 0xe865    6  "Ubiquity" "airOS XW" /* e.g. LiteBeam M5 */
0x168c 0xffff 0x0777 0xe866    6  "Ubiquity" "airOS XW" /* e.g. NanoStation M2 XW */
0x168c 0xffff 0x0777 0xe867    2  "Ubiquity" "airOS XW" /* e.g. NanoStation Loco M2 XW */
0x168c 0xffff 0x0777 0xe868    7  "Ubiquity" "airOS XW" /* e.g. Rocket M2 XW */
0x168c 0xffff 0x0777 0xe869    2  "Ubiquity" "airOS XW"
0x168c 0xffff 0x0777 0xe875    4  "Ubiquity" "airOS XW"
0x168c 0xffff 0x0777 0xe879    2  "Ubiquity" "airOS XW"
0x168c 0xffff 0x0777 0xe885    4  "Ubiquity" "airOS XW" /* e.g. PowerBeam M5 620 XW */
0x168c 0xffff 0x0777 0xe895    4  "Ubiquity" "airOS XW"
0x168c 0xffff 0x0777 0xe8a5    1  "Ubiquity" "airOS XM" /* e.g. NanoStation Loco M5 */
0x168c 0xffff 0x0777 0xe8b5    5  "Ubiquity" "airOS XM"

Edit:
Unfortunately I haven't found the definitions for the antenna gain, yet... But I'm pretty sure that the power offsets don't include the antenna gains. If someone sends me a dump of the ART partition of one of the following devices, I'll look whether the antenna gain is defined there.
Antenna gains:

AirGrid M5 AG5G23 23 dBi
AirGrid M5 AG5G27 27dBi
AirRouter HP 6 dBi
NanoBeam M2 NBE-M2-13 13 dBi
NanoBeam M5 NBE-M5-16 16 dBi
NanoBeam M5 NBE-M5-19 19 dBi
NanoBridge M2 NB-2G18 22 dBi
NanoBridge M3 NBM365 22 dBi
NanoBridge M5 NBM5-22 22 dBi
NanoBridge M5 NB-5G22-US 22 dBi
NanoBridge M9 NBM9 13 dBi
NanoStation Loco M2 9 dBi
NanoStation Loco M5 13 dBi
NanoStation M2 11 dBi
NanoStation M5 16 dBi
PowerBeam M5 PBE-M5-300 300 22 dBi
PowerBeam M5 PBE-M5-400 400 25 dBi
PowerBeam M5 PBE-M5-620 620 29 dBi

@CodeFetch
Copy link
Contributor

@rotanid Can you please add it to the 2019.1 milestone and pin the issue? I'd be happy about a Gluon-specific solution. With the knowledge of the antenna gains and the power offsets, we can write a package that sets the proper values respecting EIRP and a site.conf option to reset existing custom values.

I've submitted the patch:
https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg45730.html

@rotanid
Copy link
Member

rotanid commented Mar 18, 2019

you can work on this issue without the things you request, and help is welcome.
these would mean, that this is high priority, which it isn't for us.

@CodeFetch
Copy link
Contributor

CodeFetch commented Mar 18, 2019

@rotanid The possibility that we have devices running with more than 10 times the allowed EIRP even if you manually decrease the tx-power by the antenna gain does not deserve high priority?

Edit: The "real" EIRP is EIRP=TXPower+Ath9kTXOffset+Ath9kAntennaGain+(PAGain or TXOffset)+(AntennaGain if it is not included in Ath9kTXOffset or Ath9kAntennaGain)

There is a program to dump the ath9k values from a ART-partition dump https://github.com/pepe2k/ar9300_eeprom . Unfortunately it does not yet support the offsets used by Ubiquiti. I'm currently looking into the ath9k sources to try to fix it. TP-Link defines the antenna and PA-Gains in the TX-Offset field. Thus we did never have problems with those devices.

I assume that Ubiquiti does similar with their antenna gains (although ath9k-ART has a special field for antenna gains). The PA gain however is included in Ubiquiti's firmware for the subvendor device IDs of the chips.

Thus we need to check if the antenna gains are defined in the ART partition. If that is the case, with the patch to the iwinfo hardware.txt, iwinfo gives us the correct values. If not we have to define the antenna gains manually using iw matching the board names.

Still when the WLAN devices' configs are initialized in Gluon in 200-wireless, the iwinfo offsets are not considered at the moment. That means in the worst case if the user has a HP device and the antenna gains are not considered in the ART-partition and he or she does not set the offsets accordingly we may have 100 times the allowed EIRP. If that is the case I wonder that nobody was ever bothered by the BNetzA.

BTW you can read the power offset of a device running stock Ubiquiti firmware in the /proc/ubnthal/board.info or /proc/ubnthal/system.info file (I'm not sure about which was the correct name).

OpenWrt is not really interested in fixing this as iw is a program shipped by the kernel and has no possibility to define such offsets. And linux is not interested in supporting this because they ship drivers for WLAN chipsets, but do not support custom boards with an additional PA chip.

@rotanid
Copy link
Member

rotanid commented Mar 18, 2019

if someone else would have the knowledge and time to fix it, it would have been done long time ago.
so again: a fix is welcome.

@CodeFetch
Copy link
Contributor

The patch has been merged.

Still I need to do some testing whether the antenna gain is defined in the ART partition. If yes, then there is only a simple Gluon upgrade script missing to set the correct TX power on first boot. If no, I need to find out how Ubiquiti does it and maybe add definitions depending on the model names.

@CodeFetch
Copy link
Contributor

CodeFetch commented Jul 12, 2019

A patch for Gluon is on the way, but I really need help to find the missing pieces and identify some Ubiquiti devices (some could be found just by pure logic and good old human pattern recognition).

Please help, solving the puzzle.

To be sure @Adorfer needs to measure a Bullet or Picostation with his power meter with OpenWrt compared to stock firmware.

		'e112' = { -- XM
			pa_gain = 10
		},
		'e115' = { -- XM
			pa_gain = 3
		},
		'e2c4' = { -- XM
			pa_gain = 6
		}
		'e2d4' = { -- XM
			pa_gain = 6
		}
		'e2e5' = { -- XM
			pa_gain = 4
		}
		'e305' = {
			pa_gain = 6
		},
		'e3a5' = { -- XM
			pa_gain = 5
		}
		'e3b5' = { -- XM / XW
			pa_gain = 6
		}
		'e402' = { -- XM
			pa_gain = 10
		}
		'e405' = { -- XM
			pa_gain = 1
		}
		'e4a5' = { -- AirRouter? XM
			pa_gain = 1
		},
		'e5e5' = { -- Powerbeam? XW
			pa_gain = 5
		},
		'e6a2' = { -- XW
			pa_gain = 1
		},
		'e7f8' = { -- XW
			pa_gain = 2
		},
		'e875' = { -- XW
			pa_gain = 4
		},
		'e879' = { -- XW
			pa_gain = 2
		},
		'e895' = { -- Powerbeam M5? XW
			pa_gain = 4
		},
		'e8b5' = {
			pa_gain = 5
		},

		-- NanoStation M2
		-- ERP 28 dBm according to datasheet
		'e002' = { -- ??? (EU?) XM
			pa_gain = 6
			ant_gain = 11
		},
		'e012' = { -- ??? (US?) XM
			pa_gain = 10
			ant_gain = 11
		},
		'e866' = { -- XW
			pa_gain = 6
			ant_gain = 11
		},

		-- NanoStation M3? Loco?
		-- ERP 25 dBm according to datasheet
		'e003' = { -- XM
			pa_gain = 3
			ant_gain = 13
		}
		-- NanoStation M3
		-- ERP 25 dBm according to datasheet
		'e035' = {
			pa_gain = 3
			ant_gain = 13
		}

		-- NanoStation M5
		-- ERP 27 dBm according to datasheet
		'e005' = { -- ??? (EU?) XM
			pa_gain = 5
			ant_gain = 16
		},
		'e805' = { -- ??? (US?) XM
			pa_gain = 5
			ant_gain = 16
		},
		'e855' = { -- XW
			pa_gain = 5
			ant_gain = 16
		},

		-- NanoStation M365?
		-- ERP 25 dBm according to datasheet
		'e006' = { -- XM
			pa_gain = 5
			ant_gain = 13
		}

		-- NanoStation Loco M9 XM
		-- ERP 28 dBm according to datasheet
		'e009' = {
			pa_gain = 6
			ant_gain = 8
		}

		-- NanoStation Loco M2
		-- ERP 23 dBm according to datasheet
		'e0a2' = { -- XM
			pa_gain = 2
			ant_gain = 9
		},
		'e867' = { -- XW
			pa_gain = 2
			ant_gain = 9
		},

		-- NanoStation Loco M5
		-- ERP 23 dBM according to datasheet
		'e0a5' = { -- XM ??? (EU?)
			pa_gain = 1
			ant_gain = 13
		},
		'e8a5' = { -- XM ??? (US?)
			pa_gain = 1
			ant_gain = 13
		},
		'e845' = { -- XW
			pa_gain = 1
			ant_gain = 13
		},

		-- Rocket M2
		-- ERP 28 dBm according to datasheet
		'e102' = { -- ??? (EU?)
			pa_gain = 6
			ant_detach = true
		},
		'e1b2' = { -- HP (US?)
			pa_gain = 10
			ant_detach = true
		},
		'e1c2' = { -- GPS
			pa_gain = 10
			ant_detach = true
		},
		'e1d2' = { -- Titanium
			pa_gain = 10
			ant_detach = true
		},
		'e868' = { -- XW
			pa_gain = 7
			ant_detach = true
		},

		-- Rocket M5
		-- ERP 27 dBm according to datasheet
		'e105' = { -- ??? (EU?)
			pa_gain = 5
			ant_detach = true
		},
		'e1b5' = { -- ??? (US?)
			pa_gain = 5
			ant_detach = true
		},
		'e1c5' = { -- GPS
			pa_gain = 5
			ant_detach = true
		},
		'e1d5' = { -- Titanium
			pa_gain = 5
			ant_detach = true
		},
		'e1e5' = { -- ???
			pa_gain = 5
			ant_detach = true
		},
		'e6b5' = { -- XW
			pa_gain = 5
			ant_detach = true
		},

		-- PowerBridge M3
		-- ERP 25 dBm according to datasheet
		'e1a3' = {
			pa_gain = 3
			ant_gain = 20
		},

		-- PowerBridge M5
		-- ERP 27 dBm according to datasheet
		'e1a5' = {
			pa_gain = 5
			ant_gain = 25
		},

		-- Rocket M3
		-- ERP 25 dBm according to datasheet
		'e1b3' = { -- XM
			pa_gain = 3
			ant_detach = true
		},
		'e1c3' = { -- GPS?
			pa_gain = 3
			ant_detach = true
		},
		'e1d3' = { -- Titanium?
			pa_gain = 3
			ant_detach = true
		},
		'e1e3' = { -- ???
			pa_gain = 3
			ant_detach = true
		},

		-- Rocket M365
		-- ERP 25 dBm according to datasheet
		'e1b6' = { -- XM
			pa_gain = 5
			ant_detach = true
		},

		-- Rocket M900
		-- ERP 28 dBm according to datasheet
		'e1b9' = { -- XM
			pa_gain = 6
			ant_detach = true
		},
		'e1d9' = { -- Titanium?
			pa_gain = 6
			ant_detach = true
		},

		-- Bullet M2
		-- ERP 28 dBm according to datasheet
		'e202' = { -- BM2HP
			pa_gain = 12
			ant_detach = true
		},
		'e2d2' = { -- BM2-Ti (Titanium)
			pa_gain = 12
			ant_detach = true
		},
		'e2c3' = { -- XW
			pa_gain = 6
			ant_detach = true
		},

		-- Bullet M5 XM
		-- ERP 25 dBm according to datasheet
		'e205' = { -- BM5HP
			pa_gain = 6
			ant_detach = true
		},
		'e2d5' = { -- BM5-Ti (Titanium)
			pa_gain = 6
			ant_detach = true
		},

		-- AirGrid M2 XM
		-- FIXME: There must be four versions
		--    (AG-HP-2G16, AG-HP-2G20, AG2G16, AG2G20)
		-- ERP 20 dBm according to datasheet
		-- HP: ERP 28 dBm according to datasheet
		'e212' = {
			pa_gain = 1
			ant_gain = 20
		},

		-- AirGrid M5
		-- FIXME: There must be four versions
		--    (AG-HP-5G23, AG-HP-5G27, AG5G23, AG5G27)
		-- ERP 20 dBm according to datasheet
		-- HP: ERP 25 dBm according to datasheet
		'e215' = { -- XM
			pa_gain = 1
			ant_gain = 27
		},
		'e835' = { -- XW HP?
			pa_gain = 6
			ant_gain = 27
		},

		-- NanoBridge M2 XM 
		-- ERP 23 dBm according to datasheet
		'e232' = { -- NB-2G18?
			pa_gain = 2
			ant_gain = 18
		},
		'e2b2' = { -- ??? (US?)
			pa_gain = 10
			ant_gain = 18
		},

		-- NanoBridge M3
		-- FIXME: There might be a NBM365
		-- ERP 25 dBm according to datasheet
		'e233' = {
			pa_gain = 3
			ant_gain = 22
		},
		'e2a3' = { -- TODO: Check
			pa_gain = 3
			ant_gain = 22
		},

		-- NanoBridge M5 XM
		-- FIXME: One must be NBM5-22 and the other NBM5-25
		-- ERP 23 dBm according to datasheet
		'e235' = {
			pa_gain = 1
			ant_gain = 25
		},
		'e2b5' = {
			pa_gain = 1
			ant_gain = 25
		},

		-- NanoBridge M9?
		-- ERP 28 dBm according to datasheet
		'e2b9' = {
			pa_gain = 6
			ant_gain = 11
		},

		-- PicoStation M2
		-- ERP 28 dBm according to datasheet
		'e302' = { -- ??? (US?)
			pa_gain = 12
			ant_gain = 2 -- FIXME: US has 5 dBi antenna
			ant_detach = true
		},

		-- AirRouter (EU) (XM)
		-- ERP 19 dBm according to datasheet
		'e4a2' = {
			-- This is an important hint as WLAN router
			-- manufacturers often use 1 dBm as safeguard
			-- The WLAN chip's ERP is 20 dBm. 20 - 1 = 19
			-- FIXME: antenna gain unknown
			pa_gain = 1
		},

		-- AirRouter HP (US) (XM)
		-- ERP 28 dBm according to datasheet
		'e4b2' = {
			-- FIXME: antenna gain unknown 
			pa_gain = 9
		},

		-- NanoBeam M2
		-- ERP 28 dBm according to datasheet
		'e2c2' = { -- ???
			-- FIXME: antenna gain unknown
			pa_gain = 10
			ant_gain = 13
		},
		'e812' = { -- NBE-M2-13
			pa_gain = 6
			ant_gain = 13
		},

		-- WispStation M5
		-- ERP 23 dBm according to datasheet
		'e345' = {
			pa_gain = 6
		}

		-- PowerBeam M5
		-- ERP 26 dBm according to datasheet
		'e3e5' = { -- PBE-M5-300
			pa_gain = 4
			ant_gain = 22
		},
		'e4e5' = { -- PBE-M5-400
			pa_gain = 4
			ant_gain = 25
		},
		'e6e5' = { -- PBE-M5-400 ISO!!
			pa_gain = 4
			ant_gain = 25
		},
		'e885' = { -- PBE-M5-620
			pa_gain = 4
			ant_gain = 29
		},

		-- Powerbeam M2 400?
		-- ERP 28 dBm according to datasheet
		'e6c2' = { -- PBE-M2-400
			pa_gain = 6
			ant_gain = 18 dBi
		},

		-- NanoBeam M5
		-- ERP 26 dBm according to datasheet
		'e815' = { -- NBE-M5-16
			pa_gain = 4
			ant_gain = 16
		},
		'e825' = { -- NBE-M5-19
			pa_gain = 4
			ant_gain = 19
		},

		-- LiteBeam M5 (XW)
		-- ERP 25 dBm according to datasheet
		'e865' = { -- LBE-M5-23
			pa_gain = 6
			ant_gain = 23
		},

@Adorfer
Copy link
Contributor

Adorfer commented Jul 12, 2019

To be sure @Adorfer needs to measure a Bullet or Picostation with his power meter with OpenWrt compared to stock firmware.

I do not have one or the other in my hands.
As far as i understand UnifiACmesh will not help, correct?

@CodeFetch
Copy link
Contributor

Unfortunately no, MIMO routers give bad measurements...

SvenRoederer pushed a commit to SvenRoederer/freifunk-gluon_core that referenced this issue Sep 29, 2019
Bandwidth info for qos-scripts and SmartGateway (olsrd) will now be configured
through ffwizard-berlin. This fixes freifunk-gluon#94.
@Djfe
Copy link
Contributor

Djfe commented Feb 5, 2023

I know this topic is probably a sore spot by now.
What is the current state on this:
Does this only affect ath9k?
Or are newer ath10k/ath11k/ramips/mediatek Ubiquiti targets affected as well? (I'm asking because those might handle this stuff in the wireless firmware/blob/whatever)
Is TxPower respected by now (PA gains) and only Antenna gain is missing from the equation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: bug This is a bug 3. topic: hardware Topic: Hardware Support 9. meta: known issue Known issue which should be mentioned in release notes 9. meta: upstream issue Issue pertains to an upstream project
Projects
None yet
Development

No branches or pull requests