Control your Raspberry Pi's temperature with a fan.
## Description
This program control a GPIO pin depending on the temperature of your CPU. It is thought of as a way to regulate the CPU's temperature by connecting a fan to the GPIO and letting the program check the temperature at a regular interval in the background.
If you prefer to cross-compile from a non raspberry computer I followed the manual instructions at <https://mudge.name/2019/01/02/cross-compiling-rust-for-a-raspberry-pi-on-travis-ci/>. Once build, transfert the binary to your target and test it.
To use the application you just have to start the `tempi` executable. If you want to use it on a daily basis, it is recommanded to start the application at logon or startup.
The only way to configure `tempi` is with a configuration file. The configuration file is written in yaml, you can copy one of the examples below and twist the values as you like.
On Linux the configuration file is `~/.config/tempi/tempi.yml`.
If you prefer using the `PWM` mode you first need to follow this instructions to [enable PWM on your Raspberry Pi]. It is also recommended to let [the members of the gpio group configure PWM] without being root. Then you can use and adapt the following configuration file:
frequency: 1 # You should tweak this value depending on your fan and expected percentage of normal usage.
channel: Pwm0
verbosity_mode: Human
```
## State of the project
I feel that this project is fully featured for what it is right now: a raspberry pi temperature controler.
If someone would create a circuit using a 5V PIN and a GPIO as switch, I would love to elaborate and test new cooling strategies.
It is also still possible to support more boards and have a better output for logging/plotting on an other application.
Code wise it is one of my first Rust projets so any hint on how to upgrade my code and the ergonomics of `tempi` is welcome. Including adding tests, better usage of error, understanding if I should use `embedded-hal`, ...
I also need to document the code and maybe expose an interface to use it as a library.