<?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>How to Use Timeslots and Radio HAL to Send Time-Sync Packets in Mesh</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54117/how-to-use-timeslots-and-radio-hal-to-send-time-sync-packets-in-mesh</link><description>Application Info: 
 I am working on developing a synchronized mesh network of low power sensors. I am trying to maintain an average power consumption of 100&amp;#39;s of &amp;#181;W while still broadcasting data about once every 5 minutes and going to sleep. To be able</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Feb 2020 18:44:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54117/how-to-use-timeslots-and-radio-hal-to-send-time-sync-packets-in-mesh" /><item><title>RE: How to Use Timeslots and Radio HAL to Send Time-Sync Packets in Mesh</title><link>https://devzone.nordicsemi.com/thread/233608?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2020 18:44:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2de1bbf5-0acd-4cae-bb3f-e4f9d886c298</guid><dc:creator>Marciano-PL</dc:creator><description>&lt;p&gt;I&amp;#39;ve opened a new ticket for the specific issue I&amp;#39;m running into now.&lt;br /&gt;&lt;br /&gt;I have written the code to capture a time and package it up like a mesh message but for the timing to be reliable I need this to happen once the timeslot is open. This is an issue because the Softdevice prevents usage of the ECB during operation.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;How else might I send my message in a deterministic time profile?&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/57564/sd_ecb_block_encrypt-results-in-hardfault"&gt;devzone.nordicsemi.com/.../sd_ecb_block_encrypt-results-in-hardfault&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Use Timeslots and Radio HAL to Send Time-Sync Packets in Mesh</title><link>https://devzone.nordicsemi.com/thread/233365?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2020 17:14:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be9b8d62-d739-4ce8-b351-9dd99fd2ee28</guid><dc:creator>Marciano-PL</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;br /&gt;&lt;br /&gt;Thanks for checking in! Yes, I discovered what the actual issue was and got some helpful advice along the way.&lt;br /&gt;&lt;br /&gt;Best,&lt;br /&gt;Marciano&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Use Timeslots and Radio HAL to Send Time-Sync Packets in Mesh</title><link>https://devzone.nordicsemi.com/thread/233259?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2020 12:17:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20cf3457-fa77-4af2-bdb6-52572ca77f6c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Did you get the answers to your questions in the other ticket?&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Use Timeslots and Radio HAL to Send Time-Sync Packets in Mesh</title><link>https://devzone.nordicsemi.com/thread/232932?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2020 01:44:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:455c6e4b-5bb4-48d7-bdd2-453995fcd388</guid><dc:creator>Marciano-PL</dc:creator><description>&lt;p&gt;I have made progress towards reaching my goal. So far, I am only sending the LFCLK value + number of overflows in an unsegmented message. I have created some infrastructure to do all of the encrypting, and loading with metadata. The devices will be resyncing once every 5 minutes or so.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;My current issue is that the mesh stack takes possession of the softdevices timeslot api so I cannot give it my own handler without disabling the mesh. Unfortunately none of the functions for disabling the mesh seem to actually do what they are meant to. I have another support case open on those issues.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/57450/reliably-disabling-mesh-stack-quickly-for-low-power"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/57450/reliably-disabling-mesh-stack-quickly-for-low-power&lt;/a&gt;&lt;/p&gt;
