Sync cyton timestamps to exact Unix time
stygiangreen
Darmstadt, Germany
in Cyton
Hello,
I am using a Cyton+Daisy+WifiShield in combination with brainflow to record EEG data with python.
As far as I understand the offline Unix time given in the board data timestamps differs from the true online Unix time since the crystal of the microcontroller is susceptible to drift (due to temperature fluctuations, etc). Is anyone familiar with a way to determine that difference between the timestamps and the true Unix time pertaining to input events?
I was thinking about getting extra hardware like a RTC module to input a pulse at a specific Unix time and then compare it with the corresponding timestamp.
Alternatively does anybody have a solution using NTP or SNTP?
Comments
NTP implementation is way too large to fit in the microcontroller used by Cyton. Timestamps are assigned as the packets arrive at the laptop. Thus are subject to the delays of the radio transmission, OS buffering, usb buffering, etc. If you need more precise synchronization, the recommendation is to use the External Trigger hardware:
https://docs.openbci.com/Cyton/CytonExternal/
https://docs.openbci.com/Cyton/CytonExternal/#optoisolation
Additionally, even SNTP 'simple' NTP, cannot work in the microcontroller. Because the packet format has no space for time stamp. As mentioned, time stamp is only applied when radio packet is received by the dongle (over serial usb port to the Brainflow library).
https://docs.openbci.com/Cyton/CytonDataFormat/
Regarding the external trigger. It is common to tape a photo sensor to one corner of your monitor screen. This can then drive the Cyton external trigger input.
https://www.google.com/search?q=openbci+photodiode
https://openbci.com/forum/index.php?p=/discussion/3055/external-trigger-question-on-photodiode-resolved
https://openbci.com/community/measuring-stimulus-timing-with-a-photoresistor/