Coder Social home page Coder Social logo

Synchronize boards about followifier HOT 10 CLOSED

suidpit avatar suidpit commented on May 17, 2024
Synchronize boards

from followifier.

Comments (10)

suidpit avatar suidpit commented on May 17, 2024 1

I will need the help of anyone with the board to test this, but the functionality here is already laid out, we only need to glue the pieces.

from followifier.

marcomicera avatar marcomicera commented on May 17, 2024

I guess we'll first have to find out how much do boards get off sync with each other on average and then set a maximum desync threshold

from followifier.

suidpit avatar suidpit commented on May 17, 2024

Update on this.

I have tested on my board this module by esp-idf. It works as expected.

After interaction with NTP server:

image

At this point, there's only to define when we should trigger the synchronization thread. I'd suppose we should leave the harsh decision to the main server (boards can be put to listen fore broadcast messages containing new time data), so that all the boards can sync at once.

We have a way to keep the boards in sync. We should test this at last, with more than one board connected to the main server.

from followifier.

marcomicera avatar marcomicera commented on May 17, 2024

I guess I'm the only one who can test this out as I have two boards. Do we have this feature already implemented somewhere in the code?

from followifier.

suidpit avatar suidpit commented on May 17, 2024

Looking at the module linked, using the sntp module is really easy. The only issue here is decide where to keep this code working.
A basic idea would be to have a task which runs in the event loop, sleeps for a certain number of minutes, and then resynchronizes the clock.
Otherwise, if we want this to be handled by the server, we can have 2 sockets opened for each board:

  • One for data, that is, the one we are using for the batches;
  • One for control, where the server can send certain commands to the boards. One command would be encoded as "resynchronize", and when received, it would trigger the resync process.

from followifier.

marcomicera avatar marcomicera commented on May 17, 2024

I think this must be handled by the server. From the requirements:

Le stazioni di ascolto devono avere la stessa base dei tempi, così che le marche da esse apposte siano compatibili. A tale scopo, nelle fasi iniziali di avvio del sistema e periodicamente durante il suo funzionamento, devono scambiare dati con il PC volti a allineare i propri orologi ed a mantenere la sincronizzazione.

from followifier.

suidpit avatar suidpit commented on May 17, 2024

What in this requirement makes you think that the sync process has to be handled by the server?
The server hosts the NTP server. That is the nature of the "data exchange" happening between boards and servers. The requirement doesn't state explicitly that the server must request the synchronization on demand.

from followifier.

marcomicera avatar marcomicera commented on May 17, 2024

Ops, yeah, I misread.

from followifier.

suidpit avatar suidpit commented on May 17, 2024

Also, we don't need from the stations to be synchronizing at the same time, we only need them to have the same (with a given tolerance) timestamp. Therefore, I really think that a simple task that fires periodically and asks server for resync is what we're looking for.

from followifier.

marcomicera avatar marcomicera commented on May 17, 2024

Working on the sntp branch.

from followifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.