<?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>Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53269/writing-values-to-characteristics-in-the-image-transfer-demo</link><description>Hello, I&amp;#39;ve set up the image transfer app from Nordic Playground with the idea in mind to remove the Android App from the equation. I&amp;#39;ve picked through the Android app itself, and have found the characteristics advertised on the Nordic nrf52-DK necessary</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Nov 2019 09:27:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53269/writing-values-to-characteristics-in-the-image-transfer-demo" /><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/218755?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2019 09:27:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1b78391-90f8-4ca4-bd8b-b9366dac9ac9</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the HCI log on the Linux side I believe?&lt;/p&gt;
&lt;p&gt;I am thinking of sniffer trace of what is happening over the air, similar to what you get from an Ellisys or Frontline Bluetooth sniffer, or the free &lt;a href="https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE"&gt;Nordic sniffer&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/218623?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 14:39:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f40c60b-dd12-465a-872d-bfe5fbebf078</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Hi Tor,&lt;/p&gt;
&lt;p&gt;I made a post in this thread on October 23rd, 2019 at 16:22 with bluetooth sniffer logs. There are pictures of connections, and attempted image transfers on both the working and the non working devices.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/218451?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 09:07:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16ccd66d-efe3-4722-8a5c-31bc2020c7ad</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Richard&lt;/p&gt;
&lt;p&gt;Do you have some sort of BLE sniffer so you can see what&amp;#39;s happening over the air when the Linux device is communicating with the image transfer demo?&lt;/p&gt;
&lt;p&gt;Then I might be able to spot the issue without needing to test it myself on the same hardware.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/217835?ContentTypeID=1</link><pubDate>Thu, 31 Oct 2019 18:33:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:690bd05a-9ab2-4924-b198-133cffd7d90a</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Hi Tor,&lt;/p&gt;
&lt;p&gt;So I tested out the &amp;quot;ble_app_uart&amp;quot; demo on the nordic board, and I was successfully able to write to the device using my Bluetoothctl tool on the Linux device that has been having trouble.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When I write data from Linux device, the data shows up on the Serial port that the nordic device is connected to.&amp;nbsp;Additionally, I was also able to write to that same serial port and have the data propagate up through the notify channel back to my tool on the Linux device&lt;/p&gt;
&lt;p&gt;So as far as I can tell, this UART demo works perfectly on my system. That seems to confirm that the odd behavior on the image transfer program is isolated to just that program, and the way my bluetooth chip handles the interaction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/217466?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2019 09:26:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ee52bb5-0bbb-46a1-a362-d8fd69f5889d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Richard&lt;/p&gt;
&lt;p&gt;Have you tried to connect to one of the simpler Nordic examples?&lt;/p&gt;
&lt;p&gt;Such as the ble_app_uart or ble_app_hrs example.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It would be interesting to know if this is a general problem with the Nordic examples, or something exclusive to the image transfer demo.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am not very familiar with Linux BLE programming, but will get some help from one of the gurus in the office.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/217202?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 19:21:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f383810a-8d18-48f6-a2ce-87ea4fe2d6ac</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;So to update:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I decided to port my entire build system to Linux, and I am able to successfully connect to the Nordic board via Bluetoothctl. Everything works as intended using this tool in the current linux environment...&lt;/p&gt;
&lt;p&gt;The problem that I am now facing, is that I can&amp;#39;t seem to connect to the board with code that I&amp;#39;ve written. Most notably, I&amp;#39;m not able to connect to a socket created to communicate with the board. I am receiving an &amp;quot;OPERATION NOW IN PROGRESS&amp;quot; error, which denotes that the I&amp;#39;m checking the return value for&amp;nbsp;&lt;strong&gt;connect()&lt;/strong&gt; before the board returns. My code works with all other bluetooth devices that I&amp;#39;ve paired it with, except for the Nordic. I&amp;#39;ve attached a picture of the function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I know that the original intention of this demo was the connect to Android, so I&amp;#39;m wondering if there are any special security levels or whitelisting that is required to connect to the board with a socket? As far as the board goes, I&amp;#39;m not even seeing an attempt at connection. I can confirm the socket code I&amp;#39;m using now work elsewhere, so I&amp;#39;m thinking that maybe it&amp;#39;s returning faster than it can connect to the Nordic board.&lt;/p&gt;
&lt;p&gt;Any tips connecting to the Nordic board manually would be helpful.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/741x1362/__key/communityserver-discussions-components-files/4/2806.Code.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/216932?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 20:22:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75fff228-e264-44cd-97ee-04fcbfe9c484</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Hi Tor,&lt;/p&gt;
&lt;p&gt;I am using a Qualcomm QCA9377 chipset for the Bluetooth. We are looking to see if we can update the firmware.&lt;/p&gt;
&lt;p&gt;Additionally, the LE Create Connect packet can be seen in both of the log pictures above. Both return a &amp;quot;Success 0x00&amp;quot; status, and are then followed by a &amp;quot;LE Connection Complete&amp;quot; event where the information about the connection is delivered, such as MAC and Peer Address.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/216771?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2019 08:32:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bde18fd7-a2ad-448f-b3d3-0c9fb82a469c</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the added logs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t seem to find the LE Create Connection packet for the non working device, showing the very start of connection establishment. Do you have this also?&lt;/p&gt;
&lt;p&gt;Do you know what kind of Bluetooth hardware is used by the non working device?&lt;br /&gt;Is it some kind of Bluetooth dongle?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/216459?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2019 20:22:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64778557-24df-4f49-af9b-12052a4fc6e6</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;I&amp;#39;ve taken some more snippets of the successful image transfer, and an unsuccessful image transfer, as well as the connection messages for both sides. Something interesting that I&amp;#39;ve noticed on the client that&amp;#39;s having trouble, is that there seems to be a&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Linux-Connection-log.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Here the connection log on the working device&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Linux-Image-Transfer.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;And here is a successful start to an image transfer. A notification comes up through 6e400004 (handle 0x0012) and then the image transfer data begins streaming over 6e400003.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/CCR-Connection-log.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Here is the device connection on the non-working device.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/CCR-Image-Transfer.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;And here is the unsuccessful image transfer on the non-working device. The image info notification propagates up through 6e400004, but nothing comes up through 6e400003, and the device times out. I can&amp;#39;t see anything that explains the problems from this picture, other than the fact that the device that doesn&amp;#39;t work isn&amp;#39;t getting the notifications with the image data.&lt;/p&gt;
&lt;p&gt;Something else that I&amp;#39;ve noticed that is different between the two, is that the non-working device records this odd bluetooth event every ~15 seconds while idle, although the timing is inconsistent. The working device does not record this message while idle. This might not be related to the problem, but I figured that I would include it.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Keep-Alive-Packets.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/216368?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2019 12:28:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59ac2aaa-c5ab-4778-aa6b-eb3186f52d05</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That is interesting.&amp;nbsp;Are you able to compare the Bluetooth sniffer logs between the two implementations to see if you can spot the difference there?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/216247?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2019 21:23:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ce750c0-2991-456f-9ca4-38b237197f85</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;So, I decided to try and connect the Nordic device to a laptop running the same version of Bluetoothctl. Once connected,&lt;em&gt;&lt;strong&gt; I was able to send and receive all commands correctly&lt;/strong&gt;&lt;/em&gt;, proving that Bluetoothctl is capable of communicating with the Image Transfer code on the Nordic Device.&lt;/p&gt;
&lt;p&gt;That tells me that my original problem is a problem confined to the Linux box that I&amp;#39;m trying to use Bluetoothctl on. I will continue to try and figure out what could be different on the Linux Box vs. my Laptop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/216198?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2019 13:53:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4138cabc-6d5a-43fa-aa24-315892df2aac</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Hi Tor,&lt;/p&gt;
&lt;p&gt;As I&amp;#39;ve experimented more with the image transfer, I can see that you are correct in your explanation that the Nordic board frequently returns NRF_ERROR_RESOURCES, and then recovers as it receives&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE&amp;nbsp;notifications.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The descrepency in behaviors seem to stem from the fact that BLE_GATTS_EVT_HVN_TX_COMPLETE&amp;nbsp;notifications are not being returned, therefore the buffers never get rewritten and the process times out.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Where would you suggest we go from here?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/216062?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2019 07:26:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8a89c7f-13b2-4d18-808b-252d0d4eab12</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Richard&lt;/p&gt;
[quote user="richardcoffey"]Could it be possible that there is another layer of communication that the nRFConnect app performs with the Nordic board that we could be missing? [/quote]
&lt;p&gt;nRF Connect should go through service discovery, and should respond to requests from the peripheral to update GAP parameters (connection parameters) and GATT parameters (MTU size, data length). These settings might differ when using Bluetoothctl, depending on what parameters they support, but I don&amp;#39;t understand why that should lead to such a big difference in behavior.&amp;nbsp;&lt;/p&gt;
[quote user="richardcoffey"]Do you think you might be able to give me some insight into the &lt;strong&gt;ble_evt_t&lt;/strong&gt; ID&amp;#39;s that I am seeing? Specifically the events 80, 85, and 87? In the&amp;nbsp;&lt;strong&gt;ble_evt_handler()&lt;/strong&gt; function, all three of those ID&amp;#39;s are not caught by the switch statement, but they seem to come up frequently.[/quote]
&lt;p&gt;The ID&amp;#39;s are grouped by which sub-module in the Bluetooth stack they originate from (such as GAP, GATT server and GATT client). The event ranges are defined in ble_ranges.h, and here you can see that events 80, 85 and 87 belong to the GATT server module (as this corresponds to event 0x50, 0x55 and 0x57 in hex).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The exact events are defined in header files specific to the sub module, such as ble_gap.h, ble_gattc.h and ble_gatts.h.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Looking at ble_gatts.h you can see that 0x50, 0x55 and 0x57 corresponds to the following events:&lt;/p&gt;
&lt;p&gt;BLE_GATTS_EVT_WRITE - a write was performed on one of your characteristics&lt;/p&gt;
&lt;p&gt;BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST - the client is requesting to start an MTU request procedure&lt;/p&gt;
&lt;p&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE - one or more notifications&amp;nbsp;have successfully been sent&lt;/p&gt;
&lt;p&gt;While it is true these events are not handled in the main file directly all of them should be processed by one of the other modules in your application, such as the BLE service implementations or the&amp;nbsp;nrf_ble_gatt.c module, so I don&amp;#39;t think these events help much in tracking down the issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user="richardcoffey"][/quote]&lt;/p&gt;
&lt;p&gt;So I&amp;#39;ve determined that the Nordic board is running into a problem in&amp;nbsp;&lt;strong&gt;ble_its_string_send()&lt;/strong&gt;. The function&amp;nbsp;&lt;strong&gt;sd_ble_gatts_hvx()&lt;/strong&gt; seems to queue too many notifications when trying to send a file, and returns an NRF_ERROR_RESOURCES.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This gets the Nordic board stuck in a while loop in main.c at the very bottom, in the line&lt;/p&gt;
&lt;p&gt;&amp;quot;while(ret_code == NRF_SUCCESS)&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Getting the NRF_ERROR_RESOURCES error is normal and expected. They way to maximize throughput is to push data to the stack quickly, and hold back once this error is returned. When you get the&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE in return from the SoftDevice this means more buffers are freed up and you can continue to send more data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you look at line 413 of ble_image_transfer_service.c you can see the handling of this event, and how it will continue uploading more data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you say it gets stuck in the&amp;nbsp;&lt;em&gt;while(ret_code == NRF_SUCCESS)&amp;nbsp;&lt;/em&gt;check, are you sure it really gets stuck here?&lt;br /&gt;That should only happen if the&amp;nbsp;ble_its_send_file_fragment(..) function keeps returning NRF_SUCCESS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you put some log output or toggle a pin after the while loop, will you not see the code reaching here?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/216018?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 20:21:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f385fdb3-b577-4c25-bb42-8b017d0fc171</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Another Update:&lt;/p&gt;
&lt;p&gt;So I&amp;#39;ve determined that the Nordic board is running into a problem in&amp;nbsp;&lt;strong&gt;ble_its_string_send()&lt;/strong&gt;. The function&amp;nbsp;&lt;strong&gt;sd_ble_gatts_hvx()&lt;/strong&gt; seems to queue too many notifications when trying to send a file, and returns an NRF_ERROR_RESOURCES.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This gets the Nordic board stuck in a while loop in main.c at the very bottom, in the line&lt;/p&gt;
&lt;p&gt;&amp;quot;while(ret_code == NRF_SUCCESS)&amp;quot;&lt;/p&gt;
&lt;p&gt;right after&amp;nbsp;&lt;strong&gt;ble_its_send_file_fragment&lt;/strong&gt; function. After about 4 iterations of the resources error, the board times out and disconnects! So now the problem is trying to figure out why the notifications are getting queued but not taken out of the queue. I run into a problem here because I can&amp;#39;t seem to find the inner workings of&amp;nbsp;&lt;strong&gt;sd_ble_gatts_hvx().&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;In the file ble_gatts.h, the function description seems to mention that we should try &amp;quot;waiting for a BLE_GATTS_EVT_HVN_TX_COMPLETE event and retry&amp;quot;. Any idea where to go from here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/216017?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 18:57:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb963ae5-86bc-476c-85c4-dc00a0972b2c</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;I&amp;#39;ve also discovered that I can get the Nordic board to recover from it&amp;#39;s suspended state by doing the following:&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&amp;nbsp;Send the Nordic board a write request for a single capture (0x01) with my Bluetoothctl tool&lt;/li&gt;
&lt;li&gt;&amp;nbsp;The Nordic board will send a small string through 6e400004 (like normal) but nothing will come through 6e400003. The Nordic board is now in a weird state, and will then disconnect.&lt;/li&gt;
&lt;li&gt;Then, I can connect the still running Nordic board to the nRFConnect app&lt;/li&gt;
&lt;li&gt;And then, if I write a &amp;quot;0x06&amp;quot; to request BLE params, I will get the typical info from 6e400004 that sending a &amp;quot;0x06&amp;quot; does,&amp;nbsp;&lt;em&gt;but I will also get image data&amp;nbsp; coming up through 6e400003!&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So, it seems as if capture image command is blocking somewhere! All we have to do is determine where it&amp;#39;s blocking, and why sending it another command seems to let the blocked notifications come through.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/216016?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 18:36:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6746bb8c-7d65-4bf1-852e-71b8b2e3a8d3</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Hi Tor,&lt;/p&gt;
&lt;p&gt;Do you think you might be able to give me some insight into the &lt;strong&gt;ble_evt_t&lt;/strong&gt; ID&amp;#39;s that I am seeing? Specifically the events 80, 85, and 87? In the&amp;nbsp;&lt;strong&gt;ble_evt_handler()&lt;/strong&gt; function, all three of those ID&amp;#39;s are not caught by the switch statement, but they seem to come up frequently.&lt;/p&gt;
&lt;p&gt;It is a bit difficult to determine where these codes originate from, as the &lt;strong&gt;ble_evt_t&amp;nbsp;&lt;/strong&gt; type contains a bunch of additional event types. The &amp;quot;header&amp;quot; value is where I&amp;#39;m getting the numbers 80,85, and 87. Perhaps knowing what those values denote will help me track down where the data is getting lost/not sent.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/215969?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 14:00:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a502eb0-5925-4e47-8278-af9c689e5e79</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Hi Tor,&lt;/p&gt;
&lt;p&gt;I do not know how to send a write command in the Bluetoothctl, as far as I know all the commands are write requests. I will look into it.&lt;/p&gt;
&lt;p&gt;What stumps me is that the nordic nRFConnect app sends write requests, and that command flow works very well most of the time. Additionally, sending write requests to change things like resolutions and PHY layer configurations works on Bluetoothctl, and the notifications come back on UUID 6e400004 successfully.&lt;/p&gt;
&lt;p&gt;We are looking more into the C code to learn about the states.&lt;/p&gt;
&lt;p&gt;Could it be possible that there is another layer of communication that the nRFConnect app performs with the Nordic board that we could be missing? Considering that the Nordic device seems to become unresponsive when starting &lt;em&gt;just&lt;/em&gt; image transfers, we are thinking that maybe it&amp;#39;s blocking on a configuration setting that we failed to setup.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/215660?ContentTypeID=1</link><pubDate>Fri, 18 Oct 2019 08:47:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23277fb5-cb47-4b1c-a80b-272979ff64af</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Richard&lt;/p&gt;
&lt;p&gt;The 17 event is simply the disconnected event, and the link has already disconnected once this event is forwarded.&amp;nbsp;&lt;br /&gt;You could try to print the disconnect reason inside the event, like this:&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO(&amp;quot;Disconnected. Reason: %i&amp;quot;, p_ble_evt-&amp;gt;evt.gap_evt.params.disconnected.reason);&lt;/p&gt;
&lt;p&gt;Another thing you could try is to send write command rather than a write request from the bluetoothctl side. In theory both should work, but it is possible that the write response is somehow delayed when you start sending a lot of notifications on the 6e400003 characteristic, and that this will cause issues.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you send a write command you are not dependent on getting an explicit ACK from the server side, and this is&amp;nbsp;the intended behavior.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you know how to change from a write request to a write command through the bluetoothctl API&amp;#39;s?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/215604?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 19:20:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e96d0e02-b063-467e-8f0e-557fa7e78117</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Another comment, when the device gets stuck in a weird state while experimenting with the nRFConnect app, refreshing the services (with the refresh services button that appears to call &amp;quot;&lt;strong&gt;gatt.refresh()&lt;/strong&gt;&amp;quot;) seems to trigger the command that was queued up. Unfortunately I have no way of refreshing the services using my bluetoothctl tool on ubuntu.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/215597?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 18:14:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ca588b3-e2d0-4007-a93b-420046948064</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;I would also like to mention, that from a clean reboot, any request for information, whether it be a StartStream, StartSingleCapture, etc, leads to a &amp;quot;Connection Timeout&amp;quot;.&lt;/p&gt;
&lt;p&gt;The data that I receive in the 3rd picture above from UUID 6e400004 of&amp;nbsp;&lt;strong&gt;{0108180000}&amp;nbsp;&lt;/strong&gt;is the same data I get from that UUID when I successfully transfer data from the Nordic Device to the nRFConnect app. This is telling me that setting the notification for that UUID is working, and that it&amp;#39;s specifically the reception of the data on UUID 6e400003 that is causing the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/215591?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 17:44:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d00c404a-b22d-48c2-9636-24d46d3bbae3</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Hi Tor,&lt;/p&gt;
&lt;p&gt;On connection, it seems like the CCCD for UUID&amp;#39;s 6e400003 and 6e400004 have already been set to {01, 00}. That being said, I did also set notifications on the UUID&amp;#39;s themselves. I was not setting the notifications for the image transfer info UUID, but now that I am, I am getting a return value of 0, which means that it was a success!&lt;/p&gt;
&lt;p&gt;However, I am still seeing a disconnection after that request. I added some prints to display the event id in&amp;nbsp;&lt;strong&gt;ble_evt_handler(),&amp;nbsp;&lt;/strong&gt;and I will also post the data from my bluetooth sniffer, as well as the program that I&amp;#39;m using the interface with the Nordic Device.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Segger-log.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Here is a snip of the Segger logs, where the image is clearly taken, with a successful return value. The &amp;quot;Current Event State&amp;quot; of 17 is of interest here, as this is the value that the &lt;strong&gt;p_ble_evt-&amp;gt;header.evt_id&amp;nbsp;&lt;/strong&gt;has before entering into the switch statement in the&amp;nbsp;&lt;strong&gt;ble_evt_handler()&amp;nbsp;&lt;/strong&gt;function before a time out.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Write-to-characteristic.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Here is a snippet of me writing to UUID 6e400002. The value of the attribute is already {0x01}, but writing another {0x01 00} causes it to disconnect.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/bluetooth-sniffer.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;And then here are the logs of my bluetooth sniffer, in which you can see that I receive a notification from what looks like UUID 6e400004, but nothing from the UUID 6e400003, before receiving a connection timeout.&lt;/p&gt;
&lt;p&gt;I can confirm that both UUID&amp;#39;s (6e400003/4) had notifications enabled. Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/215485?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 11:24:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22833a3a-672f-4878-940d-633a560c1117</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Richard&lt;/p&gt;
&lt;p&gt;If you look at the&amp;nbsp;ble_its_img_info_send(..) implementation it will return NRF_ERROR_INVALID_STATE either if you are not connected or if the notifications are not correctly set on&amp;nbsp;that characteristic (&lt;span&gt;6e400004).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I assume you are connected, so most likely the issue is that the notifications are not properly enabled.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;One thing that can be confusing with BLE is the endianness of multi byte values. To enable notifications you should send 0x0001 to the CCCD, but when breaking this up into multi byte commands you often have to send {0x01, 0x00} rather than {0x00, 0x01} for the data to be properly interpreted.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Maybe you could show me the code you use to enable the notifications?&lt;br /&gt;There might be some issue here that prevents the notifications from being enabled properly.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;br /&gt;Torbjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/215379?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 20:05:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:062f2658-1f17-43e2-8367-848499d73b81</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Update 4:02PM EST&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve traced the disconnection error to the &lt;strong&gt;ble_its_img_info_send()&lt;/strong&gt;&amp;nbsp;function. It returns a value of 8, which according to the documentation denotes an &lt;strong&gt;NRF_ERROR_INVALID_STATE&amp;nbsp;&lt;/strong&gt;error.&lt;/p&gt;
&lt;p&gt;As previously mentioned, this only happens when sending the bits with Bluetoothctl, not with the nrfConnect app. I will continue to look into what could be causing it to get to a bad state.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/215370?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 17:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7fa4f2d-f48c-4887-80db-2bef4994c72c</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;In particular, I am seeing a timeout when I request a StartSingleCapture (sending a 0x01 byte) on UUID 6e400002 before I&amp;#39;ve received the data for another StartSingleCapture. Starting and stopping stream mode does not have this issue, and can be requested repeatedly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing Values to Characteristics in the Image Transfer Demo</title><link>https://devzone.nordicsemi.com/thread/215363?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 15:49:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a423fa9-dac5-468f-aba8-c36d84cd464f</guid><dc:creator>richardcoffey</dc:creator><description>&lt;p&gt;Additionally, I&amp;#39;m seeing Connection Timeouts quite frequency when reading/writing from the UUID&amp;#39;s.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>