|
| 1 | + |
| 2 | +# Posterr Script - Download and start install steps |
| 3 | +## What is this? |
| 4 | +If you implement the `Sleep Timer` feature in Posterr, the screen is blanked out, but still powered on. This script uses the [`CEC`](https://support.google.com/chromecast/answer/7199917?hl=en#:~:text=CEC%20(Consumer%20Electronics%20Control)%20allows,Google%20streaming%20device%20is%20connected.) feature of your HDMI connected display to put the display in standby mode. This will save power and increase the longevity of your display. |
| 5 | + |
| 6 | +*Posterr scripts are designed to work on a rPi with a connected CEC compatible display.* |
| 7 | + |
| 8 | +## Compatibility |
| 9 | +There are items required for the script |
| 10 | +- These scripts will only work on a `Raspberry Pi 4/5`, that is being used to display Posterr |
| 11 | +- The operating system should be `PI OS` or `PI OS Lite`. |
| 12 | +- Displays connected via HDMI. |
| 13 | +- The monitor or tv being used must support CEC control. |
| 14 | +- The `cec-utils` package is required for this script to work. |
| 15 | +*(the install script will install this if needed)* |
| 16 | + |
| 17 | +## Get the Posterr scripts |
| 18 | +### Download |
| 19 | +``` |
| 20 | +cd ~/ |
| 21 | +curl -sSL https://raw.githubusercontent.com/petersem/posterr/master/scripts/rpiwatcherservice.tar.gz -o rpiwatcherservice.tar.gz |
| 22 | +mkdir ~/posterr-scripts |
| 23 | +``` |
| 24 | +### Decompress |
| 25 | +``` |
| 26 | +tar -xvf rpiwatcherservice.tar.gz -C ~/posterr-scripts |
| 27 | +``` |
| 28 | +### Set script permissions |
| 29 | +``` |
| 30 | +cd ~/posterr-scripts |
| 31 | +sudo chmod 777 sleepwatch-install-service.sh |
| 32 | +sudo chmod +X sleepwatch-install-service.sh |
| 33 | +``` |
| 34 | +### Start installation |
| 35 | +``` |
| 36 | +./sleepwatch-install-service.sh |
| 37 | +``` |
| 38 | +> |
| 39 | +> Installation script **MUST** run as your standard user, not with sudo |
| 40 | +> |
| 41 | +## Uninstall |
| 42 | +To uninstall the Poster Script, run the remove script and then delete the poster-scripts folder |
| 43 | +``` |
| 44 | +~/posterr-scripts/sleepwatch-remove-service.sh |
| 45 | +cd ~ |
| 46 | +sudo rm -R posterr-scripts |
| 47 | +``` |
| 48 | +## Troubleshooting |
| 49 | +- Limited support is available on [Discord](https://discord.gg/TcnEkMEf9J). |
| 50 | +- Run the following command to check the status of the service. |
| 51 | +``` |
| 52 | +sudo systemctl status posterr-watcher.service |
| 53 | +``` |
| 54 | + |
| 55 | +## Technical Details |
| 56 | +- This script implements a `systemd service` which runs the `~/poster-scripts/sleepwatch.sh script`. |
| 57 | +- The sleepwatch script polls a Posterr API ever 5 seconds to determine if Posterr is in scheduled sleep mode or not. It then issues an `on` or `standby` command to the attached display. |
| 58 | + |
| 59 | +The script does the following: |
| 60 | +- Gathers the URL for Posterr, current user and home directory |
| 61 | +- Substitutes values and creates the 'sleepwatch.sh' file. |
| 62 | +- Substitutes values into the service `unit` file |
| 63 | +- Restarts as `super user` (required for installation) |
| 64 | +- Installs `cec-utils` if not nstalled. |
| 65 | +- Copies the `unit` file, installs, then starts the service. |
| 66 | + |
| 67 | +> ## *This is a new feature and script, so let me know how you go on Discord.* |
| 68 | +
|
| 69 | +[Return to main page](/README.md) |
0 commit comments