Digital signage with Raspberry Pi and Firebase
Simple how to
So this post is actually a dump from my notes I had taken during development of a digital signage solution for a client. The client wanted a easy way to update a remote screen.
So I needed to instantly update a remote screen that is connected to a Raspberry Pi. All I needed is a pre-configured Raspberry Pi running a fullscreen chrome browser with a website open that is hosted with Firebase. Firebase hosting includes a realtime database which I used to realtime update the website.
So to set this up you will need a firebase account and create a new project ex. signage within Firebase. The easiest way to get started with Firebase services and serving a simple html page is the use Firebase hosting.
Before we begin setting up a firebase hosting project let’s create some realtime data in Firebase. We can use this later on in the examples. Goto the Firebase console and open the database view in the develop section and create a database. When Firebase is finished creating the database for you, allow read access to the database:
and insert some key value pairs into the realtime database:
Now we are ready to create a html file served by Firebase hosting. Easiest way to setup a working example is to use the Firebase cli. With the Firebase cli we set up a new project for database and hosting like so:
$ firebase init
Next choose your project and keep the defaults. We should have ended up with a public directory with an index and 404 file. Change the index.html accordingly:
and test to see if its working
$ firebase serve
So now we know it’s working we can deploy the website. We are only deploying with option hosting because we do not want to deploy the database rules.
$ firebase deploy --only hosting
Preferred Raspberry Pi disk image: raspian lite and config:
$ sudo raspi-config
- change user password
- Boot options > Select “Desktop / CLI” and then “Console Autologin”.
- Interfacing options > Enable SSH
- Network options > change hostname
Install needed packages:
$ sudo apt-get install --no-install-recommends \
Create config file to automatically start Chromeium on signage website
# Disable any form of screen saver / screen blanking / power management
Create script on boot
then edit .bashrc:
$ wpa_passphrase ssid password | \
Open terminal when running: