<?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>Periodic Advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87769/periodic-advertising</link><description>Hi, 
 I recently started with nRF52840-DK, Zephyr and nRF Connect SDK (v. 1.9.1). I want to test extended advertising, that&amp;#39;s why I use the periodic_adv example coming with thr SDK. Compiling and downloading without problems, I see in the terminal the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Feb 2023 15:19:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87769/periodic-advertising" /><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/412320?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 15:19:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21c14a63-a947-4bd1-b446-7042eaea701c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Starbuck,&amp;nbsp;&lt;br /&gt;Please create a new ticket if you have an issue.&amp;nbsp;&lt;br /&gt;You can have a look at my example here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/88164/advertising-1650-bytes-of-host-advertising-data-in-an-auxiliary-segment-using-advertising-extensions/370439"&gt;RE: Advertising 1650 bytes of Host advertising data in an Auxiliary segment using Advertising Extensions&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I sent 800 bytes using chained advertising. The trick is to split them into smaller&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;BT_DATA.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/412271?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 12:58:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f7ca389-0ce9-49d2-821b-c76089dada0f</guid><dc:creator>Starbuck</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;In my application I need to receive 600 bytes, which requires chaining the periodic advertisements. &amp;nbsp;I&amp;rsquo;m using these same periodic advertising samples, but for NCS v 2.3.0 rc1.&lt;/p&gt;
