Intermittent dropped BLE packets with AndroidBLEExample

,

Hey Colleen,

I'm actually having trouble recreating the first issue, its possible that simply power cycling the P2 fixed it. If I run into it again I'll try to post more info on it but in the meantime I'll send you the ble-provisioning.ino for now, thanks!

With the second issue of the P2 refusing to find wifi networks when it's retrying a connection, that happens consistently. In fact, even after I configure the wifi credentials the first time over BLE or through the CLI, the P2 will connect to the cloud but disconnect within 2 minutes and get stuck in a loop trying to connect. Once it's doing that I can't get scan for wifi networks.

0000012368 [comm.protocol] INFO: Received DESCRIBE request; flags: 0x04
0000125963 [ncp.rltk.client] INFO: disconnected
0000125965 [net.ifapi] INFO: Netif wl3 link DOWN, profile=NONE
0000125968 [net.rltkncp] ERROR: linkOutput up=1 link_up=0
0000125972 [system.nm] INFO: State changed: IP_CONFIGURED -> IFACE_LINK_UP
0000125975 [hal] INFO: DNS server list changed
0000125977 [hal] INFO: DNS server list changed
0000125980 [system.nm] INFO: State changed: IFACE_LINK_UP -> IFACE_UP
0000125999 [ncp.rltk.client] INFO: Try to connect to ssid: MoCAccino 5 GHz
0000126002 [net.lwip_rltk] INFO: is_promisc_enabled
0000126003 [net.lwip_rltk] INFO: get_eap_phase
0000127737 [system] ERROR: sock_send returned -1 118
0000127741 [comm.dtls] ERROR: mbedtls_ssl_write() failed: -0x4e
0000127748 [system] ERROR: sock_send returned -1 118
0000127753 [comm.dtls] ERROR: mbedtls_ssl_read() failed: -0x4e
0000127759 [comm.protocol] ERROR: Event loop error 34
0000127765 [system] WARN: Communication loop error, closing cloud socket
0000127771 [system] INFO: Cloud: disconnecting
0000127775 [system] INFO: Cloud: disconnected
0000130296 [ncp.rltk.client] INFO: disconnected
0000130797 [ncp.rltk.client] INFO: Try to connect to ssid: MoCAccino 5 GHz
0000130800 [net.lwip_rltk] INFO: is_promisc_enabled
0000130801 [net.lwip_rltk] INFO: get_eap_phase
0000135006 [ncp.rltk.client] INFO: disconnected

Edit: I wasn't seeing the first issue because I was compiling the Device OS with BLE_CHANNEL_DEBUG_ENABLED. As soon as I put another device on 5.7.0 without it I was seeing the issue again. Unfortunately that means I cant quite see what the device thinks it's sending though.
For the second issue, I think part of it may be because SYSTEM_THREAD(ENABLE); wasn't present in the demo code, so it was never my code as soon as the P2 was doing network tasks. I don't know why not having that line would also cause the device to disconnect from a network after 2 minutes, but it seems to help. Now it only has issues on the network on my office building.