Hi,
Please excuse my possible lack of knowledge and experience as I’m trying to give some steps on this (new) world. And accept my apologies if I’m on the wrong forum…
I think I’ve hit on a problem and need advice for what might be the best path/approach to solve it.
I’m trying to synchronize the clocks for 2 Arduinos (Mega 2560 compatible) that connect though WiFi (ESP8266) to a common AccessPoint and to a PC that receives the data from both. The sync I’m trying to achieve should be quite accurate as I need to collect time and sensor values on both during no more than 1 minute, but the time on the readings on both much match as close as possible up to millisecond. Any skew between them must be recorded.
The application on the PC will measure the time synchronization (or lack of it) of sensor readings by both Arduinos, so readings on Arduino1 can be compare with readings on Arduino2. I’m thinking on timer/clock sync but I think if I can know the skew between both Arduino clocks, I can make the proper calculations outside both Arduinos (on the PC).
I had 2 initial ideias and did some research. But have doubts about both: not sure which is best or even if any will allow me to reach the goal.
Option1) Sync both clocks using RTC
Option2) GPS clock sync – seams a technical viable solution –
Any ideas, feedback, suggestions or directions will be greatly appreciated on what might be the best approach to know the time skew between 2 Arduinos or sync their clocks up to millisecond precision?
Regards and ty for any help,
Luis
Please excuse my possible lack of knowledge and experience as I’m trying to give some steps on this (new) world. And accept my apologies if I’m on the wrong forum…
I think I’ve hit on a problem and need advice for what might be the best path/approach to solve it.
I’m trying to synchronize the clocks for 2 Arduinos (Mega 2560 compatible) that connect though WiFi (ESP8266) to a common AccessPoint and to a PC that receives the data from both. The sync I’m trying to achieve should be quite accurate as I need to collect time and sensor values on both during no more than 1 minute, but the time on the readings on both much match as close as possible up to millisecond. Any skew between them must be recorded.
The application on the PC will measure the time synchronization (or lack of it) of sensor readings by both Arduinos, so readings on Arduino1 can be compare with readings on Arduino2. I’m thinking on timer/clock sync but I think if I can know the skew between both Arduino clocks, I can make the proper calculations outside both Arduinos (on the PC).
I had 2 initial ideias and did some research. But have doubts about both: not sure which is best or even if any will allow me to reach the goal.
Option1) Sync both clocks using RTC
Problems Option1: RTC can only give up to second, and I need millisecond
need to sync it using one NTP server and looking at libraries/examples think this will sync up to minute … I need milliseconds.
need to sync it using one NTP server and looking at libraries/examples think this will sync up to minute … I need milliseconds.
Option2) GPS clock sync – seams a technical viable solution –
Problems Option2) this will be mainly indoor and is a somehow expensive solution – a GPS module to sync time, seams like a cannon to kill a fly but may be the only solution…
Any ideas, feedback, suggestions or directions will be greatly appreciated on what might be the best approach to know the time skew between 2 Arduinos or sync their clocks up to millisecond precision?
Regards and ty for any help,
Luis