&lt;p&gt;My issue is that the network buffer in the .&lt;span&gt;recv (recv_cb() function in periodic_sync ) doesn&amp;rsquo;t seem to support packets greater than 254 bytes. &amp;nbsp;Do you know if there&amp;rsquo;s a Kconfig option that I need to set to be able to receive 600 bytes as 1 report?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/369543?ContentTypeID=1</link><pubDate>Wed, 25 May 2022 13:03:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18602a4c-7389-4664-b305-4d131278b4da</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Axel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure why it changed like that. But from my point of view&amp;nbsp;&lt;span&gt;AUX_CHAIN_IND&amp;nbsp; is used when the length of the data exceed the maximum data to send in one packet and our stack will automatically change the advertising to chained advertising. Could you try to test with smaller data size ? Maybe the stock example when only 3 bytes are sent ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/369257?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 11:33:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d36e6ba9-6bd3-40d5-a431-546b782aecc6</guid><dc:creator>axel_s</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;meanwhile I did some tests without the periodic option. Last week there were some open points, but today I found my code behaving completely different (e.g. in the scan_recv() call-back function buf-&amp;gt;len is always 0). Therefore, I took my periodic example from last week - and it&amp;#39;s behaviour has changed too. Last week I found 3xADV_EXT_IND, one AUX_ADV_IND (containing the complete local name) and one AUX_SYNC_IND (containing the data). Now I find 3xAUX_EXT_IND, one AUX_ADV_IND (containing the data) and one AUX_CHAIN_IND (containing the complete local name).&amp;nbsp; This is strange and quite frustrating - I already opened a separate ticket. Do you know what happened here?&lt;/p&gt;
&lt;p&gt;Thanks, Axel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/368613?ContentTypeID=1</link><pubDate>Thu, 19 May 2022 12:36:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccc7fdfb-d3aa-4c44-8f0c-c239ab08e831</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Thanks for your feedback. I faced the same challenge and couldn&amp;#39;t find a good way of&amp;nbsp;exploring those configurations. Many times it&amp;#39;s pretty frustration especially when the source code is not available to figure out what exact condition causing the error.&lt;/p&gt;
&lt;p&gt;I guess doing a CTRL+F at the webpage you pointed to and look for &lt;strong&gt;CONFIG_BT_CTLR&lt;/strong&gt; would filter most of the Bluetooth configurations for the controller and you can start from there.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/368600?ContentTypeID=1</link><pubDate>Thu, 19 May 2022 12:17:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75606e31-3df0-4111-b12c-0d717843ee32</guid><dc:creator>axel_s</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;yes, now it works. I set both values, CONFIG_BT_CTLR_ADV_DATA_LEN_MAX and CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX to 255. Funnily, the advertiser can handle data size up to 249 Bytes correctly, the periodic_sync receiver data size up to 245 bytes. But both values are ok now.&lt;/p&gt;
&lt;p&gt;I faces the same issue regarding the printing, but I will not go into this now.&lt;/p&gt;
&lt;p&gt;Thanks for your help!&lt;/p&gt;
&lt;p&gt;A last thing: It took a while finding the CONFIG_BT_CTLR_ADV_DATA_LEN_MAX and CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX config options in my case. At webpage &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/kconfig/index-zephyr.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/kconfig/index-zephyr.html&lt;/a&gt; one can find probably several hundrets of options, but listed alphabetically. It would be quite nice for programmers to have consolidated lists of options, which might be of interest for some specific issues (simple advertising, extended advertising, periodic advertising and so on). Are there such lists? Otherwise, many people will ask the same questions, have extensively to search for information in fora etc. It&amp;#39;s the same for me - the data size issue is solved now, but when I&amp;#39;m going forward maybe to timing issues I&amp;#39;m quite sure that I&amp;#39;ll be back on search for config options. This way of programming is sometimes quite frustrating and could be eased a lot by better documentation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/368555?ContentTypeID=1</link><pubDate>Thu, 19 May 2022 09:24:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4300426b-d43c-4d39-b2e6-39f7d8cab299</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Maybe you can have a look at this case&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/85571/sync-fail-for-periodic-advertisement"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/85571/sync-fail-for-periodic-advertisement&lt;/a&gt;&amp;nbsp;?&amp;nbsp;&lt;code&gt;CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX&lt;/code&gt;&lt;span&gt;&amp;nbsp; may need to be configured.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In my case I do receive the receive report but couldn&amp;#39;t print the string normally. I have to manually printout the raw data as hex integer instead of using the bin2hex command to print the data as string.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/368545?ContentTypeID=1</link><pubDate>Thu, 19 May 2022 09:00:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcb01721-b2a0-425d-95b8-7f9f604d347c</guid><dc:creator>axel_s</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;you&amp;#39;re right, it&amp;#39;s working now. In this case I don&amp;#39;t understand the meaning of &lt;span&gt;CONFIG_BT_CTLR_ADV_DATA_LEN_MAX&lt;/span&gt; - it worked well with 60 data bytes when set to 31. Anyway, I set&amp;nbsp;&lt;span&gt;CONFIG_BT_CTLR_ADV_DATA_LEN_MAX&lt;/span&gt;=255 and can now send up to 249 data bytes, verified with the sniffer.&lt;/p&gt;
&lt;p&gt;But reception doesn&amp;#39;t work any more. Here too I set &lt;span&gt;CONFIG_BT_CTLR_ADV_DATA_LEN_MAX&lt;/span&gt;=255. The reception of the &amp;quot;old&amp;quot; 60 data bytes is ok, but 249 doesn&amp;#39;t work at all without any error message. Maybe there is a setting for size of buf?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/368525?ContentTypeID=1</link><pubDate>Thu, 19 May 2022 07:34:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b16b8a29-9ee4-4d02-aac0-fb6937d88510</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Axel,&amp;nbsp;&lt;br /&gt;It actually worked for me.&amp;nbsp;&lt;br /&gt;I set this&amp;nbsp;&lt;span&gt;CONFIG_BT_CTLR_ADV_DATA_LEN_MAX&lt;/span&gt;&lt;span&gt;=200&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And then can send 170Byte in my periodic advertising packet:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/6758.pastedimage1652945666644v2.png" alt=" " /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please make sure you flashed the netcore after you rebuild (if you are using nRF53).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/368520?ContentTypeID=1</link><pubDate>Thu, 19 May 2022 07:16:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9671233d-90a3-47bd-a512-eccb95bab989</guid><dc:creator>axel_s</dc:creator><description>&lt;p&gt;Hallo Hung Bui,&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t believe that this is the answer. Currently (and this is a setting I never changed, so I assume it&amp;#39;s a kind of default), CONFIG_BT_CTLR_ADV_DATA_LEN_MAX is set to 31. This value is far away from the 60 bytes I can successfully transmit with periodic advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/368346?ContentTypeID=1</link><pubDate>Wed, 18 May 2022 12:28:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ca46f42-7f17-45f9-b732-9824bf22862b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Axel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please try&amp;nbsp;to set&amp;nbsp;CONFIG_BT_CTLR_ADV_DATA_LEN_MAX to the size you want to use.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;It&amp;#39;s more likely the issue on the configuration of the controller (the lower stack).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/368142?ContentTypeID=1</link><pubDate>Tue, 17 May 2022 08:30:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c2effb8-a503-410e-bb7d-e67560578b1b</guid><dc:creator>axel_s</dc:creator><description>&lt;p&gt;Hallo Hung Bui,&lt;/p&gt;
&lt;p&gt;regarding the call_backs you&amp;#39;re completely right. I missed that point, sorry.&lt;/p&gt;
&lt;p&gt;But now I&amp;#39;ve some more questions, this time related to the amount of data to be transmitted.&lt;/p&gt;
&lt;p&gt;When I use periodic advertising, the function bt_le_per_adv_set_data() updates the data to be transmitted. Extending the mfg_data[] in the example, I found that the maximum length of mfg_data[] is 60. With length 61, data updating fails with (err -5). In BB, the whole AUX_SYNC_IND frame is of length 74 (for 60 data bytes), which is much less than the 255 octets I expect from the BT 5.0 spec.&lt;/p&gt;
&lt;p&gt;remark 1: In gap.h there is a constant BT_GAP_ADV_MAX_EXT_ADV_DATA_LEN = 1650, which is the data length in case of chaining the advertising according to BT 5.0. Up to now, I didn&amp;#39;t find another constant somehow limiting the data size of a single extended advertising frame.&lt;/p&gt;
&lt;p&gt;remark 2: A similar behaviour I see when I skip the periodic option, going to simple extended advertising. In this case the maximum length of mfg_data[] is 55 bytes only. That this is less than with periodic advertising is ok due to the fact that I have two data elements in the packet, data and the device name (in my test case three letters only). But the general fact is identical to the periodic advertising - I would expect more data to be transmitted.&lt;/p&gt;
&lt;p&gt;Therefore the question: What have I to do to reach the maximum number of data bytes in the advertising frames?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/367574?ContentTypeID=1</link><pubDate>Thu, 12 May 2022 10:52:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4af44be9-ed01-4104-9111-a4ceb8bf94c2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Axel,&amp;nbsp;&lt;/p&gt;
[quote user="axel_s"]As long as the varying data part (mfg_data[2] in the example) = 0, there are no data added, the data section remains empty. Data inclusion starts with mfg_data[2] = 1. Why?[/quote]
&lt;p&gt;I think this happens because it&amp;#39;s a bug in the periodic_adv code. There were no call to set the data&amp;nbsp;bt_le_per_adv_set_data() before the first 10 seconds sleep elapsed. See here:&amp;nbsp;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1652352423177v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So only after the mfg_data[2] was increased from 0 to 1 then it will be added to the advertising data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can call&amp;nbsp;&lt;span&gt;bt_le_per_adv_set_data() before the while loop so that you can see the 0xff ff 00 data.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="axel_s"]How can I access the data to do the output myself resp. work with the data further one? Data handling for now is hidden in the stack.[/quote]
&lt;p&gt;&lt;span&gt;&lt;/span&gt;How did you print data out ? The data handling is done inside the stack but in the application you should receive the callback&amp;nbsp;.recv (recv_cb() function in periodic_sync ) and you should be able to process the data there. The same way as how we print the log out as I showed in my screenshot earlier (it&amp;#39;s from the periodic_sync code)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/367559?ContentTypeID=1</link><pubDate>Thu, 12 May 2022 09:21:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca5bb4d8-5335-46a6-a9a4-0a4f0a485588</guid><dc:creator>axel_s</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;thanks for your suggestion, which at least took me a step forward.&lt;/p&gt;
&lt;p&gt;Now I can find some frames of type AUX_SYNC_IND, which finally also include data. But what I see again raises questions.&lt;/p&gt;
&lt;p&gt;First, but minor issue: As long as the varying data part (mfg_data[2] in the example) = 0, there are no data added, the data section remains empty. Data inclusion starts with mfg_data[2] = 1. Why?&lt;/p&gt;
&lt;p&gt;Second issue: How can I access the data to do the output myself resp. work with the data further one? Data handling for now is hidden in the stack.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic Advertising</title><link>https://devzone.nordicsemi.com/thread/367397?ContentTypeID=1</link><pubDate>Wed, 11 May 2022 12:03:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee69be74-0db0-446a-8b1e-73e7114f78c7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Axel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I suspect that the sniffer was not able to follow and sync with the periodic advertising from the device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I did a quick test here with the periodic_sync sample and can get this log:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1652269512746v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Notice the manufacturer data increment from 1 to 3 in the log. This matched with what coded in the periodic_adv sample.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At the beginning when I tested the example out of the box the periodic_sync always failed immediately after the sync established. I found that it might be due to too short timeout. By default it&amp;#39;s set to 0x0a&amp;nbsp; (100ms):&amp;nbsp;&lt;br /&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/bluetooth/periodic_sync/src/main.c#L232"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/bluetooth/periodic_sync/src/main.c#L232&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But the adv interval is 1200ms.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So I changed the &lt;span&gt;sync_create_param.&lt;/span&gt;&lt;span&gt;timeout&amp;nbsp;&lt;/span&gt;to&amp;nbsp;0xa00 and can follow and capture the periodic adv data.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>