Hello
We have an application that runs on an nRF52833, and communicates with an iOS app via BLE.
The iOS app connects to a number of nRF52833 devices.
The problem we are trying to solve right now is Time Synchronization.
After connecting to all of the devices, the iOS app wants the devices to start a certain task at the same time.
It has to send the message separately/sequentially to each device.
It would make sense for the iOS app to tell each of the devices to "start task at time T".
So the problem is to get all the devices synchronized with the iOS app, so that they all know when time T is.
One method I found, called the Cristian synchronization algorithm, is implemented as follows:
- The slave sends a Time Synchronization Request, at time T1.
- The master receives this request, and sends its Clock Time Tm to the slave
- When the slave receives the master clock time, at time T2, it sets its own clock to time Tm + (T2-T1)/2
However, I also came across articles which suggest that experimental results show that application of the Cristian algorithm as described above does not give reliable results in platforms such as BLE.
Another method I came across is based on the BLE “connected event” generated by both the scanner (iOS app) and the advertiser (nRF52833 device), when the connection request is sent, (iOS app) and received(nRF52833 device).
The author of an article describing this method seems to suggest that the difference between these events is just under 1 ms, which would be probably be good enough for us.
Do you have any suggestions on time synchronization between multiple devices?