{"id":23691923,"url":"https://github.com/justin900429/tea-tok-clock","last_synced_at":"2026-04-28T17:34:58.252Z","repository":{"id":109922036,"uuid":"425224982","full_name":"Justin900429/Tea-Tok-Clock","owner":"Justin900429","description":"Project for the Discrete Mathematics course in NYCU 2021 Fall","archived":false,"fork":false,"pushed_at":"2022-01-16T09:23:30.000Z","size":2038,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-22T08:36:44.794Z","etag":null,"topics":["clock","python","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Justin900429.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":"2021-11-06T11:20:15.000Z","updated_at":"2022-01-03T13:05:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"488b7922-b66e-444c-b410-1939384a3f86","html_url":"https://github.com/Justin900429/Tea-Tok-Clock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Justin900429/Tea-Tok-Clock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justin900429%2FTea-Tok-Clock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justin900429%2FTea-Tok-Clock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justin900429%2FTea-Tok-Clock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justin900429%2FTea-Tok-Clock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Justin900429","download_url":"https://codeload.github.com/Justin900429/Tea-Tok-Clock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justin900429%2FTea-Tok-Clock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32392300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","python","raspberry-pi"],"created_at":"2024-12-30T02:59:32.820Z","updated_at":"2026-04-28T17:34:58.247Z","avatar_url":"https://github.com/Justin900429.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\n## Introduction\n\nIn this project, we're going to measure time using some physics phenomenon. We choose to\nuse [Newton's law of cooling](https://en.wikipedia.org/wiki/Newton%27s_law_of_cooling) as the basics to figure out the\ntime.\n\n## Set up the environment\n\n```shell script\n$ pip install -r requirements.txt\n```\n\n1. Push `tools` and `sensor.py` to RPI\n2. The circuit should be set up:\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"circuit\" src=\"images/circuit.svg\"/\u003e\n\u003c/p\u003e\n\n\n## Experiments\n\nTo find k, we test it different ways:\n\n* Finding the mean of k\n* Using linear regression in log-scale\n\n  \u003cbr/\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/exp.svg\" width=\"70%\"/\u003e\n  \u003c/p\u003e\n\n## Configuration\n\n```python\nK: float = 0.02  # Constant for the Newton Law of cooling\nT_s: float = 23.0  # Surrounding temperature\nT_initial: float = 100.0  # Initial temperature\n\nHOST: str = \"\u003caddress of RPi\u003e\"\nPORT: str = \"\u003cPort to be used\u003e\"\n```\n\n## Training\n\nThe training file is located in `train` folder. The default value is listed below.\n\n```shell\n$ python train/train.py \\\n    --file_name exp/colling.csv \\\n    --weight exp/model.pt\n```\n\n\u003e For more training arguments, please see `train/train.py`\n\nThe training process will be like:\n\n```\nEpoch 1: 100%|██████████████████████████████████████████████| 465/465 [00:00\u003c00:00, 1301.83it/s, Loss: 1.394]\nEpoch 2: 100%|██████████████████████████████████████████████| 465/465 [00:00\u003c00:00, 1259.02it/s, Loss: 0.867]\n...\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/cooling_eval.png\" width=\"80%\"/\u003e\u003cimg src=\"images/heating_eval.png\" width=\"80%\"/\u003e\n\u003c/p\u003e\n\n\n## Running code\n\nTo successfully activate the code, both `clock.py` and `server.py` should be started:\n\u003e Note: `sensor.py` or `sensor_sim.py` should be run first\n\n```shell\n# For simulation\n$ python sensor_sim.py\n$ python clock.py\n``` \n\n```shell\n# For cooling\n$ python sensor.py\n$ python clock.py --mode \u003cmode\u003e\n```\n\n```shell\n# For heating\n$ python sensor.py\n$ python clock.py --mode model --heating --weight exp/heating.pt\n```\n\nThe result would be like\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/window.png\" width=50%/\u003e\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustin900429%2Ftea-tok-clock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustin900429%2Ftea-tok-clock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustin900429%2Ftea-tok-clock/lists"}