{"id":15007153,"url":"https://github.com/camilleg/clockkit","last_synced_at":"2025-04-07T07:09:11.138Z","repository":{"id":46028527,"uuid":"246148240","full_name":"camilleg/clockkit","owner":"camilleg","description":"Sub-msec accurate  distributed  timestamps.","archived":false,"fork":false,"pushed_at":"2025-01-02T22:57:47.000Z","size":622,"stargazers_count":85,"open_issues_count":4,"forks_count":14,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T06:01:44.803Z","etag":null,"topics":["clock-synchronization","linux-app","raspi","sensors","timestamp","windows-app"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/camilleg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-09T21:43:25.000Z","updated_at":"2025-03-12T11:43:16.000Z","dependencies_parsed_at":"2024-01-01T00:39:04.187Z","dependency_job_id":"637e80ac-816b-4464-8515-0f1b5600983a","html_url":"https://github.com/camilleg/clockkit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camilleg%2Fclockkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camilleg%2Fclockkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camilleg%2Fclockkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camilleg%2Fclockkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/camilleg","download_url":"https://codeload.github.com/camilleg/clockkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608151,"owners_count":20965952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clock-synchronization","linux-app","raspi","sensors","timestamp","windows-app"],"created_at":"2024-09-24T19:04:44.908Z","updated_at":"2025-04-07T07:09:11.116Z","avatar_url":"https://github.com/camilleg.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Clockkit provides timestamps to distributed networked PCs\nwith guaranteed bounds on latency and jitter, typically under 10 microseconds,\nas described in the conference paper [Synchronous data collection from diverse hardware](dsceu04.pdf).\n\nIt runs on Linux, Windows, and Raspi,\nand needs neither extra hardware nor elevated privileges.\n\nIt includes bindings for Python, Ruby, and TCL.  It also has a\n[Rust API](https://github.com/Infrasonics/rust-clockkit).\n\nIt can measure a system's realtime behavior,\nby providing a common time reference for events recorded by different sensors\n(audio, video, gamepad, GPS, SMS, MIDI, biometrics),\nand for triggering outputs (audio, video, LEDs, servos, motion bases).  \nIt did this originally for a full-motion [driving simulator](https://web.archive.org/web/20170517201424/http://www.isl.uiuc.edu/Labs/Driving%20Simulator/Driving%20Simulator.html) with eye tracking and a\nquickly churning set of other sensors and outputs, for over a decade.\n\nClockkit was published in 2004 on [http://zx81.isl.uiuc.edu/camilleg/clockkit](https://web.archive.org/web/20041205064911/http://zx81.isl.uiuc.edu/camilleg/dsceu04.pdf) (defunct).  \nIt was revised and moved to GitHub in 2020.\n\nThe source code is licensed under the [MIT License](https://mit-license.org/).\n\n## Installing\n\n\u003c!-- The package ruby is needed for `make test`, not just for `make bindings`. --\u003e\n#### Ubuntu 22\n`sudo apt install g++ libpython3.10-dev make pkgconf ruby ruby3.0-dev swig tcl8.6-dev`  \n`cd ClockKit \u0026\u0026 make`\n\n#### Ubuntu 20\n`sudo apt install g++ libpython3.8-dev make pkg-config psmisc ruby ruby2.7-dev swig tcl8.6-dev`  \n`cd ClockKit \u0026\u0026 make`\n\n#### Ubuntu 18 and older\nInstall a g++ that supports C++20: `sudo apt install g++-8`.  \nChange the Makefile's `-std=c++20` to `-std=c++2a`.  \nProceed as with Raspberry Pi.\n\n#### Raspberry Pi 3 and 4 (Debian/Raspbian)\n`sudo apt install g++ libpython3.8-dev make pkg-config psmisc ruby ruby-dev swig tcl tcl8.6-dev`  \n`cd ClockKit \u0026\u0026 make`  \n(The package [`ruby-2.5dev`](https://pkgs.org/download/ruby2.5-dev) vanished after Debian 10 \"Buster\" and Ubuntu 18.)\n\n#### Windows 10\nInstall [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10), using the [Ubuntu 20](https://www.microsoft.com/store/apps/9n6svws3rx71) distro.  \n`sudo apt install tcl`  \nProceed as with Ubuntu 20.  \n(We may restore native builds for older versions of Windows, but no older than Windows XP.)\n\n## Using Python, Ruby, or TCL\n`make bindings` builds the modules used by python/ckphaselock.py, ruby/ckphaselock.rb, and tcl/ckphaselock.tcl.  \nTo build for only one language, e.g. Python, `make python/_clockkit.so`.  For details, in the Makefile look for `SWIGEXES`.\n\n## Running\n\n### To test on localhost:\n`cd ClockKit \u0026\u0026 make test`\n\n### To sync host B to host A:\nOn host A, `ckserver \u003cIP address to bind to\u003e \u003cport\u003e`  \nOn host B:  \n- `cp clockkit.conf my-clockkit.conf`\n- Edit `my-clockkit.conf`.  Set the `server` to host A, e.g., `192.168.1.1` or `myhost.example.com`.  Set the `port` to 4567, or whatever port you told ckserver to use.  \n- `./ckphaselock my-clockkit.conf`  \n(`make test-remote` automates this, using an ssh key.)\n\nOf course, these steps for host B can be repeated on other hosts C, D, E,... to sync them all.\nHere, \"syncing\" means providing synchronized timestamps, *not* adjusting the hosts' own clocks.\n\n### To plot performance:\n`sudo apt install gnuplot`  \n`cd simulation \u0026\u0026 make`\n\n## Citing\nCamille Goudeseune and Braden Kowitz.  2004.  \"Synchronous data collection from diverse hardware.\"  \n*Driving Simulation Conference - Europe (Conférence Simulation de Conduite)*, pp. 245-252. \n\n## Contributing\n\n- To maintain the formatting style, `sudo apt install clang-format`, and use `clang-format` through the provided git hook:  \n  `git config core.hooksPath .git_managed_hooks`\n- New code should follow the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c-core-guidelines).\n- For profiling and code coverage, `sudo apt install gcovr`.  See also `man gcovr`.  \n  To collect and print statistics, `make clean \u0026\u0026 make profile`, run some tests (but not test-bindings), `gcovr`.  \n  To reset statistics before another profile, `make purge`.  \n  To cease profiling, `make purge \u0026\u0026 make`.\n\n## Roadmap\nWhen this software launched in 2004, lab software was pretty much restricted to\ndesktop OSes.  But by now, labs and makerspaces use many more software\ndevelopment environments, especially for hardware I/O:\nArduino, musl, Raspi, and smartphones to name a few.\nThe choice of mature scripting languages has grown similarly.\n\nAlso, private wired 10baseT subnets have been pretty much replaced by WLAN,\nwith much more bandwidth but less predictable performance.\n\nFinally, since 2004, C++ standards have improved\nand software engineering in general has matured.\n\nTherefore, these steps are proposed.\n\n- Keep modernizing the code.\n- Clean up the interface to other languages.\n- Implement integration testing.\n- Make reproducible performance tests for some use cases.\n- Extend multiplatform support beyond POSIX, for other microarchitectures.\n- For some use cases, reduce energy consumption, file size, bandwidth.\n- To better exploit the strengths and manage the weaknesses of WLAN,\nreplace the generic network stack's lower OSI layers with\nspecific ones for Wi-Fi, Bluetooth LE, Zigbee, 6LoWPAN, etc.\n- Throughout all these, insert optimization passes.\n- Explore more distant use cases that need clock sync, such as\nhigh performance computing, logfile evaluation, and security breach detection.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamilleg%2Fclockkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamilleg%2Fclockkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamilleg%2Fclockkit/lists"}