Plex Movie Poster Display v3

V3 is still in development. The code, and this page, are still a work in progress.

Version 3 [ DEV - Pre-release ]
A BIG 'thank you' to everyone who is helping with this project!
Please provide feedback, suggestions, or issues. 
The comments are open.

About

Plex Movie Poster Display (PMPD) is a side project I started a few years ago. I always thought it would be cool to have a display outside my media room that would show the poster of the movie or TV show that was currently playing. I searched the internet and found similar projects, which were all windows programs.  There was just one problem… I wanted to run this project on a Raspberry Pi. So, unsatisfied with the solutions I found online, I decided to build my own.

Scene that time PMPD has grown. Many people have provided suggestion, contributed code, helped with test hardware, and spent hours helping make this project better than I imagined.

How PMPD Works

PMDP scraps http://IP_ADDRESS_OF_PLEX_SERVER>:32400/status/sessions and displays the poster, current progress, and description of the currently playing movie or TV show on a screen. If the client is not playing any media the script shows random movie posters from the Plex Server.

Items Used

Prerequisites

A working Plex Server.
Your X-Plex-Token.
Raspberry Pi OS with desktop running on your Raspberry Pi.

Download and install Raspberry Pi OS with desktop onto SD card.
(This is outside the scope of this how-to. If you need help please follow the installation instructions here.)

To enable wireless and ssh on your Raspberry Pi without a monitor, check out my how-to here.

Install Required software packages

sudo apt update && sudo apt upgrade -y
sudo apt-get install nginx php-fpm php-xml php-curl git unclutter -y

Setup PHP with NGINX

Add index.php to index line (Around line 44)
Before:
index index.html index.htm index.nginx-debian.html
After:
index index.html index.htm index.nginx-debian.html index.php;

cd /etc/nginx
sudo nano sites-enabled/default
index index.html index.htm index.nginx-debian.html index.php;
CTRL + O to write changes
CTRL + X to exit

Scroll Down, uncomment the following lines, and save the file.

location ~ \.php$ {
  include snippets/fastcgi-php.conf;
  fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}

Save Changes.

CTRL + O to write changes
CTRL + X to exit

Increase NGINX File Size Limitation

By default NGINX limits the file size you can upload (I think it defaults to 1MB). I recommend increasing the allowed file size so you can upload larger custom images.

sudo nano /etc/nginx/nginx.conf

- Add the follow in the http section after types_hash_max_size 2048;
client_max_body_size 25M;

- Save Changes.
CTRL + O to write changes
CTRL + X to exit

Increase PHP upload_max_filesize.

sudo nano /etc/php/7.3/fpm/php.ini

- Change upload_max_filesize (Around line 845)
upload_max_filesize = 25M

- Save File
- Reboot Raspberry Pi (Might not need to reboot, but I had to for change to work).

Setup PHP information file.

cd /var/www/html/
sudo mv index.nginx-debian.html index.php
sudo nano index.php
  - Add <?php echo phpinfo(); ?> to top of file.
  - Save Changes.
CTRL + O to write changes
CTRL + X to exit

Restart / Start NGINX and Test

sudo /etc/init.d/nginx reload

Opening a browser to http://<ip_address_of_your_raspberry_pi> . If everything is installed correctly. you should see the php information screen similar to this ( PHP 7.3.19-1 has been tested and works ).

Installing PMPD

Clone Master Branch (v2)

cd /your_preferred_git_directory 
sudo git clone --branch master https://github.com/MattsShack/Plex-Movie-Poster-Display.git
cd Plex-Movie-Poster-Display
sudo cp -R * /var/www/html
  - You can replace index.php used for in the testing above.

Clone Dev Branch (v3)

cd /your_preferred_git_directory
sudo git clone --branch dev https://github.com/MattsShack/Plex-Movie-Poster-Display.git
cd Plex-Movie-Poster-Display
sudo cp -R * /var/www/html
  - You can replace index.php used for in the testing above.

Fix Permissions

sudo chmod -R 774 /var/www/html/
sudo chown -R pi:www-data /var/www/html/

