{"id":21723659,"url":"https://github.com/alanbchristie/python-cm4-fan-controller","last_synced_at":"2025-10-28T22:47:46.303Z","repository":{"id":213602337,"uuid":"734495441","full_name":"alanbchristie/python-cm4-fan-controller","owner":"alanbchristie","description":"A temperature-based fan controller for the Compute Module 4 IO board","archived":false,"fork":false,"pushed_at":"2024-01-11T14:13:36.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T12:37:51.680Z","etag":null,"topics":["compute-module-4","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alanbchristie.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":"2023-12-21T20:42:59.000Z","updated_at":"2023-12-24T11:20:16.000Z","dependencies_parsed_at":"2023-12-21T21:48:09.999Z","dependency_job_id":"0e9a6a69-421e-47ef-ac68-836e7ab2d384","html_url":"https://github.com/alanbchristie/python-cm4-fan-controller","commit_stats":null,"previous_names":["alanbchristie/python-cm4-fan-controller"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alanbchristie/python-cm4-fan-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbchristie%2Fpython-cm4-fan-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbchristie%2Fpython-cm4-fan-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbchristie%2Fpython-cm4-fan-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbchristie%2Fpython-cm4-fan-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alanbchristie","download_url":"https://codeload.github.com/alanbchristie/python-cm4-fan-controller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbchristie%2Fpython-cm4-fan-controller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281527388,"owners_count":26516845,"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-10-28T02:00:06.022Z","response_time":60,"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":["compute-module-4","python"],"created_at":"2024-11-26T02:41:12.081Z","updated_at":"2025-10-28T22:47:46.263Z","avatar_url":"https://github.com/alanbchristie.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python CM4 Fan Controller\n\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/alanbchristie/python-cm4-fan-controller)\n\n[![build](https://github.com/alanbchristie/python-cm4-fan-controller/actions/workflows/build.yaml/badge.svg)](https://github.com/alanbchristie/python-cm4-fan-controller/actions/workflows/build.yaml)\n\n[![License](http://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat)](https://github.com/alanbchristie/python-cm4-fan-controller/blob/master/LICENSE.txt)\n\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![Packaged with Poetry](https://img.shields.io/badge/packaging-poetry-cyan.svg)](https://python-poetry.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nA temperature-based fan controller for the Compute Module 4 (CM4) IO board.\n\n## Contributing\nThe project uses: -\n\n- [pre-commit] to enforce linting of files prior to committing them to the upstream repository\n- [Commitizen] to enforce a [Conventional Commit] commit message format\n- [Black] and [isort] as a code formatter\n\nYou MUST comply with these choices in order to contribute to the project.\n\nTo get started review the pre-commit utility and the conventional commit style\nand then set-up your local clone by following the Installation and Quick Start sections: -\n\n    poetry shell\n    poetry install\n    pre-commit install -t commit-msg -t pre-commit\n\nNow the project's rules will run on every commit, and you can check the current health\nof your clone with: -\n\n    pre-commit run --all-files\n\n## Hardware\nThis code is designed to tun on the CM4 IO board where, according to the\n[CM4 datasheet], to enable the I2C bus to the fan controller,\nyou will need `dtparam=i2c_vc=on` set in your `/boot/config.txt`.\nThe fan controller will then be on i2c-10 at the 7-bit address 0x2f.\n\nThe fan I'm using is a Waveshare, part number [CM4-FAN-3007-12V].\n\nThe practical fan speed range (found empirically) is between between 45 (18%)\nand 255 (100%). The fastest speed while still remaining quiet, i.e. the\nfastest speed that isn't considered distractingly noisy when running within a\ncouple of feet of the user, is about 70 (27%).\n\n## Installation\nYou typically run the controller as a systemd service on the CM IO board.\nThe repository contains an example service file that you can use as a template.\n\nClone the repository to your CM4 IO board and install the service file: -\n\n    git clone https://github.com/alanbchristie/python-cm4-fan-controller\n    cd python-cm4-fan-controller\n\nEdit the `cm4-fan-controller.service` file to suite your needs and then install it: -\n\n    sudo cp cm4-fan-controller.service /lib/systemd/system\n    sudo chmod 644 /lib/systemd/system/cm4-fan-controller.service\n    sudo systemctl daemon-reload\n    sudo systemctl enable cm4-fan-controller.service\n\nAnd then reboot the CM4 to make suer the service starts automatically on boot.\n\n    sudo reboot\n\n---\n\n[black]: https://black.readthedocs.io/en/stable/\n[commitizen]: https://commitizen-tools.github.io/commitizen/\n[conventional commit]: https://www.conventionalcommits.org/en/v1.0.0/\n[cm4 datasheet]: https://datasheets.raspberrypi.com/cm4io/cm4io-datasheet.pdf\n[CM4-FAN-3007-12V]: https://www.waveshare.com/cm4-fan-3007.htm\n[isort]: https://pycqa.github.io/isort/\n[pre-commit]: https://pre-commit.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanbchristie%2Fpython-cm4-fan-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falanbchristie%2Fpython-cm4-fan-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanbchristie%2Fpython-cm4-fan-controller/lists"}