Skip to content

Latest commit

 

History

History
176 lines (142 loc) · 6.81 KB

README.adoc

File metadata and controls

176 lines (142 loc) · 6.81 KB

PWM Fan Controller

ATtiny85 Build Pico Build QT Py CH32V203 Build

PWM fan controller written in Rust targeting different microcontrollers. Currently, these are basic examples for setting the Noctua NF-P12 redux-1700 PWM Fan to a quiescent 40% speed. Implementations for specific boards can be found in the boards directory. The implementations include boards targeting the Arm, AVR, and RISC-V architectures.

ATTiny85 PWM Fan Controller Protoboard Top View

ATTiny85 PWM Fan Controller Breadboard Top View 1

Raspberry PI Pico PWM Fan Controller Breadboard Top View 1

QT Py CH32V203 PWM Fan Controller Breadboard Top View 1

Develop

Nix is used to manage dependencies, toolchains, and development environments for each board. This makes it possible to develop locally in an environment that is consistent with CI. The nix develop command can be used to enter or run commands in an environment with all of the necessary dependencies. For convenience, direnv can be used to automatically load this environment when entering the project’s directory. The mkhl.direnv VSCode extension integrates this environment in VSCode for development. Nix also generates the configuration for pre-commit, which automates formatting and various checks when committing changes. Follow the instructions here to set up your development environment.

  1. Install an implementation of Nix, such as Lix used here.

    curl -sSf -L https://install.lix.systems/lix | sh -s -- install
  2. Install direnv for your system according to the direnv installation instructions.

    sudo rpm-ostree install direnv
    sudo systemctl reboot
  3. Integrate direnv with your shell by following the instructions on the direnv Setup page.

  4. Clone the repository.

    git clone https://github.com/jwillikers/pwm-fan-controller.git
  5. Permit the direnv configuration for the desired board or boards in the repository. The following command allows loading the environments for all boards.

    direnv allow boards/*
  6. Run pre-commit install to configure pre-commit hooks in the repository.

    pre-commit install
  7. The just command runner can be used to perform common tasks, such as building the and flashing the firmware for a particular board. The commands do not automatically use or assume a Nix environment. When in the directory for a particular board, this shouldn’t be a problem as direnv automatically loads the Nix environment. However, the top-level directory does not load any environment, so use nix develop as required to execute the just commands.

    nix develop .#attiny85 --command just flash attiny85

Serial Port Permissions

On Linux, most distributions require the user to be in a particular group to access serial ports. Here, I document the particular steps required to permit access to serial ports on Fedora Atomic variants.

  1. On Fedora Atomic, the dialout group does not exist in the /etc/group, so it must be added there.

    echo (getent group dialout) | sudo tee -a /etc/group
  2. Add the user to the dialout group to access USB without requiring superuser privileges.

    sudo usermod --append --groups dialout $USER
  3. Log out and back in for the group change to take effect.

Contributing

Contributions in the form of issues, feedback, and even pull requests are welcome. Make sure to adhere to the project’s Code of Conduct.

Open Source Software

This project is built on the hard work of countless open source contributors. Several of these projects are enumerated below.

Code of Conduct

Refer to the project’s Code of Conduct for details.

License

Licensed under either of

at your option.

© 2022-2024 Jordan Williams

Authors