iMX6ULL wifi / ble - Unstable Wifi connection, mlan0 disappearing [Solved]

Hello, I’m having wifi problems with my Colibri iMX6ULL wifi/ble. I follow the steps outlined in the getting started page to setup my wifi and connect to my access point. The wifi connects successfully but never stays connected for too long.

When connecting, I am able to ping google.com like such:

root@colibri-imx6ull:~# ping google.com
PING google.com (172.217.6.174): 56 data bytes
64 bytes from 172.217.6.174: seq=0 ttl=52 time=16.544 ms
64 bytes from 172.217.6.174: seq=1 ttl=52 time=46.216 ms
64 bytes from 172.217.6.174: seq=2 ttl=52 time=104.265 ms
64 bytes from 172.217.6.174: seq=3 ttl=52 time=101.299 ms
64 bytes from 172.217.6.174: seq=4 ttl=52 time=75.802 ms
64 bytes from 172.217.6.174: seq=5 ttl=52 time=121.093 ms

I can also see the wifi module here:

root@colibri-imx6ull:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:2D:2D:E4:18
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1%1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:94 errors:0 dropped:0 overruns:0 frame:0
          TX packets:94 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:7744 (7.5 KiB)  TX bytes:7744 (7.5 KiB)

mlan0     Link encap:Ethernet  HWaddr 00:19:88:5E:10:74
          inet addr:192.168.129.163  Bcast:192.168.129.255  Mask:255.255.255.0
          inet6 addr: fe80::219:88ff:fe5e:1074%lo/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:87 errors:0 dropped:0 overruns:0 frame:0
          TX packets:99 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22973 (22.4 KiB)  TX bytes:13835 (13.5 KiB)

uap0      Link encap:Ethernet  HWaddr 00:19:88:5E:10:74
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

usb0      Link encap:Ethernet  HWaddr 00:14:2D:FF:FF:FF
          inet addr:192.168.11.1  Bcast:192.168.11.255  Mask:255.255.255.0
          inet6 addr: fe80::214:2dff:feff:ffff%lo/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:301 errors:0 dropped:0 overruns:0 frame:0
          TX packets:97 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:26581 (25.9 KiB)  TX bytes:20928 (20.4 KiB)

However, after a few minutes, I see these messages in my serial console:

The Angstrom Distribution colibri-imx6ull ttymxc0

Angstrom v2017.12 - Kernel

Colibri-iMX6ULL_Console-Image 2.8b3.111 20180626

colibri-imx6ull login: [   16.793450] mwifiex_sdio mmc1:0001:1: CMD_RESP: cmd 0x242 error, result=0x2
[   16.800778] mwifiex_sdio mmc1:0001:1: mwifiex_process_cmdresp: cmd 0x242 failed during       initialization
[   16.897420] mwifiex_sdio mmc1:0001:1: info: MWIFIEX VERSION: mwifiex 1.0 (15.68.7.p71)
[   16.905768] mwifiex_sdio mmc1:0001:1: driver_version = mwifiex 1.0 (15.68.7.p71)
[   16.941003] IPv6: ADDRCONF(NETDEV_UP): mlan0: link is not ready
[   17.110707] IPv6: ADDRCONF(NETDEV_UP): uap0: link is not ready
[   17.182973] Bluetooth: RFCOMM TTY layer initialized
[   17.326263] Bluetooth: RFCOMM socket layer initialized
[   17.419039] Bluetooth: RFCOMM ver 1.11
[   18.102959] mwifiex_sdio mmc1:0001:1: info: trying to associate to 'WellAware' bssid 00:18:0a:35:ed:dc
[   18.159432] mwifiex_sdio mmc1:0001:1: info: associated to bssid 00:18:0a:35:ed:dc successfully
[   18.246691] IPv6: ADDRCONF(NETDEV_CHANGE): mlan0: link becomes ready
[   25.932272] mwifiex_sdio mmc1:0001:1: mlan0: already connected
[   25.970847] mwifiex_sdio mmc1:0001:1: info: successfully disconnected from 00:18:0a:35:ed:dc: reason code 3
[   26.027131] mwifiex_sdio mmc1:0001:1: info: trying to associate to 'WellAware' bssid 02:18:1a:35:ed:dc
[   26.134072] mwifiex_sdio mmc1:0001:1: info: associated to bssid 02:18:1a:35:ed:dc successfully
[   34.728062] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters
[   61.838881] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters
[   77.352823] mwifiex_sdio mmc1:0001:1: info: successfully disconnected from 02:18:1a:35:ed:dc: reason code 3
[   77.492603] IPv6: ADDRCONF(NETDEV_UP): mlan0: link is not ready

After receiving those messages, this is the result of my two tests:

root@colibri-imx6ull:~# ping google.com
ping: bad address 'google.com'

root@colibri-imx6ull:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:2D:2D:E4:18
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1%1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:94 errors:0 dropped:0 overruns:0 frame:0
          TX packets:94 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:7744 (7.5 KiB)  TX bytes:7744 (7.5 KiB)

usb0      Link encap:Ethernet  HWaddr 00:14:2D:FF:FF:FF
          inet addr:192.168.11.1  Bcast:192.168.11.255  Mask:255.255.255.0
          inet6 addr: fe80::214:2dff:feff:ffff%lo/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:396 errors:0 dropped:0 overruns:0 frame:0
          TX packets:138 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:33275 (32.4 KiB)  TX bytes:29302 (28.6 KiB)

The mlan0 adapter disappears and I can no longer connect to the network.

I’m not sure what is happening here but any help would be appreciated.

Thanks.

Please double check if antenna is correctly connected to the module, and the MHF connector is in good condition, as it is very prone to damage when improperly handled.

The antenna looks okay, although it’s possible there is some damage I cannot see.

Would the adapter disappear from ‘ifconfig’ if the antenna has poor reception?

It would not disappear from ifconfig. You should see kernel messages about the device being removed, when device disappears.
what’s the output of iw dev mlan0 link when you’re connected to the network?

Hello,

I ran multiple tests.

The first test, everything seemed to work okay.

Upon boot-up, I received this message:

[   24.923253] mwifiex_sdio mmc1:0001:1: mlan0: already connected
[   24.950137] mwifiex_sdio mmc1:0001:1: info: successfully disconnected from 00:18:0a:35:ed:dc: reason code 3
[   24.971506] mwifiex_sdio mmc1:0001:1: info: trying to associate to 'WellAware' bssid 02:18:1a:35:ed:dc
[   25.040087] mwifiex_sdio mmc1:0001:1: info: associated to bssid 02:18:1a:35:ed:dc successfully

Then, I entered the command you gave me:

root@colibri-imx6ull:~# iw dev mlan0 link
Connected to 02:18:1a:35:ed:dc (on mlan0)
        SSID: WellAware
        freq: 5240
        RX: 26021 bytes (188 packets)
        TX: 11472 bytes (72 packets)
        signal: -61 dBm
        tx bitrate: 54.0 MBit/s MCS 3 40MHz

        bss flags:      short-slot-time
        dtim period:    1
        beacon int:     100

I received several of these messages periodically:

root@colibri-imx6ull:~# [   33.718370] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters

root@colibri-imx6ull:~# [   60.713298] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters

But things remained stable. After a while, I ran your command again:

root@colibri-imx6ull:~# iw dev mlan0 link
Connected to 02:18:1a:35:ed:dc (on mlan0)
        SSID: WellAware
        freq: 5240
        RX: 2848927 bytes (14970 packets)
        TX: 42490 bytes (551 packets)
        signal: -60 dBm
        tx bitrate: 150.0 MBit/s MCS 7 40MHz short GI

        bss flags:      short-slot-time
        dtim period:    1
        beacon int:     100

But then, I powered the board off to test it again and I got the same errors as before.

Here is the log from the second test:

root@colibri-imx6ull:~# iw dev mlan0 link[   28.650018] mwifiex_sdio mmc1:0001:1: mwifiex_cmd_timeout_func: Timeout cmd id = 0x12, act = 0x1800
[   28.659868] mwifiex_sdio mmc1:0001:1: num_data_h2c_failure = 0
[   28.666245] mwifiex_sdio mmc1:0001:1: num_cmd_h2c_failure = 0
[   28.672476] mwifiex_sdio mmc1:0001:1: is_cmd_timedout = 1
[   28.678316] mwifiex_sdio mmc1:0001:1: num_tx_timeout = 0
[   28.684059] mwifiex_sdio mmc1:0001:1: last_cmd_index = 4
[   28.689804] mwifiex_sdio mmc1:0001:1: last_cmd_id: cd 00 0c 01 28 00 16 00 12 00
[   28.697775] mwifiex_sdio mmc1:0001:1: last_cmd_act: 01 00 01 00 13 00 01 00 00 18
[   28.705834] mwifiex_sdio mmc1:0001:1: last_cmd_resp_index = 3
[   28.712038] mwifiex_sdio mmc1:0001:1: last_cmd_resp_id: cd 80 0c 81 28 80 16 80 28 80
[   28.737815] mwifiex_sdio mmc1:0001:1: last_event_index = 4
[   28.761838] mwifiex_sdio mmc1:0001:1: last_event: 0a 00 58 00 58 00 0b 00 0a 00
[   28.806476] mwifiex_sdio mmc1:0001:1: data_sent=0 cmd_sent=0
[   28.831346] mwifiex_sdio mmc1:0001:1: ps_mode=1 ps_state=0
[   28.860186] mwifiex_sdio mmc1:0001:1: info: association to bssid 00:18:0a:35:ed:dc failed
[   28.893306] mwifiex_sdio mmc1:0001:1: ===mwifiex driverinfo dump start===
root@colibri-imx6ull:~# ifconfig[   28.919757] mwifiex_sdio mmc1:0001:1: info: MWIFIEX VERSION: mwifiex 1.0 (15.68.7.p71)
[   28.955406] mwifiex_sdio mmc1:0001:1: SDIO register dump start
[   28.997526] mwifiex_sdio mmc1:0001:1: SDIO Func0 (0x0-0x9): 43 03 06 06 07 00 00 02 03 00
[   29.035937] mwifiex_sdio mmc1:0001:1: SDIO Func1 (0x10-0x17): 00 00 00 00 ff ff 00 00
[   29.080232] mwifiex_sdio mmc1:0001:1: SDIO Func1: (0x8) c3 (0x58) 00 (0x5c) 08 (0x5d) 00 (0x60) 07 (0x61) 0c (0x62) 00 (0x64) 10 (0x65) 00 (0x66) 00 (0x68) 00 (0x69) 00 (0x6a) 00
[   29.156561] mwifiex_sdio mmc1:0001:1: Ignore scan. Card removed or firmware in bad state
[   29.195627] mwifiex_sdio mmc1:0001:1: scan failed: -14
[   29.220750] mwifiex_sdio mmc1:0001:1: SDIO Func1 (0x90-0x9a): dc fe 7e 5b a7 02 07 5f 5e 02 00
[   29.382125] mwifiex_sdio mmc1:0001:1: Ignore scan. Card removed or firmware in bad state
[   29.423500] mwifiex_sdio mmc1:0001:1: scan failed: -14
[   29.452553] mwifiex_sdio mmc1:0001:1: SDIO Func1 (0x90-0x9a): dc fe 7e 5b a7 02 07 5f 5e 02 00
[   29.494242] mwifiex_sdio mmc1:0001:1: SDIO register dump end
[   29.516954] mwifiex_sdio mmc1:0001:1: ===mwifiex driverinfo dump end===
[   29.540382] mwifiex_sdio mmc1:0001:1: == mwifiex dump information to /sys/class/devcoredump start
[   29.585221] mwifiex_sdio mmc1:0001:1: == mwifiex dump information to /sys/class/devcoredump end
[   29.640578] mwifiex_sdio mmc1:0001:1: info: shutdown mwifiex...
[   29.674981] mwifiex_sdio mmc1:0001:1: PREP_CMD: card is removed
[   29.698442] mwifiex_sdio mmc1:0001:1: PREP_CMD: card is removed
[   29.781717] mwifiex_sdio mmc1:0001:1: PREP_CMD: card is removed
[   29.890206] mwifiex_sdio mmc1:0001:1: PREP_CMD: card is removed
[   30.172846] mwifiex_sdio mmc1:0001:1: WLAN FW already running! Skip FW dnld
[   30.195077] mwifiex_sdio mmc1:0001:1: WLAN FW is active

root@colibri-imx6ull:~# iw dev mlan0 link
command failed: No such device (-19)