&lt;div id="AppleMailSignature"&gt;
&lt;div dir="auto"&gt;
&lt;div class="ApplePlainTextBody"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Use Timeslots and Radio HAL to Send Time-Sync Packets in Mesh</title><link>https://devzone.nordicsemi.com/thread/219615?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 09:09:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:079a1552-83ab-46ac-a834-a5153254e4c1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The reason why the mesh stack makes this a bit tricky is because once you do this, it is no longer a valid mesh stack, meaning you will not get it certified. You can try to use the API in the mesh SDK to create the messages and send them, but as I have said, it isn&amp;#39;t straight forward to do what you are describing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It may be easier to use the radio without the softdevice, but then you will have to read up on how the provisioning is done, and how the messages are encrypted using the keys.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Question: Are your devices going to be communicating with other mesh certified devices? Or are there only your own devices? Because if it is only your devices, perhaps the Mesh stack isn&amp;#39;t the correct approach at all. Maybe something completely proprietary is the easiest solution.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Marciano-PL"]For example, how can I send a mesh message reliably using time slots?[/quote]
&lt;p&gt;&amp;nbsp;If you are going to have reliable messages, you need some form of ACK. That will require you to use the radio for longer intervals. The key behind mesh is that all the messages are flooding the network. This takes time, but it is also the mechanism ensuring that the loss of a packet is extremely unlikely. If one of the messages are lost, then the chance of the rest of the relayed messages being lost is very small.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So if you want to have reliable messages, I would suggest that you try to disable the stack, and go to sleep with the radio off. Then when your time has passed (5 minutes), turn all of the nodes back on. If they are provisioned then they should start up quite quickly. Send whatever messages you need to send. Remember that you don&amp;#39;t have a lot of payload throughput. Wait for the messages to propagate the network, and turn them back off.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What sort of data are you going to send by the way? You probably need to send one empty packet (or a short packet) to sync up the clocks, even if the other devices doesn&amp;#39;t have any payload data to send. Unless the clocks of the devices will drift over time.&amp;nbsp;&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><item><title>RE: How to Use Timeslots and Radio HAL to Send Time-Sync Packets in Mesh</title><link>https://devzone.nordicsemi.com/thread/219340?ContentTypeID=1</link><pubDate>Fri, 08 Nov 2019 20:29:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ffedac9-4deb-4424-a03b-bbd32b3816b5</guid><dc:creator>Marciano-PL</dc:creator><description>&lt;p&gt;I understand all of this. My issue is with implementation. For example, how can I send a mesh message reliably using time slots?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Either&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I do all of the mesh stack&amp;#39;s steps myself in generating an encrypted message buffer and use the radio hal to send it myself. This method has a number of problems. For example, the access api obscures all of the methods required to obtain the source address, destination address, appkey, etc.&lt;/li&gt;
&lt;li&gt;I modify the Mesh SDK at the very bottom of the stack so I can schedule the delivery of the message myself instead of relying on the random-time scheduling method it employs. I&amp;#39;d rather not do it this way&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Use Timeslots and Radio HAL to Send Time-Sync Packets in Mesh</title><link>https://devzone.nordicsemi.com/thread/219261?ContentTypeID=1</link><pubDate>Fri, 08 Nov 2019 11:41:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b5e3ed5-d0ea-426c-ba3b-0768f29a471f</guid><dc:creator>Edvin</dc:creator><description>[quote user=""]Send this message only as single-hop (TTL = 1)[/quote]
&lt;p&gt;&amp;nbsp;Not a problem. This can be configured in the project, inside the mesh model that you are using. You can look at e.g. the&amp;nbsp;access_default_ttl_set() function.&amp;nbsp;&lt;/p&gt;
[quote user=""]Take advantage of mesh features like encryption, opcodes, and addressing (virtual, group, etc..)[/quote]
&lt;p&gt;&amp;nbsp;Sure.&lt;/p&gt;
[quote user=""]Be able to capture the hf-clock value at this message&amp;#39;s time of arrival on receiving end[/quote]
&lt;p&gt;&amp;nbsp;You can, but you must experiment with the time it takes from the packet is sent until you get the event in the application.&amp;nbsp;&lt;/p&gt;
[quote user=""]Send hf-clock value right when I capture it (or with reliable delay)[/quote]
&lt;p&gt;&amp;nbsp;You must look at the proprietary method described in the blog post that you link to.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Again, this is not straight forward. I wouldn&amp;#39;t say it is impossible, but there is probably some work to be done, in order to sync the clocks with the accuracy that you need. BLE itself is not ideal for time synchronization, because you can&amp;#39;t know from the application whether the message was relayed or not. It probably isn&amp;#39;t any easier in Mesh, which is why you need to use the proprietary timeslot_api described in the guide to send the timestamps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Use Timeslots and Radio HAL to Send Time-Sync Packets in Mesh</title><link>https://devzone.nordicsemi.com/thread/219155?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2019 18:27:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:990fa47b-72a1-4d07-aaad-1598bd52435f</guid><dc:creator>Marciano-PL</dc:creator><description>&lt;p&gt;Thank you for your input Edvin. I recognize that this is&amp;nbsp;not the typical&amp;nbsp;intended application of BT Mesh. However, we have run the analysis and done the math and it is certainly possible to make this work.&lt;/p&gt;
&lt;p&gt;I am aware of the clock drift over time. Timing windows can be expanded to compensate, and the clocks will be resynced with each interaction. The BLE post got a minimum agreement of 1 hfclk cycle (10s of ns) so our desire for &amp;lt;10&amp;micro;s is not only viable, but conservative.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Obviously we have considered using LPN nodes. The core Mesh specification does not meet our needs but provides a robust message-passing framework. Many synchronized mesh protocols exist which accomplish exactly what we are attempting, however nordic chips do not support these networks. At this time we will not be reconsidering our product or our approach. If you have advice on how I should go about achieving my goals in the &amp;quot;What I Want to Do&amp;quot; section I would be very grateful.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Use Timeslots and Radio HAL to Send Time-Sync Packets in Mesh</title><link>https://devzone.nordicsemi.com/thread/219132?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2019 16:16:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a6d7399-9405-4974-8943-2e96682ed2f7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Your requirements: Mesh + 100&amp;#39;s of µW + 5 minutes sleep + &amp;lt;10µs time synchronization isn&amp;#39;t viable.&lt;/p&gt;
&lt;p&gt;Have you considered using low power nodes in a mesh network? You still need mesh nodes that use more power, but you can have low power nodes that connect to some of these normal mesh nodes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The blog post you refer to is intended for &amp;quot;normal&amp;quot; BLE. It is no walk in the park, but it is possible to synchronize the clocks. However, remember that in a normal BLE connection, the devices sync their timing every connection interval. The clocks will probably drift more than 10µs in 5 minutes. And if a node runs out of battery, and is turned back on, how will it sync with the rest of the network?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think you should concider using LPN (low power nodes) in a regular mesh network.&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>