5.2 KiB
5.2 KiB
Obscreen - Autorun on RaspberryPi
👈 back to readme
🔴 You want to power RaspberryPi and automatically see your slideshow on a screen connected to it and manage your slideshow ? You're in the right place.
🎛️ Hardware installation
- Download RaspberryPi Imager and setup an sdcard with
Raspberry Pi OS Lite(🚨without desktop, onlyLiteversion!). You'll find it under categoryRaspberry PI OS (other) - Log into your RaspberryPi locally or via ssh (by default it's
ssh pi@raspberrypi.local)
📡 Run the studio instance
System-wide (recommended)
Install
- Install studio by executing following script
curl -fsSL https://raw.githubusercontent.com/jr-k/obscreen/master/system/install-studio.sh -o /tmp/install-studio.sh && chmod +x /tmp/install-studio.sh && sudo /bin/bash /tmp/install-studio.sh $USER $HOME
sudo reboot
Configure
- Server configuration is editable in
.envfile. - Application configuration will be available at
http://raspberrypi.local:5000/settingspage after run. - Check logs with
journalctl -u obscreen-studio -f
Using docker run
# (Optional) Install docker if needed
curl -sSL get.docker.com | sh && sudo usermod -aG docker $(whoami) && logout
# ....then login again
# Prepare application data file tree
cd ~ && mkdir -p obscreen/data/db obscreen/data/uploads && cd obscreen
# Run the Docker container
docker run --restart=always --name obscreen --pull=always \
-e DEBUG=false \
-e PORT=5000 \
-e SECRET_KEY=ANY_SECRET_KEY_HERE \
-p 5000:5000 \
-v ./data/db:/app/data/db \
-v ./data/uploads:/app/data/uploads \
jierka/obscreen:latest
Using docker compose
# Prepare application data file tree
cd ~ && mkdir -p obscreen/data/db obscreen/data/uploads && cd obscreen
# Download docker-compose.yml
curl https://raw.githubusercontent.com/jr-k/obscreen/master/docker-compose.yml > docker-compose.yml
# Run
docker compose up --detach --pull=always
👌 Usage
- Page which plays slideshow is reachable at
http://raspberrypi.local:5000 - Slideshow manager is reachable at
http://raspberrypi.local:5000/manage
📺 Run the player instance
Autorun for a RaspberryPi
How to install
- Install player autorun by executing following script (will install chromium, x11, pulseaudio and obscreen-player systemd service)
curl -fsSL https://raw.githubusercontent.com/jr-k/obscreen/master/system/install-player-rpi.sh -o /tmp/install-player-rpi.sh && chmod +x /tmp/install-player-rpi.sh && sudo /bin/bash /tmp/install-player-rpi.sh $USER $HOME
sudo reboot
How to restart
- Just use systemctl
sudo systemctl restart obscreen-player.service
How to enable sound
- First you have to reboot your device if you never did after obscreen player installation; with command
sudo reboot - You have to set audio channel to HDMI
sudo raspi-config nonint do_audio 1(0 is for jack 3.5 output)
Manually on any device capable of running chromium
When you run the browser yourself, don't forget to use these flags for chromium browser:
# chromium or chromium-browser or even chrome
# replace http://localhost:5000 with your obscreen-studio instance url
chromium \
--disk-cache-size=2147483648 \
--disable-features=Translate \
--ignore-certificate-errors \
--disable-web-security \
--disable-restore-session-state \
--autoplay-policy=no-user-gesture-required \
--start-maximized \
--allow-running-insecure-content \
--remember-cert-error-decisions \
--noerrdialogs \
--kiosk \
--incognito \
--window-position=0,0 \
--window-size=1920,1080 \
--display=:0 \
http://localhost:5000
📎 Additional
Hardware checks
Hardware checks
-
Basic Setup For basic RaspberryPi setup you can use most of the available guides, for example this one: https://gist.github.com/blackjid/dfde6bedef148253f987
-
HDMI Mode You may need to set the HDMI Mode on the raspi to ensure the hdmi resolution matches your screen exactly. Here is the official documentation: https://www.raspberrypi.org/documentation/configuration/config-txt/video.md
However, I used this one: (2,82) = 1920x1080 60Hz 1080p
How to upgrade studio instance
with docker run
- Just add
--pull=alwaysto yourdocker run ...command, you'll get the latest version automatically.
or with docker compose
- Just add
--pull=alwaysto yourdocker compose up ...command, you'll get the latest version automatically.
or system-wide
- Using Git Updater plugin
- Or by executing following script
cd ~/obscreen
git pull
source ./venv/bin/activate
pip install -r requirements.txt
sudo systemctl restart obscreen-studio.service