Well you've set up your digital poster display using the TV's slideshow feature, and a USB drive, but have hit the limits of the television's firmware... it's time to try a taste of Raspberry Pi! In this article I'll cover how to use a Raspberry Pi unit to control your digital signage. I normally try to be pretty light-hearted (dare I say funny?) when I write, but there's a lot of technical information to cover this time around... so if this article seems a bit "dry" compared to what you're used to I apologize.
Things you'll need:
- Raspberry Pi B+ ($35.00)
- WiFi Dongle ($9.00)
- Micro SD Card (at least 4 gigs)
- Short HDMI Cord
- Short USB Micro cord
- Raspberry Pi B+ Case (Optional)
- USB Keyboard & Mouse (just for the initial setup)
- Velcro Pads
The initial Raspberry Pi setup is pretty straight forward, and in an effort to keep things as streamlined as possible, I'm just going to point you to the official instructions on the Raspberry Pi site HERE; go ahead and read it... I'll wait. One thing I should note though, is that on your initial boot up you'll want to set Raspian to boot to desktop.
The first thing you'll need to do after the initial startup is set up your WiFi connection so that we can connect to the internet to download all the packages and dependencies that we're going to need to get everything up and running. To do this you'll need to plug in your WiFi adapter, and open the WiFi Config utility located under "Preferences" in the main drop down menu. From the WiFi Config screen you're going to click "Scan". It may take a few seconds for the scan to complete, but once it's done you should see your home network in the list; just double-click the name of your router, enter your password in the "PSK" field, click add, and close the WiFi Config utility.
Now that we have access to the internet we're going to start out by downloading everything that we're going to need to get this up and running. We're going to do this through the Terminal (this is the small icon at the top of the screen that looks like a small black computer screen). For those of you who haven't had much (if any) experience with Linux I know this can seem very intimidating, but I'm going to do my best to make this as easy as possible by just providing you with the commands to type (with no understanding of what you're doing required lol).
Just enter each of the following commands (one at a time) into the Terminal, and give each of the programs enough time to install (you'll know when they're done). The Terminal has a very "old school" feel to it, and in that tradition you'll have to pay attention because it will ask you to type "Y" and "Enter" from time to time to confirm that you want to install some of the packages.
sudo apt-get update
sudo apt-get install feh
sudo apt-get install samba
sudo apt-get install samba-common-bin
sudo apt-get install xscreensaver
sudo mkdir -p /home/pi/frame/posters
Now we need to set up a way to move our posters over to our nifty new Raspberry Pi. To do this we need to know the name of our Windows workgroup, by default Microsoft has aptly named it... WORKGROUP. If you haven't changed this, then you don't have to worry about it; if you have, then you'll need to make note of it. This can be found (on your computer) by going to the Control Panel, and looking under System. Next you'll have to type the following command in the Terminal.
sudo leafpad /etc/samba/smb.conf
This will open up a text editor (very similar to Notepad in Windows). If you've changed your workgroup name you'll have to look for the entry
workgroup = WORKGROUP under the Global Settings header, and change the workgroup name to whatever your workgroup is called. Like I said earlier, if you haven't changed your workgroup name then you don't have to worry about this.
Next you'll have to scroll all the way down to the bottom of the page, and enter the following text.
comment = posters share
path = /home/pi/frame/posters
writeable = yes
guest ok = no
read only = no
only guest = yes
create mask = 0644
directory mask = 0755
browseable = yes
public = yes
force user = Administrator
force group = Administrator
Once you've done that you can click "Save", and close Leafpad. Now go back to the Terminal and type the following commands to finish setting up Samba.
sudo service samba restart
sudo chmod 0777 /home/pi/frame/posters
sudo useradd -s /bin/true Administrator
sudo smbpasswd -a Administrator
It will ask you to enter & confirm a password for the Administrator; enter
raspberry both times. Now when you go into Explorer on your Windows computer, Raspberry Pi should show up in your network with a folder named Posters in it. From there you just have to drag the image files that we prepared in the previous article over to the new Posters folder on your Raspberry Pi (this can take some time).
Next we need to write the script that's going to run our slideshow. We're going to do this with the following commands in the Terminal.
sudo leafpad start_slideshow.sh
This will open up the text editor again. On this blank page we're going to enter the following string of text...
/usr/bin/feh --quiet --recursive --randomize --full-screen --zoom max --hide-pointer --slideshow-delay $DELAY /home/pi/frame/posters
...and then click "Save". The command
DELAY="120" denotes the amount of time (in seconds) that each image will be displayed, you can change this to any number you want. Also if you have a specific order that you want your images to display in, you can remove the
Next type the following commands to make the script executable, and navigate back up to the main directory.
sudo chmod +x start_slideshow.sh
What we need to do next is set our slideshow to start automatically whenever your Raspberry Pi unit turns on. To do this we need to modify the Autostart file to include our custom slideshow script by entering the following into the Terminal.
sudo leafpad /etc/xdg/lxsession/LXDE-pi/autostart
This will open up the text editor... again. We need to add the following text to the end of the file, and then save it.
The last thing we need to do is to disable the screen saver so that our slideshow doesn't get interrupted. To do this we just navigate to the screensaver settings under Preferances/Screensaver in the main menu drop down. Once this is open just change the "Mode:" from "Random Screen Saver" to "Disable Screen Saver", and close the window.
If you've done everything correctly you should be ready to go. To test everything out just type the following command into the terminal.
This will reboot your Raspberry Pi, and the slideshow should start as soon as it's finished. Now sit back and enjoy the magic for a bit.
Once you've had a second to admire your work it's time to tidy things up, and get your TV back up on the wall. You can unplug the keyboard, and mouse, from the Raspberry Pi; you won't be needing these any more. Find a place on the back of the TV where you can mount the Pi unit; place a couple of pieces of the velcro on the back of the Raspberry Pi, and corresponding place on the TV. Now you can put your Raspberry Pi on the back of the screen, and use some simple tape to hold the HDMI & USB cables in place (you don't want them sticking out from the back of the TV do you?). All that's left now is to put your new display back on the wall, and let the awesomeness rain.
This solution allows you a lot more control over your display, and can be used for a variety of purposes (aside from a Movie Marque) such as a digital picture frame for art, photography, comic book covers... or even as a free Digital Signage solution for Kiosks; the possibilities are endless.
You can use your computer to wirelessly add more posters whenever you want; just drag them from your computer to the Posters folder on your network. Once you've added new art you'll have to restart the Raspberry Pi to allow it to re-read the contents of the Posters folder. To do this all you have to do is kill the power to the unit for a second, and turn it back on; or you can hook your keyboard back up and enter
sudo reboot into the terminal.
If you want to get fancy, you can get a case for your Raspberry Pi, but I don't really see an issue with leaving it open if it's going to be hidden behind your TV all the time.