my project is sound localisation using an array of microphones (connected to ESP8266 boards) that measure the time difference of arrival.
my question is, what is the most accurate way to sync multiple ESP8266 boards that are connected over wifi?, in order to measure time difference of arrival of sound waves in Milliseconds.
in other words, each board will record when it received a sound signal (in milliseconds) so i need an accurate way to sync 3 boards for example.
yes, but i couldn't figure out how to get only the milliseconds (or preferably microseconds) as an unsigned long that can be the same at 3 different boards at the same point in time
Are the boards going to have real time clocks to stay synchronized or will they need to be constantly updated? They might be synchronized by a master board, or maybe satellite GPS time. Anything that moves thru a network might have latency issues that would need to be sorted out.
You do not have to use the NTP protocol with a public time server. You could implement something similar using your time format and UDP protocol. The Clock synchronization algorithm described on the Wikipedia page seems easy to implement.
How do you connect your boards? Do they connect to a WiFi router or do you have one board as an access point creating a separate network?
If you have issues with the code. Feel free to post a sketch (use code tags). Read the "How to post .." at the beginning of each sub forum. Good posts get more feedback.