Transmit Power incorrect in snapshot
Describe the bug
I believe with the recent iwinfo bump in snapshot, txpower is incorrect in Luci's wireless dropdowns - This issue was reported for Xiaomi AX6 and AX3600, but likely impacts others as well.
Pinging @Ansuel for awareness.
OpenWrt version
r21917-cfb296b79a and remains at r21956-d02d455678
OpenWrt target/subtarget
ipq807x/generic
Device
Xiaomi AX3600
Image kind
Official downloaded image
Steps to reproduce
Wireless txpower dropdown, or
iwinfo phy2 txpowerlist which outputs --> 255 dBm (2147483647 mW)
Actual behaviour
Incorrect TX Power being shown (and used?)
Expected behaviour
Correct TX Powers should be listed and used.
Additional info
opkg list|grep -e iwinfo -e rpcd bmx7-iwinfo - 7.1.1-5 - link characteristics plugin via libiwinfo (recommended!) collectd-mod-iwinfo - 5.12.0-42 - libiwinfo wireless statistics plugin iwinfo - 2023-01-23-1e4e709d-1 - Command line frontend for the wireless information library. libiwinfo-data - 2023-01-23-1e4e709d-1 - libiwinfo Lua binding libiwinfo-lua - 2023-01-23-1e4e709d-1 - This is the Lua binding for the iwinfo library. It provides access to all enabled backends. libiwinfo20230121 - 2023-01-23-1e4e709d-1 - Wireless information library with simplified API for nl80211 and wext driver interfaces. rpcd - 2023-01-21-c0df2a7a-2 - This package provides the UBUS RPC backend server to expose various functionality to frontend programs via JSON-RPC. rpcd-mod-file - 2023-01-21-c0df2a7a-2 - Provides ubus calls for file and directory operations. rpcd-mod-iwinfo - 2023-01-21-c0df2a7a-2 - Provides ubus calls for accessing iwinfo data. rpcd-mod-luci - 20210614-2 - Provides LuCI backend ubus RPC operations. rpcd-mod-lxc - 20201208 - LXC rpcd module rpcd-mod-rad2-enc - 20190109 - Python3 password hashing module for use Radicale 2.x LuCI app rpcd-mod-rpcsys - 2023-01-21-c0df2a7a-2 - Provides ubus calls for sysupgrade and password changing. rpcd-mod-rrdns - 20170710 - Provides rapid mass reverse DNS lookup functionality. rpcd-mod-ucode - 2023-01-21-c0df2a7a-2 - Allows implementing plugins using ucode scripts. zabbix-extra-wifi - 6.2.3-3 - An extra package for zabbix-agentd that adds a discovery rule for wifi interfaces and many userparameters. As it uses libiwinfo, it works with all wifi devices supported by openwrt. See https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use zabbix templates.
Diffconfig
No response
Terms
- [X] I am reporting an issue for OpenWrt, not an unsupported fork.
can't repro. Are you using auto for txpower?
Have not changed any wireless settings since it last worked. As it stands my settings are below. In short, I'm not using driver default (choosing to lower txpower); Despite what's noted below, the UI is showing TX power as follows:
phy1:
Maximum transmit power: 28 dBm
Current power: 28 dBm
phy2:
Maximum transmit power: driver default (I assume because my value from config isn't in dropdown due to this issue)
Current power: 24 dBm
wireless configuration:
config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/soc/c000000.wifi'
option band '5g'
option htmode 'HE80'
option country 'US'
option cell_density '0'
option txpower '28'
option channel '40'`
config wifi-device 'radio2'
option type 'mac80211'
option path 'platform/soc/c000000.wifi+1'
option band '2g'
option country 'US'
option cell_density '0'
option channel '1'
option htmode 'HT20'
option txpower '24'
(radio0 is disabled).
The iwinfo for the active radios:
iwinfo phy1 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
4 dBm ( 2 mW)
5 dBm ( 3 mW)
6 dBm ( 3 mW)
7 dBm ( 5 mW)
8 dBm ( 6 mW)
9 dBm ( 7 mW)
10 dBm ( 10 mW)
11 dBm ( 12 mW)
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)
iwinfo phy2 txpowerlist
255 dBm (2147483647 mW)
phy1 ESSID: unknown
Access Point: THE MAC ADDReSS
Mode: Master Channel: 40 (5.200 GHz) HT Mode: HE80
Center Channel 1: 42 2: unknown
Tx-Power: 28 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11ac/ax/n
Hardware: embedded [Qualcomm Atheros IPQ8074]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy1
iwinfo phy2 info
phy2 ESSID: unknown
Access Point: THE MAC ADDRESS
Mode: Master Channel: 40 (5.200 GHz) HT Mode: HE80
Center Channel 1: 42 2: unknown
Tx-Power: 28 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11ax/b/g/n
Hardware: embedded [Qualcomm Atheros IPQ8074]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy2
The "good" news is that others in the AX3600 thread are experiencing it as well. :) One user noted that reboots cause his issue to jump between radios...
Adding note: This is no longer a self compile, but rather ASU build.
Hmmm.... Not an IPQ807 device, but having updated an AX6S (mediatek/mt7622), I notice that the AX antenna on that device is also "changed" the txpower values it is showing with no other changes. In this case I had set the txpower to 25 (and it is as such in the config), but the iwinfo (and dropdown) only show up to a max of 23.
I had downloaded an ASU binary "openwrt-2fe996eaeb8a-mediatek-mt7622-xiaomi_redmi-router-ax6s-squashfs-sysupgrade.bin" dated January 12th, which I just reverted back to on the AX6S, and things are back to "normal"... e.g. txpower up to 27 is shown in the dropdown, and my value of 25 is obviously there and selected.
Hmmm... A finding on my AX3600. If I type the iwinfo commands as:
iwinfo phy2-ap0 txpowerlist
instead of using the phy name
iwinfo phy2 txpowerlist
I get back a more sane list (not just 255). I am guessing behavior with iwinfo has changed?
The output in my posts above shows the output with "iwinfo phyX txpowerlist" The below is with "phyX-ap0" -- note that "phy1-ap0" didn't change it's values as compared to "phy1":
iwinfo phy1-ap0 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
4 dBm ( 2 mW)
5 dBm ( 3 mW)
6 dBm ( 3 mW)
7 dBm ( 5 mW)
8 dBm ( 6 mW)
9 dBm ( 7 mW)
10 dBm ( 10 mW)
11 dBm ( 12 mW)
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)
iwinfo phy2-ap0 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
4 dBm ( 2 mW)
5 dBm ( 3 mW)
6 dBm ( 3 mW)
7 dBm ( 5 mW)
8 dBm ( 6 mW)
9 dBm ( 7 mW)
10 dBm ( 10 mW)
11 dBm ( 12 mW)
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)
Last update unless you have any questions @Ansuel
I did a compare on my AX6S (mediatek) as well. Clearly difference in outputs (e.g. MAC not shown, power, channels, etc etc) between the two versions based on input. This is likely the root cause:
Updated iwinfo (LuCI Master (git-23.013.73089-9634086) / OpenWrt SNAPSHOT (r21956-d02d455678) )
iwinfo wl1 info
wl1 ESSID: unknown
Access Point: 00:00:00:00:00:00 <-- MAC SHOWN AS ZEROS
Mode: Unknown Channel: unknown (unknown) HT Mode: HT20
Center Channel 1: unknown 2: unknown
Tx-Power: unknown Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11ac/ax/n
Hardware: 14C3:7915 14C3:7915 [MediaTek MT7915E]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: wl1
iwinfo wl1-ap0 info
wl1-ap0 ESSID: "RT1"
Access Point: 8C:DE:XX:XX:XX:XX <-- ACTUAL MAC IS SHOWN
Mode: Master Channel: 149 (5.745 GHz) HT Mode: HE80
Center Channel 1: 155 2: unknown
Tx-Power: 27 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA2 PSK (CCMP)
Type: nl80211 HW Mode(s): 802.11ac/ax/n
Hardware: 14C3:7915 14C3:7915 [MediaTek MT7915E]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: wl1
iwinfo wl1 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
4 dBm ( 2 mW)
5 dBm ( 3 mW)
6 dBm ( 3 mW)
7 dBm ( 5 mW)
8 dBm ( 6 mW)
9 dBm ( 7 mW)
10 dBm ( 10 mW)
11 dBm ( 12 mW)
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)
iwinfo wl1-ap0 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
4 dBm ( 2 mW)
5 dBm ( 3 mW)
6 dBm ( 3 mW)
7 dBm ( 5 mW)
8 dBm ( 6 mW)
9 dBm ( 7 mW)
10 dBm ( 10 mW)
11 dBm ( 12 mW)
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)
Previous iwinfo ( LuCI Master (git-22.361.69865-deed682) / OpenWrt SNAPSHOT (r21775-c83dbcdf8f)
iwinfo wl1 info
wl1 ESSID: unknown
Access Point: D4:35:XX:XX:XX:XX <-- ACTUAL MAC IS SHOWN
Mode: Master Channel: 149 (5.745 GHz) HT Mode: HE80
Center Channel 1: 155 2: unknown
Tx-Power: 25 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11ac/ax/n
Hardware: 14C3:7915 14C3:7915 [MediaTek MT7915E]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: wl1
iwinfo wl1-ap0 info
wl1-ap0 ESSID: "RT1"
Access Point: D4:35:XX:XX:XX:XX <-- ACTUAL MAC IS SHOWN
Mode: Master Channel: 149 (5.745 GHz) HT Mode: HE80
Center Channel 1: 155 2: unknown
Tx-Power: 25 dBm Link Quality: unknown/70
Signal: unknown Noise: -92 dBm
Bit Rate: unknown
Encryption: WPA2 PSK (CCMP)
Type: nl80211 HW Mode(s): 802.11ac/ax/n
Hardware: 14C3:7915 14C3:7915 [MediaTek MT7915E]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: wl1
iwinfo wl1 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
4 dBm ( 2 mW)
5 dBm ( 3 mW)
6 dBm ( 3 mW)
7 dBm ( 5 mW)
8 dBm ( 6 mW)
9 dBm ( 7 mW)
10 dBm ( 10 mW)
11 dBm ( 12 mW)
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)
iwinfo wl1-ap0 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
4 dBm ( 2 mW)
5 dBm ( 3 mW)
6 dBm ( 3 mW)
7 dBm ( 5 mW)
8 dBm ( 6 mW)
9 dBm ( 7 mW)
10 dBm ( 10 mW)
11 dBm ( 12 mW)
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)
Hmmm... A finding on my AX3600. If I type the iwinfo commands as:
iwinfo phy2-ap0 txpowerlist...
Great finding! Same here!
root@wrt-patric:~# iwinfo phy1 txpowerlist
255 dBm (2147483647 mW)
root@wrt-patric:~# iwinfo phy1-ap0 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
4 dBm ( 2 mW)
5 dBm ( 3 mW)
6 dBm ( 3 mW)
7 dBm ( 5 mW)
8 dBm ( 6 mW)
9 dBm ( 7 mW)
10 dBm ( 10 mW)
11 dBm ( 12 mW)
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)
I changed it now with:
uci set wireless.radio1.txpower=20
uci commit
/etc/init.d/network restart
But with every luci change to a linked wireless net, it gets changed back to 30dBm!
That's what it looks in luci:

And for both of my Xiaomi AX 3600 it's only phy1 (5GHz). For phy2 (2.4GHz) is the same as phy2-ap0, and so it's correct in luci as well for phy2:
root@wrt-wohnen:~# iwinfo phy2 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
[...]
root@wrt-wohnen:~# iwinfo phy2-ap0 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
[...]
root@wrt-wohnen:~# iwinfo phy1 txpowerlist
255 dBm (2147483647 mW)
root@wrt-wohnen:~# iwinfo phy1-ap0 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
3 dBm ( 1 mW)
[...]
The snapshot version is useless with asu, unfortunately. Just to excludes other commits like kernel bumps etc, if you use snapshots where TX power works, and then only opkg udate the iwinfo package, does it stop working then too?
Silly, but what catches the eye that you all have dashes in the ifname, does it work when removing that? Maybe even phy too, trying ap0 instead of phy1-ap0 may be worth a try
Please post the output of for i in /sys/class/ieee80211/phy*/device/net/*; do echo $i; cat $i/ifindex $i/link_mode; done
root@wrt-wohnen:~# for i in /sys/class/ieee80211/phy*/device/net/*/ifindex; do echo $i; cat $i; done
/sys/class/ieee80211/phy0/device/net/phy0-ap0/ifindex
20
/sys/class/ieee80211/phy1/device/net/phy1-ap0/ifindex
22
/sys/class/ieee80211/phy1/device/net/phy1-ap1/ifindex
24
/sys/class/ieee80211/phy1/device/net/phy1-ap2/ifindex
25
/sys/class/ieee80211/phy1/device/net/phy2-ap0/ifindex
21
/sys/class/ieee80211/phy1/device/net/phy2-ap1/ifindex
23
/sys/class/ieee80211/phy2/device/net/phy1-ap0/ifindex
22
/sys/class/ieee80211/phy2/device/net/phy1-ap1/ifindex
24
/sys/class/ieee80211/phy2/device/net/phy1-ap2/ifindex
25
/sys/class/ieee80211/phy2/device/net/phy2-ap0/ifindex
21
/sys/class/ieee80211/phy2/device/net/phy2-ap1/ifindex
23
I guess that explains it, why's the same net linked for multiple phys? You have e.g. phy1-ap0 under phy1 and phy2. @Ansuel any idea? looks like a phy0 -> 1/2 child hierarchy?
@PPP01 how about for i in /sys/class/ieee80211/phy*/device/net/*; do echo $i; cat $i/ifindex $i/phy80211/index $i/link_mode; done?
For testing i removed all wireless networks and added only one to radio1 (phy1-ap0):

Now it looks like that:
root@wrt-wohnen:~# for i in /sys/class/ieee80211/phy*/device/net/*; do echo $i; cat $i/ifindex $i/phy80211/index $i/link_mode; done
/sys/class/ieee80211/phy1/device/net/phy1-ap0
31
1
0
/sys/class/ieee80211/phy2/device/net/phy1-ap0
31
1
0
And at radio1 I have all Power options now. But when I add a wireless network to radio2, its 255db now
And now i disabled phy1-ap0 and iwinfo phy2 txpowerlist shows the whole power list:
root@wrt-wohnen:~# iwinfo phy1 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
[...]
root@wrt-wohnen:~# iwinfo phy2 txpowerlist
0 dBm ( 1 mW)
1 dBm ( 1 mW)
2 dBm ( 1 mW)
[...]
When i enable phy1-ap0 again, "iwinfo phy2 txpowerlist" shows the 255dBm Option only
Are you able to test a patch? You can git am this on the openwrt clone:
[removed]
I am new to OpenWRT, but I will try later.