Since I had installed PLEX and Pi-Hole on my RPi, I needed a good cooling system. First was to stick a simple heat sink, but I wanted a bit more. I found this great Raspberry Pi RGB Cooling HAT with adjustable fan and OLED. But since I am using Ubuntu Core, a few more tweaks are needed.
First we need to add the few python 3 dependencies needed by the scripts reading from the I2C pins.
sudo apt install -y python3-smbus i2c-tools python3-pip python3-pil python3-rpi.gpio python3-setuptools sudo pip3 install Adafruit-SSD1306
Testing the monitoring program
I have customized the scripts given by the manufacturer to do the following:
- Remove program outputs
- Tweak the fan speed up and down depending on CPU temperature
The scripts are available here:
- Python script cooling.py
- Installer: it installs the dependencies (if missing) and create the start on boot
- startup.sh for systemtd to run
- cooling.service to configure the service
The best way is to clone the git repository and copy the necessary files to /opt
cd /tmp git clone https://github.com/jscoobyced/raspi-utils cd /tmp/raspi-utils sudo mv cooling-hat-oled /opt/cooling-fan cd /opt/cooling-fan chmod +x install.sh startup.sh sudo ./install.sh
Reboot your RPi and you’re good to go!