Re: π‘ Synchronization of timestamps, using Bluetooth Connection Event?
Re: π‘ Synchronization of timestamps, using Bluetooth Connection Event?
- Subject: Re: π‘ Synchronization of timestamps, using Bluetooth Connection Event?
- From: Matthias Ringwald <email@hidden>
- Date: Wed, 13 Feb 2019 14:42:23 +0100
Hi Julian
Under the assumption that you don't have much control over the iOS side, I
would try to minimize unknown latencies there. If you're sending, you cannot
know when the Connection Event happens, so you have the time until next CE plus
the time through the iOS stack.
Because of this, I'd suggest to send a timestamp from the nRF52 to iOS. Then,
you only have the time it takes from the Bluetooth Controller through the stack
to the app. I would hope that this might be possible in 1-2 ms if your app in
front. Now, for the nRF52, there you're aware of the Connection Event and queue
a packet e.g. 2 ms before the next CE and put that time into the timestamp.
On iOS, the might be a random jitter. However, knowing the connection interval,
you can always identify the timestamp with the shortest delay through the
stack.
If you're take this idea for a spin, I'd be curious to learn if that worked,
and how well..
Cheers
Matthias
β
Dr. sc. Matthias Ringwald
CTO and Co-founder of BlueKitchen GmbH, Zurich
https://bluekitchen-gmbh.com
> On 12 Feb 2019, at 12:25, Julian Vogels <email@hidden> wrote:
>
> Dear list,
>
> Thank you for interesting topics and your support in the past.
>
> Weβre building a peripheral device (Nordic nRF52840) which needs to be time
> synchronized with the central device (iOS device) once on connection.
> When sending a timestamp, we have unknown, noticeable latency. This is
> because we cannot know the time it takes until one packet is processed on the
> central side, sent, and then received and processed on the peripheral side.
> However, we do know that there are Connection Events (CEs) occurring every
> Connection Interval (30 ms), where the packets are exchanged. We were
> planning on using the CEs to infer the actual time of send/receive, as the
> event is happening at the same time on both sides and has a very short
> duration.
>
> On the peripheral device, we are able to generate an interrupt when the CE
> occurs. On the iOS device, we are unable to detect when a Connection Event is
> occurring.
> Is there any way to get the synchronized Bluetooth clock tick (Connection
> Event) on iOS? Or maybe weβre on the wrong track altogether?
>
> Any other ideas on how do you synchronize two timestamps on peripheral and
> central device? (We already have clock drift compensation by the way, I am
> just asking about timestamp sync.)
> Our requirement is a latency/jitter under 5-8 ms.
>
> I hope I sparked someones interest in this engineering problem! Please send
> me a message if anything is unclear.
>
> All the best,
>
> Julian
> Julian Vogels
> CTO & Co-Founder
> +49 176 5659 1152 (GER) | Skype: julian.vogels | WeChat: julianvogels
> www.soundbrenner.com
>
>
> Download our free standalone app "The Metronome by Soundbrenner" for iOS or
> for Android
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Bluetooth-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden