<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28454/connection-between-android-phone-and-nrf52</link><description>Hello, 
 I&amp;#39;m having problems getting a stable channel from an Android device (LG K8) and the nRF52 development board. It is hard to tell whether which side is causing the problems. What happens is that one of the side believes that the data is sent,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Dec 2017 17:03:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28454/connection-between-android-phone-and-nrf52" /><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112424?ContentTypeID=1</link><pubDate>Mon, 18 Dec 2017 17:03:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe2629f0-46d0-4444-a134-94d0d1fdfbe6</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Those should not infect one another, in my opinion. Ensure only, that you are doing all the ble operations from the same thread, preferably main thread. This apparently helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112423?ContentTypeID=1</link><pubDate>Mon, 18 Dec 2017 16:59:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21471307-6fee-4e2f-a9e0-1e0ade55e148</guid><dc:creator>sijohans</dc:creator><description>&lt;p&gt;We are using this BLE channel to simulate UART (very similar to nodric UART), on this channel we establish an encrypted channel similar to TLS. Between the first message received and the thirds message received we do some heavy crypto calculations (x25519 key agreement). This is done by a completely other thread so we do not block any gatt callbacks. However, do gain good performance on the crypto operations we use a library that is written in native C code (libsodium). Can the binding between java and the C code somehow affect the android OS handling of all BLE stuff?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112421?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 08:33:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed214d86-a746-4333-a2a2-6775c0921ea4</guid><dc:creator>sijohans</dc:creator><description>&lt;p&gt;Thanks for good comments. I tried reverting to an older version of our application, with this version everything is more stable even tough the code for the BLE connection is not changed. However, we have added other services (not related to BLE), that communicates with a server and some other tasks. There might be some threading issues with these services that causes the issue with the Bluetooth. I don&amp;#39;t have a lot of knowledge how to communication between the application - android os - Bluetooth controller works, but perhaps some of our processes affects that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112422?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 08:05:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea2ee5d6-8b6d-4c0d-9f3f-e8df917f756f</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;The case when the Bluetooth on a phone get into a state when it needs to be restarted (or, sometimes, the phone needs reset as the Bluetooth doesn&amp;#39;t turn off) is caused by some leakage or similar error in the Android, or its ble stack. There is not much you can do. Perhaps adding some more delays here and there to give the adapter time to rethink its life... Gladly I didn&amp;#39;t see this kind of problems or recent phones, that is Android 5 or maybe 6 or newer, or with newer chipsets, so in few years it will solve itself as the phone will be replaced. As I wrote, all you can do is try some workarounds, add delays, change mtu, etc. Or disable some known phones/tablets (Nexus 4 &amp;amp; 7) on Google play.
The code you have should work, from what I see. Nothing wrong there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112420?ContentTypeID=1</link><pubDate>Tue, 12 Sep 2017 13:44:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77ddcd3b-7f2a-4920-a79b-91e3ca63015b</guid><dc:creator>sijohans</dc:creator><description>&lt;p&gt;It does not happen 100% of the times. I don&amp;#39;t know what event causes the this trouble to begin, but when it happens there is no turning back without restarting Bluetooth on the Android device. From the HCI log i could actually see that the nRF52 side in this case also request the MTU negotiation. However, i found no API in Android to see what the current maximum MTU is, therefore we also negotiate it. We talk to devices that supports only 23 (20 bytes effective data) and 247 (243 bytes effective data). I will test using only 20 bytes effective to see if this occurs. With other phones, this works better but sometimes we end up in this scenario also.&lt;/p&gt;
&lt;p&gt;Have you seen any of these issues with your applications with specific Android devices?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112419?ContentTypeID=1</link><pubDate>Tue, 12 Sep 2017 10:41:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cab4c52-c8b5-4bd8-b2cf-908b6cf087a6</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Does it happen 100% times? Have you tried another phone, perhaps with a never version of Android, or with a different chipset? Im my opinion it&amp;#39;s something in LG&amp;#39;s custom Android version.
Have you tried sending data with smaller mtu, or just in a chain of 20 bytes withouts seeing the mtu at the beginning?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112417?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 14:59:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dcb65be-e997-4352-b8e2-bf5b3f9cecb6</guid><dc:creator>sijohans</dc:creator><description>&lt;p&gt;Okey, i used a sniffer tool now and as i assumed, the packages is never send on/to the radio. So this is most likely an android issue.&lt;/p&gt;
&lt;p&gt;However, no idea of how to proceed with this issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112418?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 13:09:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf8a438d-9c2f-43c9-a23a-7f600c869860</guid><dc:creator>sijohans</dc:creator><description>&lt;p&gt;From the nRF52 side i can see the connection and everything. I can see the first messages received, but later when the package loss starting to happens i see nothing. I will try using a sniffer today to see if the packages are seen on the radio. If not, i think i can assume that this is an android issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112416?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 07:44:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc6682d4-f32b-4c9f-9733-b58438eb1536</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Do you get any useful debug info out of the nRF52? Are you able to provide a sniffer trace? You can use a nRF51 DK and our &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.tools/dita/tools/sniffer/sniffer_intro.html?resultof=%22%73%6e%69%66%66%65%72%22%20"&gt;Sniffer solution&lt;/a&gt; if you don&amp;#39;t have any professional equipment.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112415?ContentTypeID=1</link><pubDate>Thu, 07 Sep 2017 09:39:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1356cc18-2d93-4b23-96b6-b58ce3a5c5fd</guid><dc:creator>sijohans</dc:creator><description>&lt;p&gt;Yes, a sniffer would be a really great tool at this point. If these packages are really sent over the radio i need to investigate this issue in another manner. But assuming these events are not received/handled properly by the bluetooth stack on the android side, what strategy could i use to find the cause of the problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection between Android phone and nRF52</title><link>https://devzone.nordicsemi.com/thread/112414?ContentTypeID=1</link><pubDate>Wed, 06 Sep 2017 21:19:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fc27c9b-df1f-4de2-99d7-2d8a16176dca</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Suggestion: as always there is a place where you can see the truth and that&amp;#39;s (obviously) the radio. So get some BLE radio analyzer/sniffer, lean how the stack looks like on lower layers, learn how to read the logs and then you should see clearly which side is to blame. Not saying that will necessarily lead to solution (unfortunately) but at last you will know it for sure and you might at least come up with some workaround (e.g. changing protocol or entire architecture of your BLE apps).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>