Wi-Fi Not Connecting at Boot

With APQ8016_410C_LA.BR.1.2.4-01810-8×16.0_5.1.1_Lollipop_P2, Wi-Fi will not connect at boot. I have to manually click on the Wi-Fi icon and pick the network, and then it connects fine.

Watching the logs at bootup, I see:

E/WifiStateMachine: Failed to load driver

Has anyone sorted this out?

If I do

adb shell
then

su -
svc wifi disable
svc wifi enable
wpa_cli -p /data/misc/wifi/sockets/ -i wlan0 reassociate

it works fine.

I’m thinking that it’s a timing issue where the system isn’t ready at the point at which Wi-Fi attempts to initialize.

Any ideas how to fix this? I guess in the meantime I can write a helper app that will toggle Wi-Fi after system boot, but that’s a kludge.

I have the same issue. I kludged and put a ‘svc WiFi enable’ at the end of the existing /etc/init_qcom_postboot.sh script

I also found the same issue. It was working with the 15.06 release, but is broken in the 15.08 release.
I also added ‘svc WiFi enable’ at the end of the /etc/init.qcom.post_boot.sh file:

adb devices
adb root
adb remount
adb pull /etc/init.qcom.post_boot.sh
edit init.qcom.post_boot.sh
adb push init.qcom.post_boot.sh
adb reboot

How did you solve it?

I made an Android App that ran at system boot and toggled the WiFi off and on, then reassociated:


public class LHBroadcastReceiver extends BroadcastReceiver {

    WifiManager mWiFiManager;

    public LHBroadcastReceiver() {
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d("LHBroadcastReceiver", "received boot intent for WiFiHelper");

        mWiFiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);

        if (mWiFiManager.isWifiEnabled()) {
            mWiFiManager.setWifiEnabled(false);
        }

        mWiFiManager.setWifiEnabled(true);

        mWiFiManager.reassociate();
    }
}

Sorry to ask but I change /etc/init.qcom.post_boot.sh and add the “svc wifi enable line”.
But the /etc is a read only directory and chmod 777 is not accepted. Or I cannot make it change.
I am not an Linux expert, if someone could help me?
Thank you

I found my way to chmod, nevermind :slight_smile:
Adding the “svc wifi enable” line at the end of the boot script enabled the WIFI but no Internet access.
Tried several times and always failed on Internet connection

Followup:
I probably found the solution. Probably linked to the profile.
Simply: Once you setup your WIFI and have it ON.

  • Power OFF the Dragonboard by using the Power OFF button on the board. Press a few seconds
  • A button will appear with “Power off”.
  • Click it, the system will power OFF properly probably creating the profile or else.
  • Next power ON I always get my WIFI ON.

If you pull the plug when powering OFF the WIFI is randomly powered ON or often Power OFF at the next power ON.
Powering OFF by the button made it clean. Working for me since more than a month and no glitches so far.

Android Kernel version Wed Dec 2 10:33:57 UTC 2015