Code Monkey home page Code Monkey logo

rpi-kiosk's Introduction

Kiosk / Dashboard for Raspberry Pi

Configures, using Ansible, a Raspberry Pi with a locked down desktop and browser to rotate through multiple URLs. Useful for a build monitor or wallboard display.

Build Status

Features

  • Selectable Browser (Chromium, Epiphany, Firefox, Midori)
  • Configurable refresh of the browser (every 5 minutes by default)
  • Configurable on/off times for the display (default 0700-1800)
  • Configurable full screen display size (default 1920x1080)
  • Configurable use of DPMS to power down the screen during off hours (default off)
  • Systemd logs directed to alternate virtual terminal (VT12) for easy diagnosis
  • Optionally disables apt safety measures for faster installs (default off)

Using with a Raspberry PI

  1. Install pipenv (assuming Python 3) and create a python virtual environment in which to run Ansible
  2. Run Ansible Galaxy to retrieve the external roles
  3. Add an inventory entry for your Raspberry PI (ansible/inventory/hosts)
  4. Run Ansible against the Raspberry PI
pip3 install pipenv
pipenv install --three
pipenv shell
mkdir ansible/galaxy_roles
ansible-galaxy -r ansible/requirements.yml -p ansible/galaxy_roles install
ansible-playbook -i ansible/inventory ansible/site.yml

Installation Notes

It is easier to setup the Pi on a wired connection. Wifi is possible but you need to:

  1. Manually configure the Wifi
  2. Install openssh-server on the Pi
  3. Update the inventory to use the correct IP / host as needed
  4. Run Ansible as above

Settings

Modify group_vars as needed. Each role has its own defaults, the following are common settings:

Setting Description Default
debian_apt_squid_proxy_client Install Debian's Squid Proxy Client - used to speed up installs for development false
debian_apt_unsafe_fast See Speeding up Apt below false on Pi, true on vagrant
wireless_country_code Wireless Country Code for channel limits GB
wireless_networks Dict, Key is the Access Point Name, value is the PSK, see example below {}
keyboard_layout Country layout for keyboard (vagrant only) gb
timesync_pool_zone Country code for the NTP pool zone to use uk
timesync_ntp NTP servers 0, 1, 2, 3 of the specific NTP pool zone, disabled on Vagrant
kiosk_urls List of URL to use for the Kiosk https://www.google.co.uk/, `https://github.com/bdellegrazie/rpi-dashboard/'
kiosk_environment Dictionary of environment variables set when running the browser, useful for proxy configuration {}
kiosk_browser Browser to use, one of chromium, epiphany, firefox or midori epiphany

Extra settings and their defaults can be seen in ansible/roles/kiosk/defaults/main.yml

Example wireless configuration

---
wireless_networks:
  'MyWifi': 'MyPassword'

If desired, this value could be encrypted using Ansible Vault

Speeding up Apt

Apt, the package manager for Raspberry Pi's Raspbian is extremely slow and heavy on I/O due to safety measures to ensure the reliability and recovery of the package database.

If the Pi has no other manual customisations, then this repo can be used to restore a Pi from nothing so its becomes worth disabling APT's safety checks and simply going as fast as possible, however if the process breaks, the Pi may need to be formatted and re-initialised to bring it back to working state

The safety measures can be disabled by setting debian_apt_unsafe_fast: true in the Pi's group_vars or host_vars. This behaviour is switched on (true) in vagrant by default

Systemd Notes

Systemd timers are used to schedule the page switch so the resolution can be specified in seconds Systemd has support for integration with the graphical user session (see systemd.special(7), target graphical-session.target) but this integration is not implemented by any of the session managers yet. Instead a work-around described here is used: https://naftuli.wtf/2017/12/28/systemd-user-environment/

Contributing / Testing with Vagrant

  1. Install Vagrant
  2. Install pipenv and create a python virtual environment in which to run Ansible and Vagrant pipenv install --dev --three
  3. Run vagrant up

Not all roles will execute on Vagrant (timesync is skipped)

Similar Projects

Screenly OSE - supports local content / video too and has a web console for configuration. There is a professional version that has cloud storage for configuration etc.

rpi-kiosk's People

Contributors

bdellegrazie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rpi-kiosk's Issues

TASK [kiosk : Systemd Kiosk User Tasks

Hello,

I use a container Debian Buster on Proxmox 6 for Ansible

On Raspberry Pi 3 B+ with debian buster desktop version

Thank you for this playbook. I'm encountering an error with Epiphany, the full-screen.sh file is missing.

So I modified the default main.yml to use Chromium instead of Epiphany.
but I'm getting this error :

TASK [kiosk : Systemd Kiosk User Tasks] *******************************************************************************************************************
failed: [192.168.2.66] (item=browser-fullscreen.timer) => {"ansible_loop_var": "item", "changed": false, "item": "browser-fullscreen.timer", "msg": "failure 1 during daemon-reload: Failed to connect to bus: No such file or directory\n"}
failed: [192.168.2.66] (item=browser-refresh-off.timer) => {"ansible_loop_var": "item", "changed": false, "item": "browser-refresh-off.timer", "msg": "failure 1 during daemon-reload: Failed to connect to bus: No such file or directory\n"}
failed: [192.168.2.66] (item=browser-refresh-on.timer) => {"ansible_loop_var": "item", "changed": false, "item": "browser-refresh-on.timer", "msg": "failure 1 during daemon-reload: Failed to connect to bus: No such file or directory\n"}
failed: [192.168.2.66] (item=browser-tab-switch.timer) => {"ansible_loop_var": "item", "changed": false, "item": "browser-tab-switch.timer", "msg": "failure 1 during daemon-reload: Failed to connect to bus: No such file or directory\n"}
failed: [192.168.2.66] (item=disable-screensaver.service) => {"ansible_loop_var": "item", "changed": false, "item": "disable-screensaver.service", "msg": "failure 1 during daemon-reload: Failed to connect to bus: No such file or directory\n"}

I checked the files are present on the rpi in /home/kiosk/.config/systemd/user/

please can you help me ? :)

Support multiple URLs

Add the capability to support multiple Kiosk URLs with a timed rotation.

There are a number of options for timed rotation:

  1. Dumb bunny - trigger rotation of tabs by key press based on timeout
  2. Browser specific extension - there are several - I'm not sure if any appropriate exist for Epiphany or Midori
  3. Local application with custom URLs and timings e.g. https://bitbucket.org/atlassian/atlasboard. - this could be hosted remotely instead of locally too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.