WiFi Client Scan & Connect - Error

I am attempting to connect to a WiFi access point but I have been having issues. The first time I was able to set the security and the passphrase but could not connect. I would consistently get an error or -6.

root@swi-mdm9x15:~# wifi client connect 0x10000001
ERROR: le_wifiClient_Connect returns error code -6

I moved to another access point as I thought the issue might be the passphrase had spaces in it. With the spaces I was not sure how to set up teh pass phrase, do you need quotes or not and will it eve work if there are spaces. I tried with and without quotes but still got the -6 error.

When attempting on the second access point all I got when attempting a scan was:

root@swi-mdm9x15:~# wifi client scan
starting scan
DEBUG: le_wifiClient_GetFirstAccessPoint ERRORroot@swi-mdm9x15:~#

If there are any suggestions as to what I may have changed or done incorrectly I would appreciate the help.


I have had this error before.

First, make sure any of your apps such as the one you have timerLed does not use any of the IoT GPIOs where your wifi card is (typically IoT0).

Also, before you run $wifi client scan, you should run

root@swi-mdm9x15:~# wifi client start

only once. I noticed that if you run that command more than once, sometimes the $wifi client scan throws the error you have. If you accidentally do this, just reboot your target. If that doesn’t fix it, I suggest you update your firmware version first.