root@colibri-imx6ull:~# [   40.914732] mwifiex_sdio mmc1:0001:1: mwifiex_cmd_timeout_func: Timeout cmd id = 0xa9, act = 0x0
[   40.969830] mwifiex_sdio mmc1:0001:1: num_data_h2c_failure = 0
[   40.998926] mwifiex_sdio mmc1:0001:1: num_cmd_h2c_failure = 0
[   41.027039] mwifiex_sdio mmc1:0001:1: is_cmd_timedout = 1
[   41.054517] mwifiex_sdio mmc1:0001:1: num_tx_timeout = 0
[   41.081177] mwifiex_sdio mmc1:0001:1: last_cmd_index = 0
[   41.107226] mwifiex_sdio mmc1:0001:1: last_cmd_id: a9 00 0c 01 28 00 16 00 12 00
[   41.154870] mwifiex_sdio mmc1:0001:1: last_cmd_act: 00 00 01 00 13 00 01 00 00 18
[   41.203460] mwifiex_sdio mmc1:0001:1: last_cmd_resp_index = 3
[   41.229719] mwifiex_sdio mmc1:0001:1: last_cmd_resp_id: cd 80 0c 81 28 80 16 80 28 80
[   41.277078] mwifiex_sdio mmc1:0001:1: last_event_index = 4
[   41.302845] mwifiex_sdio mmc1:0001:1: last_event: 0a 00 58 00 58 00 0b 00 0a 00
[   41.349420] mwifiex_sdio mmc1:0001:1: data_sent=1 cmd_sent=1
[   41.375384] mwifiex_sdio mmc1:0001:1: ps_mode=0 ps_state=0
[   41.417271] mwifiex_sdio mmc1:0001:1: info: _mwifiex_fw_dpc: unregister device

root@colibri-imx6ull:~# [   51.821432] INFO: task kworker/0:1:22 blocked for more than 10 seconds.
[   51.847920]       Tainted: G           O    4.9.87-2.8.3+g07d40f6f #1
[   51.874112] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[   51.923202] kworker/0:1     D    0    22      2 0x00000000
[   51.950718] Workqueue: events mwifiex_sdio_work [mwifiex_sdio]
[   51.979103] Backtrace:
[   52.004066] [<807aa0d8>] (__schedule) from [<807aa6ec>] (schedule+0x44/0xa4)
[   52.034197]  r10:7fffffff r9:00000000 r8:00000000 r7:00000002 r6:941a7d08 r5:ffffe000
[   52.088173]  r4:ffffe000
[   52.113325] [<807aa6a8>] (schedule) from [<807ad678>] (schedule_timeout+0x1cc/0x274)
[   52.168099]  r5:ffffe000 r4:7fffffff
[   52.196024] [<807ad4ac>] (schedule_timeout) from [<807ab19c>] (wait_for_common+0xc8/0x190)
[   52.254611]  r8:00000000 r7:00000002 r6:941a7d08 r5:ffffe000 r4:941a7d04
[   52.287098] [<807ab0d4>] (wait_for_common) from [<807ab27c>] (wait_for_completion+0x18/0x1c)
[   52.347061]  r10:80c02d00 r9:80c0e6b4 r8:00000000 r7:97b97900 r6:97b94600 r5:9477db20
[   52.407075]  r4:94199c80
[   52.435584] [<807ab264>] (wait_for_completion) from [<8013ba30>] (flush_work+0x138/0x19c)
[   52.496390] [<8013b8f8>] (flush_work) from [<8013d7e8>] (__cancel_work_timer+0x94/0x1ac)
[   52.558414]  r7:941a6000 r6:00000000 r5:9477db20 r4:00000011
[   52.592030] [<8013d754>] (__cancel_work_timer) from [<8013d914>] (cancel_work_sync+0x14/0x18)
[   52.656354]  r9:00000000 r8:7f1499c0 r7:9477da98 r6:94930000 r5:00000001 r4:9477da90
[   52.720547] [<8013d900>] (cancel_work_sync) from [<7f16971c>] (mwifiex_cleanup_sdio+0x18/0x44 [mwifiex_sdio])
[   52.787911] [<7f169704>] (mwifiex_cleanup_sdio [mwifiex_sdio]) from [<7f116344>] (mwifiex_unregister+0x20/0xcc [mwifiex])
[   52.857711]  r5:00000001 r4:94930000
[   52.891341] [<7f116324>] (mwifiex_unregister [mwifiex]) from [<7f117150>] (_mwifiex_fw_dpc+0x100/0x45c [mwifiex])
[   52.960259]  r7:9477da98 r6:94931000 r5:00000001 r4:94930000
[   52.996208] [<7f117050>] (_mwifiex_fw_dpc [mwifiex]) from [<7f117608>] (mwifiex_reinit_sw+0x148/0x29c [mwifiex])
[   53.066372]  r8:00000000 r7:ffffffe0 r6:94931000 r5:00000000 r4:94930000
[   53.103609] [<7f1174c0>] (mwifiex_reinit_sw [mwifiex]) from [<7f1697e0>] (mwifiex_sdio_work+0x98/0x75c [mwifiex_sdio])
[   53.175021]  r7:9477da90 r6:94930000 r5:943ff400 r4:9477db30
[   53.211194] [<7f169748>] (mwifiex_sdio_work [mwifiex_sdio]) from [<8013cbc8>] (process_one_work+0x1f0/0x418)
[   53.281366]  r10:80c02d00 r9:00000000 r8:00000000 r7:97b97900 r6:97b94600 r5:94199c80
[   53.349884]  r4:9477db20
[   53.381964] [<8013c9d8>] (process_one_work) from [<8013db7c>] (worker_thread+0x68/0x5fc)
[   53.450715]  r10:80c02d00 r9:00000008 r8:ffffe000 r7:97b94618 r6:94199c98 r5:97b94600
[   53.519166]  r4:94199c80
[   53.551152] [<8013db14>] (worker_thread) from [<80142dd4>] (kthread+0x110/0x118)
[   53.618012]  r10:00000000 r9:00000000 r8:8013db14 r7:94199c80 r6:941a6000 r5:9419b080
[   53.685081]  r4:00000000
[   53.716473] [<80142cc4>] (kthread) from [<80107db0>] (ret_from_fork+0x14/0x24)
[   53.781078]  r8:00000000 r7:00000000 r6:00000000 r5:80142cc4 r4:9419b080

