2 Replies Latest reply on Jul 21, 2015 9:43 AM by juvo_286221

    BLE synchronization with phone: Clock skew and Berkeley algorithm

      Hi guys,


      I am looking into how to synchronize multiple clocks running on PSoC 4 BLE devices and one smartphone, where all device are connected to one smartphone which acts as the BLE master. The goal is to minimize phase differences, and from a user experience standpoint, the start time can be delayed by some not noticeable amount if necessary.


      I am reaching out to the community because I am not sure what the best approach is to implement such a synchronization with BLE devices. Here are the alternatives I found:


      1. CheepSync


      To be found here (free PDF download): http://arxiv.org/abs/1501.06479


      CheepSync is a closed source algorithm used to synchronize BLE devices, developed at the Indian Institute of Science by Sridhar et al. Has anyone of you heard of this one or has any experience of how well this would work?


      In the paper, it is stated that a one-to-many setting can be synched, and it all looks like they solved the entire problem.


      2. Berkeley Algorithm


      The Berkeley Algorithm is probably a much simpler approach to the problem: The timestamps of the device clock are sent to the master (smartphone) device in a steady interval. With the assumption that the latency is equal to 1/2 of the roundtrip time, the timestamps are corrected to reflect the actual points in time when they occured.


      The corrected timestamp values (including that of the phone) are averaged, and the positive or negative clock skew correction (timestamp – average) is calculated and sent to the devices. The device then applies the correction by gradually slowing or accelerating the clock.


      The problem here is that I tried to implement it but got stuck at the part where the clock skew correction is applied by slowing or accelerating the clock in a gradual manner. So I can't actually say if this works. Can you?


      3. A totally different approach


      Can you think of one?




      I'd be very grateful of any insights on how to synchronize BLE devices.


      Thanks a lot in advance, I know, this forum is awesome