First Time Use

Open Browser to http://<ip_of_raspberry_pi>/settings/login.php and login with username admin and password password1 .

Once logged into the admin page, you will need to update the Plex Server IP, Plex Token, and Plex Movie Sections in “Server Configuration” before PMDP will work properly.

Important: The Movie Sections input is expecting the ID (#) of the Plex library you want PMPD to use for posters. You can add multiple sections as long as they are comma separated and contain no spaces.

How to find your Plex sections ID(s):

  • Open your Plex web interface via the browser of your choice.
  • Select the desired section(s) from menu on the left. (Example: Movies)
  • Once the section is loaded… Look towards the end of the URL in the browser. You should see something like “source=2”.

Chromium Kiosk Mode on Startup

Raspbian Buster

With Raspbian Buster I was not able to use the .desktop file method to auto start Chromium. Instead I had to create a directory and file. I am not sure if this method needs unclutter installed so I left it in the instructions.

mkdir -p /home/pi/.config/lxsession/LXDE-pi/
nano /home/pi/.config/lxsession/LXDE-pi/autostart

Add the following 
@chromium-browser --kiosk [PMPD IP Address]

-Save File
-Reboot to Test

Raspberry Pi OS

Work in progress…

Raspberry Pi Boot Config Settings 

                                 ( Use at your own risk ) 
sudo nano /boot/config.txt

-Remove black border from around screen. Uncomment 
disable_overscan=1

- Rotate Screen 90 Degrees
display_rotate=1

- Remove Raspberry Pi Power Warning
avoid_warnings=2

- Fix color depth on Raspberry Pi
framebuffer_depth=32
framebuffer_ignore_alpha=1

6 Replies to “Plex Movie Poster Display v3”

  1. Everything about V3 has been straight forward and awesome thus far. I’ve got it working on a pi w and it works great.

    Suggestion:
    I know people suggested this in v2 – video and audio stats in the “bottom” sections for coming soon and now playing would be cool.

    By the way, I am very much a beginner at these sorts of projects, your instructions were clear and concise. Looking forward to v4 and beyond!

    1. Thank you for the feedback. 🙂
      Video and audio stats in the “bottom” sections is already in the works… my goal is to have it complete for the final v3 release.

      -Matt

  2. Thank you for the instructions about moving over to this dev branch, Matt. I ended up wiping the SD card for the Pi and starting fresh, just in case.

    I’ve followed the instructions here and although I can access the new (and very cool looking) Plex-themed configuration page, I’m left with a blank black screen on the Pi. I navigated to /var/www/html and ran php -f getData.php. This is what I got, seems like there are permissions issues:

    pi@raspberrypi:/var/www/html $ php -f getData.php

    PHP Warning: include(/assets/plexmovieposter/tools.php): failed to open stream: No such file or directory in /var/www/html/getPoster.php on line 3
    PHP Warning: include(): Failed opening ‘/assets/plexmovieposter/tools.php’ for inclusion (include_path=’.:/usr/share/php’) in /var/www/html/getPoster.php on line 3
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Notice: Undefined variable: comingSoonTop in /var/www/html/assets/plexmovieposter/PlexLib.php on line 285
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMovieData.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMovieData.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMovieData.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMovieData.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMovieData.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: array_rand(): Array is empty in /var/www/html/getData.php on line 288
    PHP Notice: Undefined index: in /var/www/html/getData.php on line 289
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Notice: getimagesizefromstring(): Read error! in /var/www/html/getPoster.php on line 37
    Invalid Image

  3. I finally ordered a new Pi4 with 8GB ram, case fan and a 64 GB SD card specifically for PMPD and with it I wanted to test out the Dev branch updates of PMPD. My old Pi3 was always suffering from 100% swap memory and slow WiFi issues. The new setup and installation went very well yesterday especially since I’m very familiar with using PMPD since January 2017! I know some aesthetic changes are still being made and there were a few new options for me to get used to or learn about but WOW… Music, TV Shows, SSL, font imports… Impressive! Truly appreciate the time that goes into a project like this. Kudos and thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.