Successfully initialized wpa_supplicant but does't work

Hi all,

I’m working with the following configuration:

Apalis iMX8QM 4GB WB IT V1.1C/E
Ixora Carrier Board V 1.2A
BSP 5.7.

During the testing of my project I always used connmactl in order to connect my board to the internet.
Now I am going to release the product but before releasing I am working on an “internet connection manager”

I guess I can’t use connmanctl anymore since it consist in an interactive command (isn’t it?) so I’m going to use directly wpa_supplicant.

My script edit wpa_supplicant.conf as follow:

root@localhost:~# cat /etc/wpa_supplicant/wpa_supplicant.conf 


After that I try to start wpa_supplicant with this command:

wpa_supplicant -B -i mlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf wext

as result of this command I get:
Successfully initialized wpa_supplicant

But if I try to ping (or any other website) i seet that the network doesn’t work.
Everything is working under connmanctl, but not under wpa_supplicant.

I honestly can’t understand why.

Do you have any suggestion about that?


You may automate it without interactive “agent”. Instead of agent you can write directly ini file somewhere at /var/lib/connman. Just connect using agent, then look where and how those settings are stored.

Even when wpa_cli status reports COMPLETED, you still will need little more to ping hosts on internet. wpa_supplicant is only about wlan link, it doesn’t assign IP address and doesn’t setup routing.

1 Like

Hi Edward,
Thank you so much for your suggestion, I would try to write an ini file (I didn’t do anything before but I guess it would be pissibile).

Speaking about wpa_supplicant, in case I will decide to use it instead of connmanctl, how can I setup routing and make my board really connect the internet?


Hi @Merlin,

There are numerous tools and ways to do that. You need some DHCP client to assign IP address from DHCP server. It should care as well about default route and DNS server IP. udhcpcd, systemd-networkd, network manager, etc should do. Perhaps connman can be told as well to work in tandem with wpa_supplicant, I don’t know how, i didn’t try that. systemd-networkd is present on your Apalis by default. If I’m not missing something, you should just disable connman with systemctl disable connmand. Then put to /etc/systemd/network file named like with these lines inside:



This should make IP assigned one Wi-Fi link is established. Since connman is installed by default, I guess you may have issues with name resolution. If it doesn’t work, then make sure /etc/resolv.conf points to systemd-networkd resolv.conf like

# ls -l /etc/resolv.conf 
 resolv.conf -> /run/systemd/resolve/stub-resolv.conf

Hi Edward.
Sorry for my late answering, I was trying to work on a different strategy, and I may have reached an acceptable solution: I am using connmactl in this way:

  • To enable wifi
  • To scan and show available networks: it allows me to check if it is a favorite network or not in a very simple way, also allows me to know if it is a 2.4 or 5 GHz, WPA or free acces and stuff like this.
  • I create all necessary directories/file in /var/lib/connman/ with a little part of code (only if that WiFi network is used for the first time).
  • To connect the WiFi: connmanctl connect wifi_name_stuff_psk_managed

Now I guess I just have to consider some use case but I guess the most important is “wrong password”.

To be honest I’m faceing up a little problem:
I am in the following situation:

connmanctl> agent on
Agent registered
connmanctl> enable wifi
Enabled wifi
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
    Mectronic_UP         wifi_346f244eea07_4d656374726f6e69635f5550_managed_psk
    Mectronic_UP         wifi_346f244ee807_4d656374726f6e69635f5550_managed_psk
    Mectronic            wifi_346f244ee807_4d656374726f6e6963_managed_psk
    Mectronic            wifi_346f244eea07_4d656374726f6e6963_managed_psk
    Mectronic-Guest      wifi_346f244eea07_4d656374726f6e69632d4775657374_managed_psk
    Mectronic-Guest      wifi_346f244ee807_4d656374726f6e69632d4775657374_managed_psk

For every network I have two option.
I can connect to one of them without any problem, in this case I can connect wifi_346f244ee807_4d656374726f6e6963_managed_psk, if I try to connect wifi_346f244eea07_4d656374726f6e6963_managed_psk, it doesn’t complete the connection and I am stuck in this situation:

connmanctl> services
  a Mectronic            wifi_346f244eea07_4d656374726f6e6963_managed_psk
*A  Mectronic            wifi_346f244ee807_4d656374726f6e6963_managed_psk
    Mectronic_UP         wifi_346f244ee807_4d656374726f6e69635f5550_managed_psk
    Mectronic_UP         wifi_346f244eea07_4d656374726f6e69635f5550_managed_psk
    Mectronic-Guest      wifi_346f244eea07_4d656374726f6e69632d4775657374_managed_psk
    Mectronic-Guest      wifi_346f244ee807_4d656374726f6e69632d4775657374_managed_psk
Error /net/connman/service/wifi_346f244eea07_4d656374726f6e6963_managed_psk: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Since I have the same problem with ALL the networks, how can I establish on which network do I have to connect my board?


Hi @Merlin,

You have 2 items of each network becuase of two Wi-Fi interfaces, uap0 and mlan0. Connman doesn’t see the difference between two. Connman, as I remember, tries to connect in a random fashion either via uap0 or mlan0. When it connects via mlan0, which is STA interface, you’ll get ± good connection. And when it connects via uap0, which is AP only interface, you may not connect at all or face some instability. If you don’t need AP mode, you may just blacklist uap0 interface in connman configuration file.

1 Like

Hi @Edward ,

You are right, it was beacuse of uap0.
I disabled this interface and now I see only one occurency for each network.
Thanks for your suggestions.