Dear community,
Given the MM8108 working on OpenWrt with BCF bcf_mf15457.bin, the TX Power can be modified by iw command. For example, to change the TX power to 10dBm, this is how I do:
iw wlan0 set txpower fixed 1000
Confirm the change with iwinfo
After a power cycle, the TX power comes back to the default value. I wonder if there is way to save the value without running iw command again? This is also important for an external FEM application because we may not want to burn the PA’s input port.
Thanks and regards,
V.
The best way to save the txpower would be to:
- set it in UCI
- add support in morse.sh for setting it on device bring up
To do this:
- modify
/lib/netifd/wireless/morse.sh to add these lines after iw phy “$phy” set frag
if [ -n "$txpower" ]; then
iw phy "$phy" set txpower limit "${txpower%%.*}00"
else
iw phy "$phy" set txpower auto
fi
- set txpower in uci, something like:
uci set wireless.radio0.txpower=10
uci commit
reload_config
This should persist on next boot, which you can validate using iw.
Thanks for pointing this out; leaving out txpower here was an oversight, and will be fixed in our next release.
1 Like
Thank you,
I will try and get back with the result.
Regards,
V.
Hi @james.haggerty, please see my updates below:
Regarding the the morse.sh file, I can not find the directory you mentioned.
root@OpenWrt:/lib# ls -al
drwxr-xr-x 1 root root 3488 Oct 2 02:21 .
drwxr-xr-x 1 root root 3488 Oct 16 14:57 ..
drwxr-xr-x 2 root root 29 Oct 9 19:12 config
drwxr-xr-x 6 root root 91 Oct 9 19:12 firmware
drwxr-xr-x 3 root root 209 Oct 9 19:12 functions
-rw-r–r-- 1 root root 9596 Oct 9 19:12 functions.sh
lrwxrwxrwx 1 root root 7 Oct 9 19:12 ld-musl-aarch64.so.1 → libc.so
lrwxrwxrwx 1 root root 18 Oct 9 19:12 libatomic.so → libatomic.so.1.2.0
lrwxrwxrwx 1 root root 18 Oct 9 19:12 libatomic.so.1 → libatomic.so.1.2.0
-rwxr-xr-x 1 root root 65539 Oct 9 19:12 libatomic.so.1.2.0
-rw-r–r-- 1 root root 65539 Oct 9 19:12 libblobmsg_json.so.20230523
-rwxr-xr-x 1 root root 590849 Oct 9 19:12 libc.so
-rw-r–r-- 1 root root 65906 Oct 9 19:12 libfstools.so
-rw-r–r-- 1 root root 132 Oct 9 19:12 libgcc_s.so
-rw-r–r-- 1 root root 131088 Oct 9 19:12 libgcc_s.so.1
-rw-r–r-- 1 root root 65553 Oct 9 19:12 libjson_script.so.20230523
-rw-r–r-- 1 root root 65539 Oct 9 19:12 libpreload-seccomp.so
-rw-r–r-- 1 root root 65539 Oct 9 19:12 libpreload-trace.so
lrwxrwxrwx 1 root root 22 Oct 9 19:12 libsahtrace.so → libsahtrace.so.v1.14.0
-rwxr-xr-x 1 root root 65545 Oct 9 19:12 libsahtrace.so.v1.14.0
-rw-r–r-- 1 root root 65539 Oct 9 19:12 libsetlbf.so
lrwxrwxrwx 1 root root 19 Oct 9 19:12 libstdc++.so → libstdc++.so.6.0.30
lrwxrwxrwx 1 root root 19 Oct 9 19:12 libstdc++.so.6 → libstdc++.so.6.0.30
-rwxr-xr-x 1 root root 1901035 Oct 9 19:12 libstdc++.so.6.0.30
-rw-r–r-- 1 root root 2568 Oct 9 19:12 libstdc++.so.6.0.30-gdb.py
-rw-r–r-- 1 root root 65617 Oct 9 19:12 libubox.so.20230523
-rw-r–r-- 1 root root 65698 Oct 9 19:12 libubus.so.20230605
-rwxr-xr-x 1 root root 65619 Oct 9 19:12 libuci.so
-rw-r–r-- 1 root root 65539 Oct 9 19:12 libustream-ssl.so
-rw-r–r-- 1 root root 66674 Oct 9 19:12 libvalidate.so
drwxr-xr-x 3 root root 31 Oct 9 19:12 modules
drwxr-xr-x 5 root root 251 Oct 9 19:12 netifd
drwxr-xr-x 2 root root 32 Oct 9 19:12 network
drwxr-xr-x 2 root root 453 Oct 9 19:12 preinit
drwxr-xr-x 1 root root 3488 Oct 2 02:21 upgrade
drwxr-xr-x 2 root root 50 Oct 9 19:12 wifi
I found the same file name, it locates in the wifi sub-folder. I attached the file on the reply in form of text file.
morse.txt (5.7 KB)
I also can not find the frag you mentioned iw phy “$phy” set frag
Regarding the uci commands it seems not to change the power read by the info. I also found that the result of uci get wireless.radio{x}.txpower and iwinfo are inconsistant. Please refer to my log below for further information
root@OpenWrt:/lib# iwinfo
phy1-sta0 ESSID: “Hoa Vu”
Access Point: A0:65:18:13:3B:FB
Mode: Client Channel: 7 (2.442 GHz) HT Mode: HT20
Center Channel 1: 7 2: unknown
Tx-Power: 31 dBm Link Quality: 70/70
Signal: -37 dBm Noise: unknown
Bit Rate: 65.0 MBit/s
Encryption: WPA2 PSK (CCMP)
Type: nl80211 HW Mode(s): 802.11ac/b/g/n
Hardware: 02D0:A9A6 0000:0000 [Cypress CYW43455]
TX power offset: none
Frequency offset: none
Supports VAPs: no PHY name: phy1
wlan0 ESSID: “12345678”
Access Point: D8:3A:DD:8D:07:74
Mode: Mesh Point Channel: 8 (906.000 MHz) HT Mode: HT40
Center Channel 1: 8 2: unknown
Tx-Power: 22 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
wlan1 ESSID: “OpenWrt”
Access Point: 1A:9B:A5:19:0F:02
Mode: Master Channel: 8 (906.000 MHz) HT Mode: HT40
Center Channel 1: 8 2: unknown
Tx-Power: 22 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
root@OpenWrt:/lib# uci set wireless.radio0.txpower=10
root@OpenWrt:/lib# uci set wireless.radio1.txpower=10
root@OpenWrt:/lib# uci commit
root@OpenWrt:/lib# reload_config
root@OpenWrt:/lib# iwinfo
phy1-sta0 ESSID: “Hoa Vu”
Access Point: A0:65:18:13:3B:FB
Mode: Client Channel: 7 (2.442 GHz) HT Mode: HT20
Center Channel 1: 7 2: unknown
Tx-Power: 10 dBm Link Quality: 70/70
Signal: -38 dBm Noise: unknown
Bit Rate: 58.5 MBit/s
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11ac/b/g/n
Hardware: 02D0:A9A6 0000:0000 [Cypress CYW43455]
TX power offset: none
Frequency offset: none
Supports VAPs: no PHY name: phy1
wlan0 ESSID: unknown
Access Point: 18:9B:A5:19:0F:02
Mode: Mesh Point Channel: unknown (unknown) HT Mode: HT20
Center Channel 1: unknown 2: unknown
Tx-Power: 0 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: none
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
wlan1 ESSID: “OpenWrt”
Access Point: 1A:9B:A5:19:0F:02
Mode: Master Channel: unknown (unknown) HT Mode: HT20
Center Channel 1: unknown 2: unknown
Tx-Power: 0 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
root@OpenWrt:/lib# iwinfo
phy1-sta0 ESSID: “Hoa Vu”
Access Point: A0:65:18:13:3B:FB
Mode: Client Channel: 7 (2.442 GHz) HT Mode: HT20
Center Channel 1: 7 2: unknown
Tx-Power: 10 dBm Link Quality: 70/70
Signal: -39 dBm Noise: unknown
Bit Rate: 52.0 MBit/s
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11ac/b/g/n
Hardware: 02D0:A9A6 0000:0000 [Cypress CYW43455]
TX power offset: none
Frequency offset: none
Supports VAPs: no PHY name: phy1
wlan0 ESSID: “12345678”
Access Point: D8:3A:DD:8D:07:74
Mode: Mesh Point Channel: 8 (906.000 MHz) HT Mode: HT40
Center Channel 1: 8 2: unknown
Tx-Power: 22 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
wlan1 ESSID: “OpenWrt”
Access Point: 1A:9B:A5:19:0F:02
Mode: Master Channel: unknown (unknown) HT Mode: HT20
Center Channel 1: unknown 2: unknown
Tx-Power: 0 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
root@OpenWrt:/lib# iwinfo
phy1-sta0 ESSID: “Hoa Vu”
Access Point: A0:65:18:13:3B:FB
Mode: Client Channel: 7 (2.442 GHz) HT Mode: HT20
Center Channel 1: 7 2: unknown
Tx-Power: 10 dBm Link Quality: 70/70
Signal: -38 dBm Noise: unknown
Bit Rate: 52.0 MBit/s
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11ac/b/g/n
Hardware: 02D0:A9A6 0000:0000 [Cypress CYW43455]
TX power offset: none
Frequency offset: none
Supports VAPs: no PHY name: phy1
wlan0 ESSID: “12345678”
Access Point: D8:3A:DD:8D:07:74
Mode: Mesh Point Channel: 8 (906.000 MHz) HT Mode: HT40
Center Channel 1: 8 2: unknown
Tx-Power: 22 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
wlan1 ESSID: “OpenWrt”
Access Point: 1A:9B:A5:19:0F:02
Mode: Master Channel: 8 (906.000 MHz) HT Mode: HT40
Center Channel 1: 8 2: unknown
Tx-Power: 22 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
root@OpenWrt:/lib# iwinfo
phy1-sta0 ESSID: “Hoa Vu”
Access Point: A0:65:18:13:3B:FB
Mode: Client Channel: 7 (2.442 GHz) HT Mode: HT20
Center Channel 1: 7 2: unknown
Tx-Power: 10 dBm Link Quality: 70/70
Signal: -38 dBm Noise: unknown
Bit Rate: 52.0 MBit/s
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11ac/b/g/n
Hardware: 02D0:A9A6 0000:0000 [Cypress CYW43455]
TX power offset: none
Frequency offset: none
Supports VAPs: no PHY name: phy1
wlan0 ESSID: “12345678”
Access Point: D8:3A:DD:8D:07:74
Mode: Mesh Point Channel: 8 (906.000 MHz) HT Mode: HT40
Center Channel 1: 8 2: unknown
Tx-Power: 22 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
wlan1 ESSID: “OpenWrt”
Access Point: 1A:9B:A5:19:0F:02
Mode: Master Channel: 8 (906.000 MHz) HT Mode: HT40
Center Channel 1: 8 2: unknown
Tx-Power: 22 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
root@OpenWrt:/lib# uci get wireless.radio0.txpower
10
root@OpenWrt:/lib# uci get wireless.radio1.txpower
10
root@OpenWrt:/lib#
And iw __ set txpower fixed _ command will always give an effective result read by iwinfo
root@OpenWrt:/lib# iw wlan0 set txpower fixed 1000
root@OpenWrt:/lib# iwinfo
phy1-sta0 ESSID: “Hoa Vu”
Access Point: A0:65:18:13:3B:FB
Mode: Client Channel: 7 (2.442 GHz) HT Mode: HT20
Center Channel 1: 7 2: unknown
Tx-Power: 10 dBm Link Quality: 70/70
Signal: -39 dBm Noise: unknown
Bit Rate: 57.7 MBit/s
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11ac/b/g/n
Hardware: 02D0:A9A6 0000:0000 [Cypress CYW43455]
TX power offset: none
Frequency offset: none
Supports VAPs: no PHY name: phy1
wlan0 ESSID: “12345678”
Access Point: D8:3A:DD:8D:07:74
Mode: Mesh Point Channel: 8 (906.000 MHz) HT Mode: HT40
Center Channel 1: 8 2: unknown
Tx-Power: 10 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
wlan1 ESSID: “OpenWrt”
Access Point: 1A:9B:A5:19:0F:02
Mode: Master Channel: 8 (906.000 MHz) HT Mode: HT40
Center Channel 1: 8 2: unknown
Tx-Power: 10 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: WPA3 SAE (CCMP)
Type: dot11ah HW Mode(s): 802.11ah
Hardware: USB 325B:8100 [Morse Micro USB-MM810x]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
root@OpenWrt:/lib#
Please have a look,
Thanks and regards,
V.
What morse OpenWrt image are you using? As far as I know, all of them should have this file. Are you sure you check the right location? It seems like you’ve listed the /lib directory, which is not that relevant.
root@halowlink1-f4a1:~# ls /lib/netifd/wireless/
mac80211.sh morse.sh
EDIT: my apologies, I realise I switched netifd and wireless. I’ve amended my original message to fix the path.