Lightweight Installation (SATA HAT only, no cpu fan, no lcd, no buttons)

I have purchased the SATA HAT without the top board and I would like to install the minimum software on my Pi in order to have the sata ports accessible. I have my own fan running on PWN_33 so this port should also not be accessed, I don’t want any extra services controlling the GPIO pins.

I looked in the install script and it seems there are basically 5 functions called

apt_check --> installs any missing python3 packages (and few others)
pip_install --> installs the screen software (Adafruit SSD1306)
pig_install --> install piggpio v77, used to control GPIO pins
deb_install --> installs the raspi-sata-0.14.deb package
dtb_enable --> not exactly sure what this does

Which sections are needed to get access to the SATA ports? It seems to me that perhaps only the deb_install section would be needed, is this correct?


I tried installing only the raspi-sata-0.14.deb package however it seems to need pigpiod, so this does not work.

Would it be possible to have a new version of the install script which only installs what is required for this use case? (sata ports only)

Do you need to use PWM to control the CPU fan? If so, then the pigpiod is required.

I have a passive heatsink on the CPU, so no PWM control is needed for the CPU fan.

All right. I will provide you with a special installation script.

1 Like

After reading the code in more detail it seems that the pigpiod is really only used for the fan control, the actual drive control uses the RPi.GPIO library instead. I am actually a bit confused why pigpio is needed at all, since RPi.GPIO also offers PWM control and could have been used in

For the standalone case I think only and the would be needed, these need to be modified to not call fan or oled. Essentially just a which calls misc.disk_turn_on()

I would give it a try myself however since you wrote the code I think you would do a better job :slight_smile:

RPi.GPIO is not used because it does not offer hardware PWM functionality… it offers software PWM functionality, but that was causing fan whine…

That’s why Setq switched over to pigpio because the lib offers hardware PWM functionality.

1 Like

I see… I am currently using the PWM from RPi.GPIO with a Noctua PWM fan without issues.

gpiozero looks like it may be another option.

The hardware PWM of gpiozero via RPIO or PiGPIO, and the RPIO is not available in Raspberry Pi 4 at present.


I’ve provided you with a new script that uses pure bash and doesn’t rely on anything.

Use the following command to install:

curl -sL | sudo -E bash -


Works perfectly, thank you!

One issue I encountered with this, the system hangs on boot waiting to mount the drives (via /etc/fstab) since the service is not running yet and the drives are not yet powered.

My fix was to edit the service so that it runs before the system tries to mount the drives

I modified /lib/systemd/system/quad-sata-lite.service

Description=ROCK Pi SATA Hat

1 Like

Thanks for sharing, I added it to the script.

Would this work for the regular quad sata with top hat? I do note that there is dependency on pigpio service starting first…

Yes should work, I had done the same with the original script while I tested it before setq made the lite script. Just edit the pigpiod service located at:


Description=Daemon required to control GPIO pins via pigpio
ExecStart=/usr/local/bin/pigpiod -l
ExecStop=/bin/systemctl kill pigpiod

So it turns out neither RPi.GPIO nor pigpiod are needed to get hardware PWM from the Pi, you can load a pwm kernel overlay and access the BCM2835 hardware PWM directly, see below

I am now using this method and have a simple bash script running the PWM, 0% CPU load compared to the ~7% I was seeing with pigpiod and the ~17% I was seeing with RPi.GPIO

actually for PiGPIO, the 7% was due to alerts and sampling… if u set the flag -m to the service, the CPU load from PiGPIO drops to 0…

but good find though…

It is quite nice, because if you combine this with the lite script that setq wrote, no additional packages are needed to run the SATA Hat and to control the fans.

But for those that need the top hat oled… I think there’s probably a way to change the pwm implementation… doesn’t seem like much change to the code, just the calls would be different… the main arguments Ike dutycycle are largely there already…