Cannot set Verdin iMX8M Plus mlan0 tx power to be higher than 8dBm

I am using Verdin iMX8M Plus WB on a custom carrier board. I have followed the Yocto build instructions and compiled a release for my board. Instead of using connmanctl, I am using wpa-supplicant to connect to the router.

I have noticed that the iMX8’s RSSI was less than another MPU, even though they were equal distance from the router. Further debug shows that the Wi-F TX Power was different: iMX8 was 8dBm, and the other MPU was 30dBM.

Below are additional commands that I tried to increase the power. Is there anything else that I can try to increase the tx power?

Confirm that only wpa_supplicant was running

root@crce-imx8-14855176:~# ps | grep conn
 4269 root      3444 S    grep conn
root@crce-imx8-14855176:~# ps | grep wpa
  727 root     12308 S    /usr/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-mlan0.conf -imlan0
  745 root     11596 S    /usr/sbin/wpa_supplicant -u
 4281 root      3444 S    grep wpa

Check the limits, which notes that it should be max 20dBm

root@crce-imx8-14855176:~# iw reg get
global
country 00: DFS-UNSET
(755 - 928 @ 2), (N/A, 20), (N/A), PASSIVE-SCAN
(2402 - 2472 @ 40), (N/A, 20), (N/A)
(2457 - 2482 @ 20), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM, PASSIVE-SCAN
(5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
(5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, PASSIVE-SCAN
(5735 - 5835 @ 80), (N/A, 20), (N/A), PASSIVE-SCAN
(57240 - 63720 @ 2160), (N/A, 0), (N/A)

Check current txpower, and saw that it was 8dBm

root@crce-imx8-14855176:~# iw dev mlan0 info
Interface mlan0
ifindex 7
wdev 0x1
addr 14:13:33:cc:e1:e9
ssid [redacted]
type managed
wiphy 0
channel 11 (2462 MHz), width: 20 MHz (no HT), center1: 2462 MHz
txpower 8.00 dBm

Tried to change the txpower to 16dBm

root@crce-imx8-14855176:~# iw dev mlan0 set txpower fixed 1600
command failed: Operation not permitted (-1)
mwifiex_sdio mmc0:0001:1: txpower value 16 dBm	is out of range (0 dBm-8 dBm)

tdx-info

root@crce-imx8-14855176:~# tdx-info 

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.129-6.4.0-devel+git.67c3153d20ff #1 SMP PREEMPT Wed Sep 27 12:30:36 UTC 2023
Kernel command line:      root=PARTUUID=6f825721-02 ro rootwait console=tty1 console=ttymxc2,115200 consoleblank=0 earlycon
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=6.4.0-devel-20240130165750-build.0
Hostname:                 crce-imx8-14855176
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0058 V1.1A
Serial number:            14855176
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


:handshake:

The issue you’re encountering with setting the TX power on the Verdin iMX8M Plus WB module is likely due to regulatory restrictions or driver limitations. Here are a few steps you can take to troubleshoot and potentially resolve this issue:

  1. Regulatory Domain: Ensure that the regulatory domain is set correctly for your region. You can set the regulatory domain using the iw command. For example, to set the regulatory domain to the United States, you can use:

    iw reg set US
    
  2. Driver and Firmware: Verify that you are using the latest driver and firmware for the Wi-Fi module. Sometimes, limitations in the driver or firmware can restrict the TX power settings.

  3. Kernel Configuration: Ensure that the kernel configuration supports higher TX power settings. You might need to check the kernel configuration related to wireless drivers and regulatory settings.

  4. Device Tree Configuration: Ensure that the device tree configuration does not impose any restrictions on the TX power settings. You might need to review the device tree source files for any limitations.

  5. Permissions: Ensure that you have the necessary permissions to change the TX power settings. You might need to run the commands as the root user.

  6. Alternative Tools: If iw is not allowing you to set the TX power, you can try using iwconfig as an alternative:

    iwconfig mlan0 txpower 16
    
  7. Check for Errors: Review the kernel logs (dmesg) for any errors or warnings related to the Wi-Fi module. This can provide insights into why the TX power setting is failing.

If the above steps do not resolve the issue, it might be a hardware limitation of the Wi-Fi module on the Verdin iMX8M Plus WB. In such cases, the maximum TX power might be limited to 8 dBm by design.

Best regards, Toradex AI Assistant

Hi @clee

I’m not sure that the output from “iw reg” shows what the hardware is actually capable of, but rather what the regulatory maximums are. It seems that the max tx power is 8.00 dBm according to the log message:

root@verdin-imx8mp-07106925:~# iw dev mlan0 set txpower fixed 1500
[   56.799030] mwifiex_sdio mmc0:0001:1: txpower value 15 dBm	is out of range (0 dBm-8 dBm)

I’m not sure why this is limited to 8 but it seems that is a driver/hardware limitation.

Can you describe the issue you are having that caused you to want to increase the TxPower? I wonder if antenna setup or some other variable might be a better approach to fix the root cause here.

Drew

Hi Drew,

I’m using the on-board AzureWave wireless device on Verdin SOM. We also directly connected Toradex’s PCB antenna to the AzureWave module.

The reason why I was investigating the transmit power was due to dropped connection. If the router had “disassociate on low acknowledgement” enabled, the Verdin will randomly become unreachable. If we disable that feature, the Verdin wireless connection will be more stable, but will still intermittently drop connection but much more seldomly.

When it’s unreachable, Verdin still shows that the link is up. However, other external devices are unable to ping the Verdin’s IP address. If Verdin pings the external devices IP address, then bidirectional ping works again.

Hmm. OK. I’m going to bring in my colleague @rafael.tx here as he is more knowledgable at this level.

Drew

Hello @clee,
Do you have both antennas connected to the module?
Do you have other Wi-Fi devices nearby that maintain a more stable connection?
Is the AP far away from the module?
Could you check the output of iw dev? It should show you the current power level of the device.

I’d try to set regulatory domain to US as Ai suggested:

iw reg set US

and then try to increase txpower

Yes, both antennas are connected to the module, and configured for dual antenna.

root@crce-imx8-14855176:~# iw phy | grep Antenna
        Available Antennas: TX 0x7 RX 0x7
        Configured Antennas: TX 0x3 RX 0x3

I have tablet and laptop also connected to the same router, and no dropped connection between the two devices. It just randomly can’t reach the Verdin.

AP is about 3 ft away from all devices.

Output of iw dev with regulation set to global

root@crce-imx8-14855176:~# iw dev
phy#0
        Interface uap0
                ifindex 8
                wdev 0x2
                addr 14:13:33:cc:e3:e9
                type AP
                txpower 8.00 dBm
        Interface mlan0
                ifindex 7
                wdev 0x1
                addr 14:13:33:cc:e1:e9
                ssid clee
                type managed
                channel 11 (2462 MHz), width: 20 MHz (no HT), center1: 2462 MHz
                txpower 8.00 dBm

Testing with iw reg set US, but still shows 8dBm

root@crce-imx8-14855176:~# iw reg get 
global
country 00: DFS-UNSET
        (755 - 928 @ 2), (N/A, 20), (N/A), PASSIVE-SCAN
        (2402 - 2472 @ 40), (N/A, 20), (N/A)
        (2457 - 2482 @ 20), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM, PASSIVE-SCAN
        (5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
        (5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, PASSIVE-SCAN
        (5735 - 5835 @ 80), (N/A, 20), (N/A), PASSIVE-SCAN
        (57240 - 63720 @ 2160), (N/A, 0), (N/A)

root@crce-imx8-14855176:~# iw reg set US
root@crce-imx8-14855176:~# iw reg get
global
country US: DFS-FCC
        (902 - 904 @ 2), (N/A, 30), (N/A)
        (904 - 920 @ 16), (N/A, 30), (N/A)
        (920 - 928 @ 8), (N/A, 30), (N/A)
        (2400 - 2472 @ 40), (N/A, 30), (N/A)
        (5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
        (5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
        (5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
        (5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
        (5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
        (5925 - 7125 @ 320), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
        (57240 - 71000 @ 2160), (N/A, 40), (N/A)

root@crce-imx8-14855176:~# iw dev mlan0 set txpower fixed 1600
command failed: Operation not permitted (-1)
root@crce-imx8-14855176:~# dmesg
[...]
[  512.496467] mwifiex_sdio mmc0:0001:1: txpower value 16 dBm   is out of range (0 dBm-8 dBm)
root@crce-imx8-14855176:~# iw dev
phy#0
        Interface uap0
                ifindex 8
                wdev 0x2
                addr 14:13:33:cc:e3:e9
                type AP
                txpower 8.00 dBm
        Interface mlan0
                ifindex 7
                wdev 0x1
                addr 14:13:33:cc:e1:e9
                ssid clee
                type managed
                channel 11 (2462 MHz), width: 20 MHz (no HT), center1: 2462 MHz
                txpower 8.00 dBm

As another test to confirm that the command is working, I can set the tx power to something less than 8dBm

root@crce-imx8-14855176:~# iw dev mlan0 set txpower fixed 500
root@crce-imx8-14855176:~# iw dev
phy#0
        Interface uap0
                ifindex 8
                wdev 0x2
                addr 14:13:33:cc:e3:e9
                type AP
                txpower 5.00 dBm
        Interface mlan0
                ifindex 7
                wdev 0x1
                addr 14:13:33:cc:e1:e9
                ssid clee
                type managed
                channel 11 (2462 MHz), width: 20 MHz (no HT), center1: 2462 MHz
                txpower 5.00 dBm

Hi @clee

Can you try and reproduce this on a Toradex carrier board using our prebuilt reference images? That may help us narrow in on a cause.

Drew

Here’s the test result using Dahlia carrier board with Verdin iMX8MP SOM. I used prebuilt 6.7.0-build.13 minimal reference image, and connmanctl to connect to the router. I get the same result that caps the txpower at 8dBm.

root@verdin-imx8mp-14855176:~# tdx-info

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.148-6.7.0+git.bfdbfb2c85fb #1 SMP PREEMPT Thu Jun 20 15:59:41 UTC 2024
Kernel command line:      root=PARTUUID=30da2a8a-02 ro rootwait console=tty1 console=ttymxc2,115200 consoleblank=0 earlycon
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=6.7.0-build.13
Distro variant:           -
Hostname:                 verdin-imx8mp-14855176
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0058 V1.1A
Serial number:            14855176
Processor arch:           aarch64
------------------------------------------------------------

root@verdin-imx8mp-14855176:~# iw dev
phy#0
        Interface uap0
                ifindex 7
                wdev 0x2
                addr 14:13:33:cc:e3:e9
                type AP
                txpower 8.00 dBm
        Interface mlan0
                ifindex 6
                wdev 0x1
                addr 14:13:33:cc:e1:e9
                ssid clee
                type managed
                channel 11 (2462 MHz), width: 20 MHz (no HT), center1: 2462 MHz
                txpower 8.00 dBm

root@verdin-imx8mp-14855176:~# iw reg set US

root@verdin-imx8mp-14855176:~# iw reg get
global
country US: DFS-FCC
        (902 - 904 @ 2), (N/A, 30), (N/A)
        (904 - 920 @ 16), (N/A, 30), (N/A)
        (920 - 928 @ 8), (N/A, 30), (N/A)
        (2400 - 2472 @ 40), (N/A, 30), (N/A)
        (5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
        (5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
        (5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
        (5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
        (5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
        (5925 - 7125 @ 320), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
        (57240 - 71000 @ 2160), (N/A, 40), (N/A)

root@verdin-imx8mp-14855176:~# iw dev mlan0 set txpower fixed 1600
[  288.988482] mwifiex_sdio mmc0:0001:1: txpower value 16 dBm   is out of range (0 dBm-8 dBm)
command failed: Operation not permitted (-1)

And do you still get the connection drops?

I’ll have to run that for longer time to check for dropped connection.

However specifically regarding wifi tx power, it’s the same behavior. Does that mean the on-board Verdin IMX8MP WiFi chip has a hard limit at 8dBm?

It’s possible that the Wifi chip does have a limit that is lower than what is reported by the iw reg command. I’m hoping that @rafael.tx or @alex.tx may have more concrete info.

Regarding running the test, sure that makes sense. I can say that I’ve never seen connection drops in my local environment running at 8dBm.

Drew

@drew.tx - I ran the same setup on the Dahlia carrier board with pre-built binary and get the same dropped connection (where the tablet no longer sees the Verdin after a while). It’ll require a ping from the Verdin for the tablet to see the Verdin again.

Another reason we are looking at the transmit power is that we are using Verdin in a robotic application that moves further/closer from the central router. Therefore, we assume that higher Tx power will increase the wireless range.

But for this specific dropped connection test, everything is stationary.

What kind of connection is the tablet making to the board? When the system is in this state, can you confirm whether the verdin board still has an active connection?

I set my verdin up and every 10 minutes attempted to connect to the active ssh port. This was successful running overnight so it seems that the verdin, in my case, was active the entire time. Can you do a similar test? I’m starting to wonder if the issue is with the Tablet side of your setup.

Drew

For my setup, I have a four devices: router, Verdin iMX, iPad tablet, another MPU device. During start up, iPad can communicate to both Verdin and MPU. All communication is done over Wi-Fi.

After a while, only Verdin is unreachable.

  • Looking at router’s page, I see the Verdin on the DHCP client list
  • iPad and MPU cannot ping Verdin’s IP address. So somehow Verdin disappeared from all the other clients?
  • iPad and MPU can still communicate properly
  • Using console entry, I can log into Verdin and confirm the ip link is still up. Verdin can ping the router’s IP address, but iPad and MPU cannot see Verdin
  • Once Verdin pings the iPad/MPU, then iPad and MPU can see Verdin

Is it possible that Verdin went into a sleep state, which caused the other devices to forget? I’m not sure how to check if any power savings were initiated.

Hi @clee

I don’t believe we enable sleep or hibernate automatically in the reference images but I suppose it is possible.

Please confirm that you are determining that the verdin is disconnected because it has stopped responding to pings. Is that right? When it is in that state, can you connect to tcp port 22 (ie ssh)?

When the device is in the disconnected state, can you run “dmesg” from a serial terminal?

My recent tests were with connman. Can you reproduce the issue using that? Running “connmanctl state” will show the current status and “connmanctl monitor” will run continually printing status about state changes and such. That might be instructive.

Also when in the disconnected state can you provide the output of “ifconfig”, “ip addr” and “route -n”?

Drew

Hi @clee

Have you made any more progress here? Any thoughts on my last experiments?

Drew