<?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>nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113524/nrf52-time-synchron-packet-not-arrived-after-ble-reconnect</link><description>hi, 
 I use softdevice s140 and nrf5_sdk_17.1. 
 I import time sync demo from here ( github.com/.../nRF5-ble-timesync-demo) to my project. 
 My first usage version: 
 * nrf52 devices initalize and enable time sync library at startup 
 * a mobile phone</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Aug 2024 10:29:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113524/nrf52-time-synchron-packet-not-arrived-after-ble-reconnect" /><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/499512?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 10:29:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ea3a186-9a87-4fe6-aa2e-91bb2beeb75f</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="AttilaEgri"]Changing the sending frequency from the default 30 to 150 (ts_tx_start()) solves the problem. But maybe is there a better solution?[/quote]
&lt;p&gt;Not at this point unfortunately.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/499333?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 08:59:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cb415eb-fa53-4bd0-b55a-624b757b5a17</guid><dc:creator>AttilaEgri</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I test what you mention but not solved the problem for me. But during advertising time sync packets arrived, the problem starts after both device is connected and sync packet sender connects later.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Changing the sending frequency from the default 30 to 150 (ts_tx_start()) solves the problem. But maybe is there a better solution?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/498843?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2024 12:38:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ac4ca08-b49b-4e4d-b261-37b0c5d3f69f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Attila,&lt;/p&gt;
&lt;p&gt;Audun had some time to test this code and his observations are that, it appears to be a case of MPSL scheduling not aligning properly with the time sync radio packets. Your code uses a 25 ms advertising interval, and with the advertising randomness, Audun suspect there is simply too many scheduling collisions to get a useful number of received sync packets.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Increasing the advertising interval to 100 ms (mAPP_ADV_FAST_INTERVAL = 0x00A0), things improve quite a bit. The receiver has no long pauses in packet reception now, but I do see the rate of packet reception goes a bit up and down.&lt;/p&gt;
&lt;p&gt;In the test code you need to calibrate the advertising interval and in your main code you need to fine tune the BLE activity to be able to have less timeslot collisions, &lt;span&gt;&lt;span dir="ltr"&gt;Ideally the time sync code should be updated to make the radio RX actively align with the TX. In its current form, the receiver always tries to keep the radio in RX as much of the time as possible, while the transmitter only requests MPSL timeslots when it needs to transmit packets (which is a fixed interval). Updating the time sync code is a bigger task than just trying to calibrate the BLE parameters and advertising interval.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/497867?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2024 15:35:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:379a6a2c-d93e-48ee-84ec-1ec7663a590f</guid><dc:creator>AttilaEgri</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;I made GPIO toggling. I set gpio in timesloat_begin_handler and clear in timeslot_and_handler (I push it).&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1723476211266v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Here is the image when it changes from good to bad, white signal is the receiver side brown is the sender.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And this is caused by reconnecting BLE (after reconnect it remains good for about 4-5 sec) of sender device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When it is good there is ~213ms between packet sending. When it comes to bad this time increase a little ~220ms for some packet then it comes to be 213 again but after that as&amp;nbsp;shown in the picture packet sending happens when receiver not listen.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there any possibility to make back this time shift?&lt;/p&gt;
&lt;p&gt;besta regards&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/497670?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2024 16:22:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60781bb8-f399-40ba-a58b-413a5784ba4e</guid><dc:creator>AttilaEgri</dc:creator><description>&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt;I will have time to make this GPIO toggling test on Monday&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/497464?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2024 10:07:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d27921c4-4fd1-4508-a86a-10657519780a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Attila,&lt;/p&gt;
&lt;p&gt;Got some feedback from the expert on this after reviewing your code and haven&amp;#39;t run your code yet on the device.&lt;/p&gt;
&lt;p&gt;The initial comment and suggestions are as below&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I did suspect that the issue is related to the SD sessions, but he writes that the expected callbacks are generated. It could be a timing issue, or a bug in the code I wrote.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;em&gt;1) Check return codes of functions, such as this one: &lt;a title="https://github.com/vregath/nrf_timeslot_test/blob/main/src/time_synchron/time_synchron.cpp#l90" href="https://github.com/vregath/nrf_timeslot_test/blob/main/src/time_synchron/time_synchron.cpp#L90" rel="noopener noreferrer" target="_blank"&gt;https://github.com/vregath/nrf_timeslot_test/blob/main/src/time_synchron/time_synchron.cpp#L90&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;2) Toggle a GPIO on the Master side when radio transmission occurs&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;3) Toggle GPIO on Slave side when radio RX begins and when radio RX ends.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(this makes it easier to observe timing issues using a logic analyzer)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Will try to get more insights after running your code tomorrow or on Monday.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/497430?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2024 07:29:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1649778d-25ab-4380-badd-c937076fed83</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Attila,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The author of the project for this timesync demo, Audun,&amp;nbsp; accepted my request to comment on this thread directly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So you will have your code looked by the expert. You will hear from Audun soon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/497402?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2024 04:52:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a0c7fc0-9519-48b5-a49f-49b56d74815a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Attila,&amp;nbsp;&lt;br /&gt;Sorry for the late response. We are ramping up after coming back from summer holidays. I will look at the details you gave and will reply to you today.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your patience so far.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/497001?ContentTypeID=1</link><pubDate>Mon, 05 Aug 2024 14:15:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:110805fa-0f9c-4076-8a95-15297237ebda</guid><dc:creator>AttilaEgri</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://github.com/vregath/nrf_timeslot_test"&gt;https://github.com/vregath/nrf_timeslot_test&lt;/a&gt;&amp;nbsp;here is an example.&lt;/p&gt;
&lt;p&gt;there s readme which describes how can you reproduce the problem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/496551?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2024 08:00:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15a12278-2ab2-411c-8ba3-7836857ca86e</guid><dc:creator>AttilaEgri</dc:creator><description>&lt;p&gt;There are 2 nrf52 device call master and slave. Master will send sny packets slave will listen to them.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;During nrf52 startup ts_initalize and ts_enable is called, but ts_enable doesn&amp;#39;t start radios session and request timeslot.&lt;/p&gt;
&lt;p&gt;When mobile app can send to devices a message for being a time sync master or slave.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Both starts radio session and request timeslot, and master call&amp;nbsp;ts_tx_start() too.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When works well:&lt;/p&gt;
&lt;p&gt;start mobile app which will connect to nrf52 devices&lt;/p&gt;
&lt;p&gt;switch on device which will be master (so this will connect first)&lt;/p&gt;
&lt;p&gt;switch on device which will be slave&lt;/p&gt;
&lt;p&gt;send message from mobile to devices for starting radio session and master sart to sends sync packet&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if change to switch on squence so slave will connect first it is not working slave doesn&amp;#39;t get sync packets.&lt;/p&gt;
&lt;p&gt;in this case I don&amp;#39;t get any&amp;nbsp;NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO in radio_callback on slave device.&lt;/p&gt;
&lt;p&gt;I log&amp;nbsp;NRF_RADIO-&amp;gt;STATE when I get&amp;nbsp;NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED in salve device and it is in RX state so it looks that it listen to packets.&lt;/p&gt;
&lt;p&gt;on master device I get&amp;nbsp;&lt;span&gt;NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO and&amp;nbsp;EVENTS_END so it looks that it sends sync packet well.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;if any of the nrf2 devices disconnect from mobile phone it starts to work (when 1 device connects to phone and other not it works).&lt;/p&gt;
&lt;p&gt;if slave disconnect from phone (here sync packet starts to arrived) then connect back it continues wokring.&lt;/p&gt;
&lt;p&gt;if master disconnect then connect agains it stop working.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;now&amp;nbsp; I don&amp;#39;t stop radio session when BLE_disconnect accours and start radio session when BLE_connect again.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But when I do this my expericen was the same (expect that one device disconnect it starts to work because in this case I stop it)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Next week I want to write an example which I can share with you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 time synchron packet not arrived after BLE reconnect</title><link>https://devzone.nordicsemi.com/thread/496433?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2024 13:53:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:743c20a7-3a21-44c6-9775-3607d6ee5cf0</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am not sure if I understood the issue correctly. So in the initial version, if the mobile phone disconnects and connects again, then the slave does not get the time sync packets. So after your change to call&amp;nbsp;&lt;span&gt;sd_radio_session&amp;nbsp;only after a connection is established, you still see the issue or it got fixed?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you show some logs or any code snippets that I can use to replicate this at my end?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>