Enabling Wi-Fi hardware¶
Wifi is fairly easy to get going on most Qualcomm devices. The following should enable your device’s Wi-Fi hardware:
echo 1 > /dev/wcnss_wlan echo sta > /sys/module/wlan/parameters/fwpath
If the first command line fails with
/dev/wcnss_wlan: Bad address¶
This is not an error condition; don’t get put off — try the second command.
/sys/module/wlan is missing (not found)¶
Try to load the
wlan kernel module first:
insmod fails with
Required key is not found, you could temporarily disable all the
CONFIG_MODULE_SIG** options in your
defconfig and then re-build
system.img. Beware: this disables kernel module signatures (a security feature) — consider fixing it later.
insmod fails with
Invalid module format, then you need to ensure that you build your
system.img with the same kernel configuration (e.g. perhaps you forgot to re-install
system.img after disabling kernel module signatures above, it contains kernel modules).
It is recommended to build Broadcom drivers as a module since that will ensure use of the device’s MAC address.
In the kernel defconfigs, make sure these settings are set:
Then add this to your device’s init.rc file, it’s recommended to set this in early stages to avoid race condition with network manager (
on post-fs-data is a good place for this):
Testing Wi-Fi functionality¶
You may run the following command to see if your Wi-Fi hardware has come up:
Your device should show up as
wlan0 and have a state of “Disconnected” when it is ready. At that point, run the following command to enter an interface that you can use to connect to Wi-Fi:
Once you are connected to Wi-Fi, try pinging an Internet device:
If all of this is successful, you have successfully brought up your Wi-Fi hardware. If not, check your device’s Logcat for possible errors.
Kernel 3.10 ping:
socket: Permission denied¶
This error is most common on devices which shipped with Linux kernel 3.10. To resolve it, apply the following patches: