Digital Movie Poster Display Part 3: A Taste Of Pi

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:

The initial Raspberry Pi setup is pretty straight forward, and in an effort to keep b-plusthings 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.

boot

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 packageswifi 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 termneed 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.

  1. sudo apt-get update
  2. sudo apt-get install feh
  3. sudo apt-get install samba
  4. sudo apt-get install samba-common-bin
  5. sudo apt-get install xscreensaver
  6. 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.

[Posters]
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.

  1. sudo service samba restart
  2. sudo chmod 0777 /home/pi/frame/posters
  3. sudo useradd -s /bin/true Administrator
  4. 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, smbaRaspberry 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.

  1. cd frame
  2. 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...

#!/bin/sh
DELAY="120"
/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 --randomize command.

Next type the following commands to make the script executable, and navigate back up to the main directory.

  1. sudo chmod +x start_slideshow.sh
  2. cd ..

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.

/home/pi/frame/start_slideshow.sh

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.

sudo reboot

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 IMG_20150205_213801unplug 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.

IMG_20150205_213903This 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 IMG_20150205_215529Posters 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.

8 thoughts on “Digital Movie Poster Display Part 3: A Taste Of Pi”

  1. I just wanted to say thank you for this post. I just finished doing one of these. I figure I give some updates as I did run into some problems.

    My base setup was different in that I was using a Raspberry Pi 3 so I didn’t have to install any wifi card and just used the onboard wifi. It was very simple to setup, essentially click on the wifi icon and select my network.

    I followed all the instructions but unfortunately the slideshow did not start on reboot. It seemed there was a problem with my autostart file. After some googling I found the solution from this website (with the info that seemed to solve the problem):

    http://stackoverflow.com/questions/35481305/autostart-does-not-work-after-user-reboot
    This was the solution that I copied:
    “I have solved my problem by using ~/.config/lxsession/LXDE-pi/autostart instead of /etc/xdg/lxsession/LXDE-pi/autostart .Now everything works fine. I can not understand how this solve my problem. – mozer Apr 15 at 7:51”

    I don’t have experience with Raspberry Pi’s and know almost no programming so I’m really not sure why this fixed my issue. But if you problems you may want to give it a try.

    I also changed some of the feh display attributes. Here is a good description of the syntax options that you may find useful:

    https://linux.die.net/man/1/feh

    And as mentioned by another comment there is no space in “– randomize” and should be “–randomize”.

    Hope this helps. Thanks.

Discussion:

Return to The Plastique Boutique