Failed to start Hostapd IEEE 802.11…WPA/WPA2/EAP/RADIUS Authenticator

I followed the instructions given in High performance, low power Embedded Computing Systems | Toradex Developer Center to set up the WiFi to operate in Access Point.

  1. Without enabling wpa in hostapd.conf. All is working fine. WiFi starts ok upon a reboot.
  2. Set wpa=1, and wpa_psk to the target key. Again all is working fine. WiFi starts ok upon a reboot.
  3. Set wpa=2 and same wpa_psk as above. Start hostapd from the console by executing systemctl start hostapd, WiFi works fine. However, WiFi fails to start upon a reboot (error message: Failed to start Hostapd IEEE 802.11…WPA/WPA2/EAP/RADIUS Authenticator.)
  4. Set wpa=2, same wpa_psk, also set wpa_key_mgmt=WPA-PSK WPA-EAP. Wifi again fails to start upon a reboot.
  5. Set wpa=2, same wpa_psk, also set wpa_key_mgmt=WPA-PSK only. Wifi still fails to start upon a reboot.
  6. Set wpa=2, same wpa_psk, also set wpa_key_mgmt=WPA-PSK, rsn_pairwise=CCMP. Still fail to start upon a reboot.

It seems that I can only manage to get WiFi starts upon a reboot only when either no wpa or with wpa=1.

It appears that WiFi fails to start upon a reboot also when wpa = 1

Hi @SSL

I tried to reproduce your issue. In my case, it always started properly when I did a restart, but it didn’t work when I did a cold boot. It seemed that the wpa_supplicant.service didn’t find the interface, but is required to start the hostapd service.
I tried to change the hostapd.service as followed:

[Unit]
Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
After=network.target
Wants=wpa_supplicant.service
After=multi-user.target 

[Service]
Type=forking
PIDFile=/run/hostapd.pid
ExecStart=/usr/sbin/hostapd /etc/hostapd.conf -P /run/hostapd.pid -B

[Install]
WantedBy=multi-user.target

This worked out for me. I was able to cold boot with wpa=1 and wpa=2, even with wpa_key_mgmt. Could you try this?
By the way for the ones that don’t know already: the service file I am talking about and also the configuration of hostapd one can find here.

Kind regards
Diego

Hi Diego,

Adding line 3 and 4 to the service file fixes the cold boot issue.
Unfortunately, the service file described in High performance, low power Embedded Computing Systems | Toradex Developer Center does not have these two lines.

HI @SSL

Thanks for your Input.
Is the issue solved?

Best regards,
Jaski

I thought it was fixed but the unit was power cycled this morning (instead of doing a reboot from command line), it seems that same problem still happens. We will investigate it a bit further later today.

We performed a number of cold and hot boot. The result is inconsistent. More than half of the time it fails. The only way to get the WiFi consistently auto-starts is to add some delay in the service tile.


We delay starting hostapd by 5 seconds, however it is just some arbitrary number, we fear it may still fail in the field if the system behavior changes for whatever reason.

Hi @SSL

Could you share the dmesg log in working and non-working condition?

Best regards,
Jaski