Skip to content

Latest commit

 

History

History
171 lines (137 loc) · 6.16 KB

README.adoc

File metadata and controls

171 lines (137 loc) · 6.16 KB

PWM Fan Controller

ATtiny85 Build Pico Build

PWM fan controller projects 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.

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

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. The repository contains configuration for pre-commit, which can be used to automate 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