<?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>Smart Remote 3, keyboard keys are not received on Android TV when disabling power management</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48944/smart-remote-3-keyboard-keys-are-not-received-on-android-tv-when-disabling-power-management</link><description>Hi all, 
 
 I get a really weird issue developing on the smart remote 3 project. 
 I work with my own hardware design, and as I want a specific behaviour I disabled power_management go to sys off when remote is disconnecting or when the advertising stops</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Jul 2019 12:59:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48944/smart-remote-3-keyboard-keys-are-not-received-on-android-tv-when-disabling-power-management" /><item><title>RE: Smart Remote 3, keyboard keys are not received on Android TV when disabling power management</title><link>https://devzone.nordicsemi.com/thread/197147?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2019 12:59:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a54de7fd-fe59-4d41-8522-b45ce43f87d8</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Can you share some more details regarding the function you call to advertise when disconnected and a button is pressed?&lt;br /&gt;I&amp;#39;ve done some testing on a Nexus Player running Android 8.0, but haven&amp;#39;t seen the issue yet. &lt;br /&gt;&lt;br /&gt;I made the following modifications to default SR3 v1.2.1 (PCA63519 hardware) to recreate your setup:&lt;/p&gt;
&lt;p&gt;- In application sdk_config.h, set NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED 0&lt;/p&gt;
&lt;p&gt;- Remove all calls to nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF)&lt;/p&gt;
&lt;p&gt;- Added the following behavior when a button is pressed and remote is not currently connected:&lt;/p&gt;
&lt;p&gt;if (!m_coms_ble_adv_running())&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void) m_coms_ble_advertise(false);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;I also tried with m_coms_ble_advertise(&lt;strong&gt;true&lt;/strong&gt;), but this will cause the remote to erase the existing bond if CONFIG_MAX_BONDS ==1 (default value), in order to free up enough space in bond database to create new bond. In this case I ended up in an connect/disconnect cycle with the Nexus Player due to encryption failing (encryption keys erased by remote).&lt;/p&gt;
&lt;p&gt;Please let me know if I&amp;#39;m missing some important difference between our setups&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Smart Remote 3, keyboard keys are not received on Android TV when disabling power management</title><link>https://devzone.nordicsemi.com/thread/196608?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 14:14:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc4dabc0-f96c-4818-b4c0-ab21f356fc62</guid><dc:creator>sguitton01</dc:creator><description>&lt;p&gt;I&amp;#39;m on Android TV 7.1.2 with security patch from 1 december 2017 but I also get issues on android 8.0.0 with security patch from 5 december 2018&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Smart Remote 3, keyboard keys are not received on Android TV when disabling power management</title><link>https://devzone.nordicsemi.com/thread/196604?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 14:09:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09a0d610-180c-4d0d-8936-10a1fa315bf0</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Thanks for the additional information, Sylvain. What version Android TV are you testing with? We can&amp;nbsp; try to reproduce the issue here by removing nrf_pwr_mgmt_shutdown() from default code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Smart Remote 3, keyboard keys are not received on Android TV when disabling power management</title><link>https://devzone.nordicsemi.com/thread/196313?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 14:23:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37c874fc-e534-405f-adb9-58f19838e43b</guid><dc:creator>sguitton01</dc:creator><description>&lt;p&gt;Hi Edvin, Audun,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I did a lot more experimentation I know have a better diagnostic of the issue.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s the&amp;nbsp;&lt;span&gt;nrf_pwr_mgmt_shutdown() from disconnected event that when he is withdrawn causes the issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I did add&amp;nbsp; some code to start advertising if not connected when pressing a key?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I do have multiple&amp;nbsp;M_COMS_BLE_EVT_CONN_UPDATE&amp;nbsp;on android TV which I do not have on other devices.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here&amp;#39;s what I can see :&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- On first pairing with the box, everything works fine, I have all the keys and everything. If I disconnect by going out of range for example or by rebooting the remote, I still have everything OK.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- The issue appears when I reboot the box. Then I reconnect alright but I do not get the keyboard keys&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- If I have everything ok, and I reboot the box AND the remote at the same time. When I reconnect everything is alright. This is why when I keep the&amp;nbsp;nrf_pwr_mgmt_shutdown() it works.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- Once I have the issue rebooting the remote does not solve it. I must reboot, unpair and re-pair to the box&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- Something odd is that if I have the issue and I unpair the remote, connect to another device (windows or android phone) I still have the issue on these devices. I must reboot then unpair to make it work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I hope these information will be helpfull.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Sylvain&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Smart Remote 3, keyboard keys are not received on Android TV when disabling power management</title><link>https://devzone.nordicsemi.com/thread/195530?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2019 08:21:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2723dad0-0652-4068-98c9-ff6836d0ec76</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Hi Sylvain,&lt;/p&gt;
&lt;p&gt;after removing the nrf_pwr_mgmt_shutdown() calls, have you added additional logic to for example start automatically advertising when a button is pressed and there is no connection?&lt;/p&gt;
&lt;p&gt;When the problem occurs, have there been any cycles of disconnect+connect before the connection is established again? I wonder if it&amp;#39;s possible that the host has some lingering state information causing trouble.&lt;/p&gt;
&lt;p&gt;You can look at the M_COMS_BLE_EVT_CONN_UPDATE and M_COMS_BLE_EVT_CONN_SECURED log printouts and the timestamp of these logs (relative to&amp;nbsp;M_COMS_BLE_EVT_CONNECTED event printout) to see if the host behavior is consistent between the working and non-working cases. For example, normally the Host will enable encryption immediately after connecting to a paired remote, but the remote will request encryption if the Host hasn&amp;#39;t enabled it within CONFIG_ENC_REQ_DELAY ms after reconnection (ref. m_coms_ble.c::s_encryption_timer)&lt;/p&gt;
&lt;p&gt;Also, have you looked at the log output from the Android side? (&lt;a href="https://developer.android.com/studio/command-line/logcat"&gt;https://developer.android.com/studio/command-line/logcat)&lt;/a&gt; Perhaps comparing the logcat output from a working and failing case could yield some clues.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Audun&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Smart Remote 3, keyboard keys are not received on Android TV when disabling power management</title><link>https://devzone.nordicsemi.com/thread/195025?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 07:45:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a37ae4b-d47d-4036-827e-c23fe732e3cc</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you try to disable them one at the time to see if it is one of them that causes the keyboard buttons to fail? If so, which one&amp;nbsp;that causes the issue to appear?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Smart Remote 3, keyboard keys are not received on Android TV when disabling power management</title><link>https://devzone.nordicsemi.com/thread/194923?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2019 14:30:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53d9fcd6-2262-4883-9fc8-cc59b305fa80</guid><dc:creator>sguitton01</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes I mentionned that I disabled all&amp;nbsp;&lt;span&gt;&amp;nbsp;nrf_pwr_mgmt_shutdown()&amp;nbsp;and it seems that it&amp;#39;s at that point the issue appeared.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When I have the issue and pressing a button (keyboard), sd_ble_gatts_hvx() still returns NRF_SUCCESS.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Sylvain&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Smart Remote 3, keyboard keys are not received on Android TV when disabling power management</title><link>https://devzone.nordicsemi.com/thread/194537?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2019 08:10:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04a28268-685b-47cc-8a5b-ff7fcf79d16d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""](sometimes I get all of them (20% of times), or none (80%)[/quote]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Ok, so that would suggest that there is not something wrong in the way that you set up the characteristic for the HID keyboard.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t quite understand the shutdown things you explained. You disable all shutdown, so that&amp;nbsp;nrf_pwr_mgmt_shutdown() is never called? Is that correct?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you check one thing? When you press a button (keyboard key), and it doesn&amp;#39;t go through, can you find the&amp;nbsp;sd_ble_gatts_hvx() that is called when you press the key? What does it return?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>