Creating a digital slideshow frame with a Raspberry Pi that streams photos from your favorite Instagram accounts.
I won't go into too much detail of getting Raspbian set up since there's a ton of guides available online.
Once I got Raspbian up and running, I ran these commands to make sure everything is up to date:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install raspberrypi-ui-mods
sudo apt-get install raspberrypi-net-mods
I'll be grabbing photos from Instagram using the Instagram-Scraper, which can be installed using pip:
pip install instagram-scraper
Instagram-Scraper allows you to download photos in a variety of ways, including usernames and hashtags. When executed, the shell script download_igPhotos.sh
will grab photos from a couple of my girlfriend's favorite instagram accounts.
In the slideshow.sh
shell script, I went with feh to run my slideshow.
In order to have the screen running the slideshow without going to sleep, I installed XScreensaver using:
sudo apt-get install xscreensaver
After XScreensaver is installed, click on the Menu button (top left corner) of the desktop GUI and go to Preference > Screensaver and set the mode to "Disable Screen Saver" from the drop menu.
X must be running for XScreensaver to work so I've added startx
into my .bashrc
and launch xscreensaver
into .xsessionrc
.
To boot straight into the slideshow, the slideshow.sh
script must be added into .xsessionrc
. Here's an example of how the .xsesionrc
file should look like:
#! /bin/bash
xscreensaver &
/home/pi/frame_pi/slideshow.sh
At this point, the Raspberry Pi successfully turns on and boots straight into a slideshow of images collected from the desired Instagram accounts!
To keep things new and interesting instead of the same images all the time, I used CRON to automatically delete past images and download new images from Instagram every 3 days.
Edit your crontab with crontab -e
and add these lines:
0 0 */3 * * sudo /home/pi/frame_pi/download_igPhotos.sh
0 0 */3 * * find /home/pi/frame_pi/photos/ -type f -name "*.jpg" -mtime 3 -exec rm{} \;