PI4-HAT Downloads auf Deutsch
PI4-HAT Downloads auf Deutsch

Downloads

Here the Down­loads for this projekt:

Circuit

Here my project directory for KiCad.

Bash Scripts

A Bash script for switching the relays. Call like relay [0|1] [on|off]. Before executing the switch action it sleeps 2 s to make sure the capacitor is fully charged.

Relay 0 switches in my setup the NAS disk, relay 1 is for the backup disk.

The Cron script to turn off the NAS disk.
I run this once an hour. It checks if the disk appears in the system and if it is mounted. If it is not, it will be powered down.

Prequisites for the Datanbase

Next to the DBI module for access to the datenbase, which you can install with

cpan install DBI

you will also need libd-pg-perl:

apt-get install libdbd-pg-perl

Configuration Files

The Autofs mountscript auto.nas for mounting the disk. Copy it to /etc. Do not forget to set the executable flag!

The file nas.autofs. Copy it to /etc/auto.master.d. Alternatively, you may also add its single line to auto.master.

EEPROM

The file eeprom_settings_p4ex1.txt for programming the EEPROM.

for further information have a look here.