{"id":22398664,"url":"https://github.com/wallneradam/tc420","last_synced_at":"2025-08-11T17:08:00.334Z","repository":{"id":48688512,"uuid":"304945105","full_name":"wallneradam/tc420","owner":"wallneradam","description":"Python Library and CLI for TC420 (USB) LED Controller / Dimmer","archived":false,"fork":false,"pushed_at":"2024-06-04T12:29:19.000Z","size":38,"stargazers_count":25,"open_issues_count":12,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-30T00:27:06.651Z","etag":null,"topics":["aquarium","aquarium-automation","aquarium-controller","aquarium-lights","led","libusb","python3","raspberry","tc420"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wallneradam.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}},"created_at":"2020-10-17T18:37:29.000Z","updated_at":"2025-06-10T23:54:08.000Z","dependencies_parsed_at":"2022-08-29T05:32:04.121Z","dependency_job_id":null,"html_url":"https://github.com/wallneradam/tc420","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wallneradam/tc420","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallneradam%2Ftc420","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallneradam%2Ftc420/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallneradam%2Ftc420/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallneradam%2Ftc420/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wallneradam","download_url":"https://codeload.github.com/wallneradam/tc420/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallneradam%2Ftc420/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269922906,"owners_count":24496999,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["aquarium","aquarium-automation","aquarium-controller","aquarium-lights","led","libusb","python3","raspberry","tc420"],"created_at":"2024-12-05T07:11:43.629Z","updated_at":"2025-08-11T17:08:00.306Z","avatar_url":"https://github.com/wallneradam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TC420 LED Controller Python Library and Command Line Interface\n\nTC420 is a LED dimmer/controller mainly used for aquarium lightning. There is an attached software, PLED, you can use for programming it, but it is not very well written, and not good for automation tasks. Also it is Windows only.\nYou can found more information on its fun (not official) site: https://www.tc420.net/.\n\nI reverse engineered the USB protocol the device uses and wrote this library and CLI tool for making endless possibilities from this device. I successfully implemented all the functions PLED.exe have.\n\nThe library is cross platform, works everywhere where [libusb](https://github.com/libusb/libusb) works. But because it is a HID device, and MacOS does not allow to detach kernel drivers of HID devices, on MacOS it is extremely hard to make it work in current form. But I tested on **Windows** and **Linux**, and works fine there. It works on (all kinds of) Raspberry Pi.\n(Actually there is a python library for HID devices, so theoretically it is possible to rewrite the lib using hidapi, and then it could work on MacOS as well, pull requests are welcome...)\n\nIt has a full featured **CLI**, which can act as a reference for the libray. Also you can use it for automation, or just for fun.\n\n## Possibilities / ideas\n\n- You can program your device in shell scripts / batch files, or with Python programs\n- You can run immediate scenes, e.g. a sunset or sunrise by a click to attract your guests\n- It is possible to access the device remotely by e.g. a Raspberry Pi Zero W\n- A web / mobile application can be written to start scenes, or modify program of device (not yet written by myself)\n- Different color themes on sunny/rainy/cloudy days, by using online weather sources\n- Real sunset and sunrise program every day by using sunset/sunrise database.\n- ...\n\n## Install\n\n### Linux\n\n- Install the library:\n```bash\npip3 install tc420\n```\n- Install libusb if not installed. On Raspberry pi it is installed by default.\n- Create a *plugdev* group if not exists, it exists by default in all Debian based distros.\n- Enable the access of the device by users in plugdev group with an udev rule found here: [99-tc420.rules](https://raw.githubusercontent.com/wallneradam/tc420/main/etc/udev/rules.d/99-tc420.rules).\nPut that (by root user) in */etc/udev/rules.d/*, then replug your device.\n- Put yourself into the *plugdev* group then relogin:\n```bash\nsudo adduser your_user_name plugdev\n```\n\n### Windows\n\n- Install Python 3.6+ if not installed: https://docs.python.org/3/using/windows.html\n- Install the library:\n```\npip install tc420\n```\n- Install latest libusb, which is kinda tricky: [this Stackoverflow answer worked for me](https://stackoverflow.com/questions/33972145/pyusb-on-windows-8-1-no-backend-available-how-to-install-libusb/34720024#34720024)\n\n### From source\n\nThis description works without modification on Linux, on Windows, you may need to use `pip` instead of `pip3` and `python` instead of `python3`. And the activate.bat is in the `Scripts` folder inside `venv`.\n\n- Clone package from GitHub:\n```\ngit clone https://github.com/wallneradam/tc420.git\n```\n- Install virtualenv (globally) if not yet installed:\n```\nsudo -H pip3 install virtualenv\n```\n- Create a VirtualEnv inside the cloned directory:\n```\nvirtualenv -p python3 venv\n```\n- Activate it:\n```\n./venv/bin/activate\n```\n- Install package with requirements:\n```\npip install -e .\n```\n\nNow you have tc420 command in your virtual environment.\n\n## Usage\n\nBoth the library and the CLI tool is documented and the source code is commented, so you can find all information inside them.\n\n### CLI\n\nYou can have the help of `tc420` command by running:\n```\ntc420 --help\n```\nThis will only give you brief information about all commands.\nYou can have full description of every commands by running:\n`tc420 [command] --help` e.g.:\n```\ntc420 mode --help\n```\n\n#### Getting started\n\nFor checking if everything is working you can sync the clock:\n```\ntc420 time-sync\n```\nOr you can run the demo which randomly fades in-out all channels:\n```\ntc420 demo\n```\n\nIf something is not working, you probably not installed libusb well, or you need to check if you have permissions to access the device.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallneradam%2Ftc420","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwallneradam%2Ftc420","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallneradam%2Ftc420/lists"}