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?
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 fan.py
For the standalone case I think only main.py and the misc.py would be needed, these need to be modified to not call fan or oled. Essentially just a main.py 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
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
[Unit]
Description=ROCK Pi SATA Hat Before=local-fs.target
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:
/lib/systemd/system/pigpiod.service
[Unit]
Description=Daemon required to control GPIO pins via pigpio Before=local-fs.target
[Service]
ExecStart=/usr/local/bin/pigpiod -l
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target
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
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…