Added Some Dokumentation to the README and the individial scripts

This commit is contained in:
Tim
2024-08-12 07:25:52 +02:00
parent ba94e2a6c3
commit 41c263da15
4 changed files with 42 additions and 5 deletions
+21 -1
View File
@@ -1,12 +1,32 @@
# PiVideo
## Overview
This is a collection of scripts which run a video in a loop until a Button connected to GPIO is Pressed.
Then another video is played once.
For installation download and run setup.sh
## Installation
For installation download and run setup.sh. This will install the nesecary dependencys, create the needed folder structure and download the Script.
It will also create a SystemD service to automaticly start the program when the Pi is booted.
```bash
wget -L "https://raw.githubusercontent.com/miT-nib-hcI/PiVideo/main/setup.sh"
chmod 755 setup.sh
./setup.sh
```
## Configuration
Since it is a realativly simple Python script you can modify as needed.
The videos which are played are in the videos folder, as the nameing of the files suggests the loop.mp4 is played on loop and the trigger.mp4 is played once when the GPIO button has been pressed.
You can replace the files as needed with your own files. The files included right now are just for demonstration.
- PiVideo/
|- videos/
| |- loop.mp4
| |- trigger.mp4
|- video.py
|- start.sh
|- stop.sh
|- reload.sh
The button to trigger the video switch is by default conected to GPIO 17 and GND, you can change this in the Scipt itself if needed.
+6
View File
@@ -1,7 +1,13 @@
#! /bin/bash
## A simple whitch stops the current service and Starts it again
## used to run the current version of the script after modification
# Definition of colors for the echo outputs
GREEN='\033[0;32m'
NOCOLOR='\033[0m'
# Servicename which this script affects
SERVICE_NAME="pivideo.service"
echo -e "${GREEN}======== Stoppe Dienst =========${NOCOLOR}"
+7 -2
View File
@@ -1,14 +1,19 @@
#! /bin/bash
## A simple script which starts the playing of the Video and enables the SystemD service
# Definition of colors for the echo outputs
GREEN='\033[0;32m'
NOCOLOR='\033[0m'
# Servicename which this script affects
SERVICE_NAME="pivideo.service"
echo -e "${GREEN}======== Starte Dienst =========${NOCOLOR}"
echo -e "${GREEN}======== STARTING SERVICE =========${NOCOLOR}"
sudo systemctl start $SERVICE_NAME
echo -e "${GREEN}======== Starte Autostart des Diensts =========${NOCOLOR}"
echo -e "${GREEN}======== ENABELING SERVICE =========${NOCOLOR}"
sudo systemctl enable $SERVICE_NAME
exit 0
+8 -2
View File
@@ -1,14 +1,20 @@
#! /bin/bash
## A simple script which stops the playing of the Video and disables the SystemD service
# Definition of colors for the echo outputs
GREEN='\033[0;32m'
NOCOLOR='\033[0m'
# Servicename which this script affects
SERVICE_NAME="pivideo.service"
echo -e "${GREEN}======== Stoppe Dienst =========${NOCOLOR}"
echo -e "${GREEN}======== STOPING SERVICE =========${NOCOLOR}"
sudo systemctl stop $SERVICE_NAME
echo -e "${GREEN}======== Stoppe Autostart des Diensts =========${NOCOLOR}"
echo -e "${GREEN}======== DISABELING SERVICE =========${NOCOLOR}"
sudo systemctl disable $SERVICE_NAME
exit 0