snippets > use-raspbberry-pi-rgb-cooling-hat-yahboom-docker

September 08, 2020

Use the RGB Cooling HAT, by Yahboom, with Docker on your Raspberry Pi

This tutorial was tested on a Raspberry Pi 4 with RGB Cooling HAT, model “YB-EBV02 VER1.1”, by Yahboom.

The hardware creators do provide installation documentation and official code, but putting all the parts together can be challenging.

If you’re willing to use Docker, you can activate everything with one command (after enabling I2C with raspi-config).

docker run -d --restart unless-stopped --network host --privileged laury/raspberry-pi-rgb-cooling-hat:latest

You can also build the Docker image yourself using the following Dockerfile. Just remember to target ARMv7 architecture. The easiest way to achieve that is to build in the Raspberry Pi itself.

FROM python:2.7

RUN apt update &&\
    apt install -y i2c-tools git

RUN pip install Adafruit-GPIO==1.0.3 \
                Adafruit-BBIO==1.2.0 \
                Adafruit-SSD1306==1.6.2 \
                smbus==1.1.post2 \
                image==1.5.32 \

RUN git clone --depth 1 &&\
    cp -a firmware/hardfp/opt/vc/* /usr

RUN git clone &&\
    unzip Raspberry-Pi-RGB-Cooling-HAT/2.Python\ programming/ &&\
    mkdir /app &&\
    cp -a RGB_Cooling_HAT/* /app &&\
    rm -rf /tmp/*

CMD python /app/