Added Some Dokumentation to the README and the individial scripts
This commit is contained in:
@@ -1,12 +1,32 @@
|
|||||||
# PiVideo
|
# PiVideo
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
This is a collection of scripts which run a video in a loop until a Button connected to GPIO is Pressed.
|
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.
|
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
|
```bash
|
||||||
wget -L "https://raw.githubusercontent.com/miT-nib-hcI/PiVideo/main/setup.sh"
|
wget -L "https://raw.githubusercontent.com/miT-nib-hcI/PiVideo/main/setup.sh"
|
||||||
|
chmod 755 setup.sh
|
||||||
./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.
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
#! /bin/bash
|
#! /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'
|
GREEN='\033[0;32m'
|
||||||
NOCOLOR='\033[0m'
|
NOCOLOR='\033[0m'
|
||||||
|
|
||||||
|
# Servicename which this script affects
|
||||||
SERVICE_NAME="pivideo.service"
|
SERVICE_NAME="pivideo.service"
|
||||||
|
|
||||||
echo -e "${GREEN}======== Stoppe Dienst =========${NOCOLOR}"
|
echo -e "${GREEN}======== Stoppe Dienst =========${NOCOLOR}"
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
#! /bin/bash
|
#! /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'
|
GREEN='\033[0;32m'
|
||||||
NOCOLOR='\033[0m'
|
NOCOLOR='\033[0m'
|
||||||
|
|
||||||
|
# Servicename which this script affects
|
||||||
SERVICE_NAME="pivideo.service"
|
SERVICE_NAME="pivideo.service"
|
||||||
|
|
||||||
echo -e "${GREEN}======== Starte Dienst =========${NOCOLOR}"
|
echo -e "${GREEN}======== STARTING SERVICE =========${NOCOLOR}"
|
||||||
sudo systemctl start $SERVICE_NAME
|
sudo systemctl start $SERVICE_NAME
|
||||||
|
|
||||||
|
|
||||||
echo -e "${GREEN}======== Starte Autostart des Diensts =========${NOCOLOR}"
|
echo -e "${GREEN}======== ENABELING SERVICE =========${NOCOLOR}"
|
||||||
sudo systemctl enable $SERVICE_NAME
|
sudo systemctl enable $SERVICE_NAME
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
@@ -1,14 +1,20 @@
|
|||||||
#! /bin/bash
|
#! /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'
|
GREEN='\033[0;32m'
|
||||||
NOCOLOR='\033[0m'
|
NOCOLOR='\033[0m'
|
||||||
|
|
||||||
|
# Servicename which this script affects
|
||||||
SERVICE_NAME="pivideo.service"
|
SERVICE_NAME="pivideo.service"
|
||||||
|
|
||||||
echo -e "${GREEN}======== Stoppe Dienst =========${NOCOLOR}"
|
|
||||||
|
echo -e "${GREEN}======== STOPING SERVICE =========${NOCOLOR}"
|
||||||
sudo systemctl stop $SERVICE_NAME
|
sudo systemctl stop $SERVICE_NAME
|
||||||
|
|
||||||
|
|
||||||
echo -e "${GREEN}======== Stoppe Autostart des Diensts =========${NOCOLOR}"
|
echo -e "${GREEN}======== DISABELING SERVICE =========${NOCOLOR}"
|
||||||
sudo systemctl disable $SERVICE_NAME
|
sudo systemctl disable $SERVICE_NAME
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
Reference in New Issue
Block a user