Running your command this time yielded this:

root@colibri-imx6ull:~# iw dev mlan0 link
command failed: No such device (-19)

Not sure why it’s inconsistent. I verified the physical connection is secure and the device was not touched during testing.

Edit: I verified it’s not the wifi AP; I tested it with another wifi AP

Hi @Brietoe

Sorry for the late reply. This is an issue which will be included in our next Bsp release. Meanwhile you can install 2.8b3.127 with Toradex Easy Installer. You need to activate the feeds server to see this image.

Best regards, Jaski

Hello @jaski.tx

Thanks for getting back to me! I didn’t see 2.8b3.127 on the Toradex Easy Installer after enabling the test server but I did see 2.8b3.126 so I went ahead and installed that one.

Initially after trying to connect, the wifi still wouldn’t work but with a different error message this time:

root@colibri-imx6ull:~# connmanctl> [   84.738200] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported
Error '84.738200]': Unknown command
root@colibri-imx6ull:~# [   84.783344] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported
sh: missing ]
root@colibri-imx6ull:~# [   84.823285] IPv6: ADDRCONF(NETDEV_UP): uap0: link is not ready
-sh: syntax error: unexpected "("
root@colibri-imx6ull:~# [   87.703772] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported
sh: missing ]
root@colibri-imx6ull:~# [   87.759701] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported
sh: missing ]
root@colibri-imx6ull:~# [   87.805556] IPv6: ADDRCONF(NETDEV_UP): uap0: link is not ready
-sh: syntax error: unexpected "("
root@colibri-imx6ull:~# [   90.701509] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported
sh: missing ]
root@colibri-imx6ull:~# [   90.740989] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported

I went ahead and disabled ‘uap0’ with the following command:

ifconfig uap0 down

After doing that, I tried connecting again and it worked!

Before this version, I’ve been able to connect in the past but only briefly so I still need to verify if the connection is stable. So far the connection is looking good so I’m running a stress test to verify that the connection will persist.

I will report back with my results.

Thanks again!

My test panned out! Wifi is working now!

When I disabled uap0, does that mean I can’t use the wifi as an access point? I don’t need an access point right now but I might sometime in the future.

Thanks again! I really appreciate it.

When connecting using connman you need to use mlan0 service.
You can distinguish between mlan0 and uap0 via mac address.

Example wifi service name (MAC part in bold):

wifi_0019885e10de_666167776c616e32_managed_psk

Perfect. Didn’t notice the difference before.

Thank you!

BTW: BSP 2.8b4 got released today.