Wifi Connect Fails

Hello, I’m currently programming for WP7611 with Legato version 19.11.3. I’m facing an issue where if I try to connect to a hotspot on an iphone, I’m getting timeouts (-8 return code) at first and then upon successive connection attempts I’m getting error le_wifiClient_Connect failed: -14. It looks based on logs that is because of error in the wifi service.

pa_wifi_client.c pa_wifiClient_Connect() 1079 | WPA_SUPPLICANT is running already

If a connection fails to happen because of timeout, is there any cleanup needed before a second attempt?

> Dec 30 15:04:50 swi-mdm9x28-wp user.info Legato:  INFO | SXMwifi[4460]/CustomWifi T=main | SXMwifi_client.c WifiSearchScanResults() 173 | Found:	SSID:	"ATT5cek2PE"	BSSID:	"e0:22:03:a5:84:2d"	Strength:-71	Ref:0x6f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 987 | Get next AP
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c IsScanRunning() 584 | IsScanRunning .0
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 1004 | AP ref = 0x26f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 1014 | AP ref = 0x26f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetSsid() 1134 | AP ref 0x26f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetSsid() 1154 | apPtr->AccessPoint.ssidLength 13
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetBssid() 1082 | AP ref 0x26f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetSignalStrength() 1045 | Get signal strength
Dec 30 15:04:50 swi-mdm9x28-wp user.info Legato:  INFO | SXMwifi[4460]/CustomWifi T=main | SXMwifi_client.c WifiSearchScanResults() 173 | Found:	SSID:	"TheDangerZone"	BSSID:	"00:11:32:ce:b7:eb"	Strength:-50	Ref:0x26f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 987 | Get next AP
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c IsScanRunning() 584 | IsScanRunning .0
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=WiFi Client Scan Thread | le_wifiClient.c PaEventHandler() 199 | Event: 2 
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 1004 | AP ref = 0x46f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 1004 | AP ref = 0x66f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 1004 | AP ref = 0x86f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 1014 | AP ref = 0x86f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetSsid() 1134 | AP ref 0x86f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetSsid() 1154 | apPtr->AccessPoint.ssidLength 9
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetBssid() 1082 | AP ref 0x86f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetSignalStrength() 1045 | Get signal strength
Dec 30 15:04:50 swi-mdm9x28-wp user.info Legato:  INFO | SXMwifi[4460]/CustomWifi T=main | SXMwifi_client.c WifiSearchScanResults() 173 | Found:	SSID:	"iPhoneSXM"	BSSID:	"7a:4f:04:57:c6:c6"	Strength:-53	Ref:0x86f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 987 | Get next AP
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c IsScanRunning() 584 | IsScanRunning .0
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 1004 | AP ref = 0xa6f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 1014 | AP ref = 0xa6f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetSsid() 1134 | AP ref 0xa6f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetSsid() 1154 | apPtr->AccessPoint.ssidLength 13
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetBssid() 1082 | AP ref 0xa6f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetSignalStrength() 1045 | Get signal strength
Dec 30 15:04:50 swi-mdm9x28-wp user.info Legato:  INFO | SXMwifi[4460]/CustomWifi T=main | SXMwifi_client.c WifiSearchScanResults() 173 | Found:	SSID:	"TheDangerZone"	BSSID:	"00:11:32:ce:c1:97"	Strength:-66	Ref:0xa6f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 987 | Get next AP
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c IsScanRunning() 584 | IsScanRunning .0
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_GetNextAccessPoint() 1019 | AP not found
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | configTreeApi.c le_cfg_CreateReadTxn() 260 | ** Creating a new read transaction on path <wifiService:/wifi/channel/iPhoneSXM>.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | treeUser.c GetUserInfo() 240 | ** Found user <0xb6ee47b8>: 'root', 0 with default tree, 'system'.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | treeUser.c tu_GetRequestedTree() 454 | ** Specific tree requested, 'wifiService'.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/framework T=main | timer.c le_timer_Start() 1104 | Starting timer 'Transaction Timer'
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | nodeIterator.c ni_CreateIterator() 302 | Created a new read iterator object <0x7f5904c0> for user 4294967295 (<Internal User>) on tree system.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | nodeIterator.c ni_Release() 423 | Releasing iterator, <0x7f5904c0> with a lifetime of 0 seconds.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | nodeIterator.c ni_Close() 457 | Closing iterator, <0x7f5904c0>.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/framework T=main | timer.c le_timer_Start() 1104 | Starting timer 'Transaction Timer'
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | nodeIterator.c ni_CreateIterator() 302 | Created a new read iterator object <0x7f5904c0> for user 0 (root) on tree wifiService.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | nodeIterator.c ni_CreateRef() 337 | Created a new reference <0x69> for iterator <0x7f5904c0>.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | configTreeApi.c le_cfg_NodeExists() 887 | ** Checking to see if an iterator's <0x69> current node exists.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | configTreeApi.c le_cfg_NodeExists() 888 | ** Offset by "secProtocol"
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | treeUser.c GetUserInfo() 240 | ** Found user <0xb6ee47b8>: 'root', 0 with default tree, 'system'.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_LoadSsid() 2003 | No wifi security protocol set at wifiService:/wifi/channel/iPhoneSXM/secProtocol
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c WifiClient_LoadSecurityConfigs() 1882 | Successfully retrieved security parameters for protocol 0 over SSID iPhoneSXM
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c IsScanRunning() 584 | IsScanRunning .0
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c FindAccessPointRefFromSsid() 265 | Find AP from SSID
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c FindAccessPointRefFromSsid() 279 | Found apRef 0x66f
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_SetSecurityProtocol() 1406 | Set security protocol
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | pa_wifi_client.c pa_wifiClient_SetSecurityProtocol() 835 | Security protocol: 0
Dec 30 15:04:50 swi-mdm9x28-wp user.info Legato:  INFO | wifiService[1968]/daemon T=main | le_wifiClient.c WifiClient_LoadSecurityConfigs() 1943 | Succeeded to set into wifiClient security parameters of protocol 0 for SSID iPhoneSXM
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | configTreeApi.c le_cfg_NodeExists() 887 | ** Checking to see if an iterator's <0x69> current node exists.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | configTreeApi.c le_cfg_NodeExists() 888 | ** Offset by "hidden"
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | treeUser.c GetUserInfo() 240 | ** Found user <0xb6ee47b8>: 'root', 0 with default tree, 'system'.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | configTreeApi.c le_cfg_CancelTxn() 349 | ** Cancelling a transaction on iterator ref: <0x69>.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | treeUser.c GetUserInfo() 240 | ** Found user <0xb6ee47b8>: 'root', 0 with default tree, 'system'.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | nodeIterator.c ni_Release() 423 | Releasing iterator, <0x7f5904c0> with a lifetime of 0 seconds.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | nodeIterator.c ni_Close() 457 | Closing iterator, <0x7f5904c0>.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | nodeIterator.c ni_Close() 460 | Releasing associated reference, <0x69>.
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | configTree[1057]/configTree T=main | requestQueue.c ProcessRequestQueue() 256 | ** Processing request queue now.
Dec 30 15:04:50 swi-mdm9x28-wp user.info Legato:  INFO | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_LoadSsid() 2034 | Succeeded to create AP reference 0x66f for SSID iPhoneSXM
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | SXMwifi[4460]/CustomWifi T=main | SXMwifi_client.c WifiSearchScanResults() 186 | Successfully set the AP ref for the SSID
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_SetPassphrase() 1211 | Set passphrase
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | pa_wifi_client.c pa_wifiClient_SetPassphrase() 1253 | Set passphrase
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | pa_wifi_client.c pa_wifiClient_SetPassphrase() 1258 | Set passphrase
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | SXMwifi[4460]/CustomWifi T=main | SXMwifi_client.c WifiSearchScanResults() 198 | Successfully set the passphrase
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_SetSecurityProtocol() 1406 | Set security protocol
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | pa_wifi_client.c pa_wifiClient_SetSecurityProtocol() 835 | Security protocol: 3
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | SXMwifi[4460]/CustomWifi T=main | SXMwifi_client.c WifiSearchScanResults() 210 | Successfully set the security protocol
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_AddConnectionEventHandler() 736 | Add wifi connection event handler
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | le_wifiClient.c le_wifiClient_Connect() 1562 | SSID length 9 | SSID: "iPhoneSXM"
Dec 30 15:04:50 swi-mdm9x28-wp user.info Legato:  INFO | wifiService[1968]/daemon T=main | pa_wifi_client.c pa_wifiClient_Connect() 1053 | Connecting over SSID length 9 SSID: "iPhoneSXM"
Dec 30 15:04:50 swi-mdm9x28-wp user.debug Legato:  DBUG | wifiService[1968]/daemon T=main | pa_wifi_client.c GenerateWpaSupplicant() 902 | Generate Wpa Supplicant
Dec 30 15:04:50 swi-mdm9x28-wp user.info Legato:  INFO | wifiService[1968] | WIFICLIENT_CONNECT
Dec 30 15:04:50 swi-mdm9x28-wp user.info Legato:  INFO | wifiService[1968] |  3474 ?        00:00:00 wpa_supplicant
Dec 30 15:04:50 swi-mdm9x28-wp user.warn Legato: -WRN- | wifiService[1968]/daemon T=main | pa_wifi_client.c pa_wifiClient_Connect() 1079 | WPA_SUPPLICANT is running already
Dec 30 15:04:50 swi-mdm9x28-wp user.err Legato: =ERR= | SXMwifi[4460]/CustomWifi T=main | SXMwifi_client.c WifiSearchScanResults() 222 | ERROR::le_wifiClient_Connect failed: -14

Is it working fine for fw r13?

To make second attempt, you need to “wifi client stop”, also you might need to “app restart wifiService”

I have not tried in the R13 as there is none for WP7611. Only R16 firmware release on source sierra website. I’m making a custom application and everything works fine when connecting to home router, but when connecting to iPhone hotspot for tests, I get this intermittent behavior. How would I trigger the wifiService to restart via my custom app to account for this corner case?

You can write a script to trigger wifiservice restart