Skip to content

Commit 0a46ce4

Browse files
committed
CEC Script install doco
1 parent 7bd720d commit 0a46ce4

2 files changed

Lines changed: 77 additions & 2 deletions

File tree

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
![Docker Pulls](https://img.shields.io/docker/pulls/petersem/posterr)
55
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/petersem/posterr/latest?logo=docker)
6-
![Image Build](https://img.shields.io/github/workflow/status/petersem/posterr/ci?color=green)
6+
![GitHub Stars](https://img.shields.io/github/stars/petersem/posterr?style=flat)
77
![Version](https://img.shields.io/github/package-json/v/petersem/posterr?logoColor=blue)
88
![GitHub last commit](https://img.shields.io/github/last-commit/petersem/posterr)
99
![Platforms](https://img.shields.io/badge/platform-docker-blue)
@@ -39,7 +39,9 @@
3939
- Support LED Matrix displays running Awtrix software
4040
- Display custom web pages as slides (if web page compatible) - **EXPERIMENTAL!**
4141
- Rotate display -90° (for running on display devices, like Firesticks, which do not support portait rotation)
42-
- Post API (at '/api/sleep') to toggle sleep mode. (Pass in header 'psw: your Posterr password')
42+
- Post API (at '/api/sleep') to toggle sleep mode. (Pass in header values `'psw: your Posterr password'` and `'sleep: true|false'`)
43+
- Get API at the same endpoint will return the sleep status without any parsed parameters.
44+
- Supports `CEC` control of monitor inconjunction with the Posterr `Sleep Timer`.
4345
---
4446
## Prerequisites
4547
### Mandatory
@@ -104,6 +106,10 @@ petersem/posterr
104106
### <ins>Unraid</ins>
105107
- Use the Posterr template in community apps. (Being replaced with new version)
106108

109+
---
110+
## CEC Control script installation **(rPi only)**
111+
- Install instructions are located [HERE](/scripts/scriptdoco.md)
112+
107113
---
108114
## Updates
109115
- From v1.10.1, there will be a notice at the top of the settings screen informing you if you are running an old version.

scripts/scriptdoco.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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

Comments
 (0)