This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART Android App does not disconnect sometimes

I am just wondering if anyone else has seen this issue.

I am working on the ble_app_uart_s132_pca10040 on the nRF52 DK.

Using the Android UART v 2.0 app I can connect to the DK, read and write no problem. However when I hit the disconnect button in the app, sometimes it was not disconnecting and I was not getting an on_ble_evt call-back from the SD. Upon investigation via wireshark I noticed both the app and the DK still exchanging empty data packets even though at that point the app UI showed it was disconnected. Looking through the logs sometimes there was no disconnect message at all from the Android or it was marked as corrupted (I can't recall how it was exactly described in wireshark now). So it looks like the nRF was correct to treat the connection as still open. When I reboot the Android phone this issue goes away and normality is restored. This is on a Zopo Android ZP350 running Android 5.1. Admittedly I really thrashed it with multiple connects/disconnects before it misbehaved. Is this just me and my Zopo or do other people notice this with the UART Android App on their Androids too?

RJH

Parents
  • Ok, I think I got to the bottom of it since it happened again this evening. It occurred after I changed DEVICE_NAME from "Nordic_UART" to something else. As soon as the failure to disconnect happened in UART v 2.0 I changed the name back in the DK and opened the MCP for Android and was able to connect and disconnect fine. When I went back to UART v 2.0 the old name (i.e., my custom name) was still showing in the scans even though I had changed it back to "Nordic_UART" and it was "Nordic_UART" showing in other scanners such as LightBlue. It's as if UART v 2.0 and stored my custom name. So it appears that changing the DEVICE_NAME is causing some confusion in the Android apps making them not disconnect at times. I'll keep an eye on it and update this if I see any more.

Reply
  • Ok, I think I got to the bottom of it since it happened again this evening. It occurred after I changed DEVICE_NAME from "Nordic_UART" to something else. As soon as the failure to disconnect happened in UART v 2.0 I changed the name back in the DK and opened the MCP for Android and was able to connect and disconnect fine. When I went back to UART v 2.0 the old name (i.e., my custom name) was still showing in the scans even though I had changed it back to "Nordic_UART" and it was "Nordic_UART" showing in other scanners such as LightBlue. It's as if UART v 2.0 and stored my custom name. So it appears that changing the DEVICE_NAME is causing some confusion in the Android apps making them not disconnect at times. I'll keep an eye on it and update this if I see any more.

Children
Related