WIFI can't connect while ethernet cable is connected

Hi.
I have a problem of wifi connection. I’m using custom kernel because I have to support many USB to ethernet adaptors. Anyway if I use only wifi, it works fine. But if I connect a ethernet cable, then wifi can’t get IP. Please let me know how to connect wifi and ethernet. If I connect ethernet cable after wifi get IP address, it works fine. I’m using U.FL antenna like here.

If I don’t connect a ethernet cable, then mlan0 is connected.

[  OK  ] Reached target Login Prompts.
[   21.364832] mwifiex_sdio mmc1:0001:1: info: trying to associate to 'PRECEPTHEALTH 5GHz' bssid f0:d1:a9:14:45:99
[   21.383305] mwifiex_sdio mmc1:0001:1: info: associated to bssid f0:d1:a9:14:45:99 successfully
[   21.478736] IPv6: ADDRCONF(NETDEV_CHANGE): mlan0: link becomes ready

.---O---.
|       |                  .-.           o o
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution colibri-imx6ull ttymxc0

Angstrom v2017.12 - Kernel 4.9.166-2.8.6+gd899927

If I connect the ethernet cable and turn on the power, WIFI can’t get IP address.

[   20.569948] fec 20b4000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[   20.577879] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

.---O---.
|       |                  .-.           o o
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution colibri-imx6ull ttymxc0

Angstrom v2017.12 - Kernel 4.9.166-2.8.6+gd899927

Colibri-iMX6ULL_Console-Image 2.8b6 20200525

colibri-imx6ull login: root
Password:
Last login: Tue May 26 04:29:12 UTC 2020 on ttymxc0
idh@colibri-imx6ull:~# [   35.774687] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters
[   38.590014] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters

idh@colibri-imx6ull:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:2D:62:FC:89
          inet addr:192.168.1.170  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::214:2dff:fe62:fc89%lo/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:160 errors:0 dropped:0 overruns:0 frame:0
          TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:17558 (17.1 KiB)  TX bytes:11100 (10.8 KiB)

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:88 errors:0 dropped:0 overruns:0 frame:0
          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:6768 (6.6 KiB)  TX bytes:6768 (6.6 KiB)

mlan0     Link encap:Ethernet  HWaddr DC:F5:05:46:E5:2F
          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)

uap0      Link encap:Ethernet  HWaddr DC:F5:05:46:E4:2F
          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:321 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30782 (30.0 KiB)  TX bytes:9424 (9.2 KiB)

idh@colibri-imx6ull:~#
[   65.577603] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters
[  143.767051] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters
[  146.584140] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters
[  386.798493] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters
[  389.585571] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters
idh@colibri-imx6ull:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:2D:62:FC:89
          inet addr:192.168.1.170  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::214:2dff:fe62:fc89%lo/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:848 errors:0 dropped:0 overruns:0 frame:0
          TX packets:105 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:83523 (81.5 KiB)  TX bytes:12518 (12.2 KiB)

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:7296 (7.1 KiB)  TX bytes:7296 (7.1 KiB)

mlan0     Link encap:Ethernet  HWaddr DC:F5:05:46:E5:2F
          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)

uap0      Link encap:Ethernet  HWaddr DC:F5:05:46:E4:2F
          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:934 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:81759 (79.8 KiB)  TX bytes:9994 (9.7 KiB)

idh@colibri-imx6ull:~#

Hi @HansKim72

This is a default behavior of connman which is used in our BSP. My colleague created a thread about the same topic once. You can change settings like this in /etc/connman/main.conf. The following snipped shows the settings to change the preferred technologies and to enable multiple connections from different technologies:

[General]
     
PreferredTechnologies=wifi,ethernet
SingleConnectedTechnology=false

This should work, but you may also want to check the option AlwaysConnectedTechnologies.

Best regards
Diego

Thank you.

You answer is correct. How can I change them in Yocto?

Dear @HansKim72

You can find the recipe which is used in OpenEmbedded at following path: layers/openembedded-core/meta/recipes-connectivity/connman/connman_1.34.bb. The related git repository is here and you can find the default main.conf of the version 1.34 here.
Now you can clone the repository of that connman version, change the original main.conf and create a git patch file with your changes. This patch file can then be applied to the sources in your Yocto Project. Either with .bbappend on the original recipe or to do it properly: in your own meta-layer with a new recipe for your custom connman.

Best regards
Diego

Hi.
I’m so sorry about late reply. Sometimes I saw the weird WIFI IP address(169.254.153.244). Do you know the cause?

idh@colibri-imx6ull:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:2D:62:FC:89
          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)

eth1      Link encap:Ethernet  HWaddr 00:E0:4C:36:08:DA
          inet addr:192.168.1.174  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:4cff:fe36:8da%lo/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:670 errors:0 dropped:0 overruns:0 frame:0
          TX packets:98 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:61431 (59.9 KiB)  TX bytes:14730 (14.3 KiB)

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:86 errors:0 dropped:0 overruns:0 frame:0
          TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:6592 (6.4 KiB)  TX bytes:6592 (6.4 KiB)

mlan0     Link encap:Ethernet  HWaddr DC:F5:05:46:E5:2F
          inet addr:169.254.153.244  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::def5:5ff:fe46:e52f%lo/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:157 errors:0 dropped:0 overruns:0 frame:0
          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:16101 (15.7 KiB)  TX bytes:11587 (11.3 KiB)

uap0      Link encap:Ethernet  HWaddr DC:F5:05:46:E4:2F
          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:369 errors:0 dropped:1 overruns:0 frame:0
          TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:34562 (33.7 KiB)  TX bytes:10802 (10.5 KiB)

Dear @HansKim72

This seems to be another issue, not related to the title of this thread actually. I would like to ask you to open another thread if you need further support after my comment.

This IP address is called “link-local”, “zeroconf” or “APIPA”. This address is generated by the system automatically if there is no DHCP service available on the connected network. This means, your device was able to connect to the WiFi, but it doesn’t get any IP address from your router. I would recommend to check the settings on the router. If you plan to use the device in the same WiFi forever, I would also recommend to check the possibility to configure a static IP within your network.

Best regards
Diego