Difference between revisions of "DIY Digital Picture Frame"

From Makers Local 256
Jump to: navigation, search
(Displaying Local Files: added feh line and dpms line)
(Steps: added steps for cycling the picture being displayed)
Line 37: Line 37:
 
##* <pre> feh -R 2 -F /root/picture.jpg </pre>
 
##* <pre> feh -R 2 -F /root/picture.jpg </pre>
 
##* This will refresh (-R) displaying the picture.jpg file every 2 seconds, at Fullscreen (-F)
 
##* This will refresh (-R) displaying the picture.jpg file every 2 seconds, at Fullscreen (-F)
 +
 +
=== Cycling Through Pictures ===
 +
# apt-get install cron
 +
# create a script (SelectRandom.sh) that does the following
 +
<pre>
 +
#!/bin/bash
 +
cd /root/backgrounds
 +
for i in 1 2 3 4 5
 +
do
 +
        cp $(find -name '*.jpg' | shuf | head -1) /root/picture.jpg
 +
        sleep 9
 +
done
 +
</pre>
 +
# edit your cronjobs ( crontab -e )
 +
# put in the following line to run the script every 9 seconds
 +
<pre>
 +
* * * * * /root/pictureframescripts/SelectRandom.sh
 +
</pre>
 +
#* We do this because the minimum amount of time you can run a cron job is 1 minute.  So in the script, we speficy how often we want to replace the picture being displayed. Cron will then run that script once a minute.
  
 
=== (Optional) Using dockstar as a terminal ===
 
=== (Optional) Using dockstar as a terminal ===

Revision as of 20:06, 29 February 2012

Creator:
Omegix
Status:
Started
Born On:
14:09, 27 January 2012 (CST)
Last Updated:
20:06, 29 February 2012 (CDT)

Overview

See DIY_Digital_Picture_Frame/Old for previous attempt utilizing a laptop.

Digital picture frame using an embedded system. Utilizing a dockstar and a displaylink USB-to-VGA Adapter.

Amazingly big thanks to brimstone. This project mostly consisted of me asking how this could be done, and learning while brimstone typed his magic.


Steps

Displaying Local Files

  1. Get dockstar running debian squeeze with an 8gb thumb drive.
    • This step may not be necessary for others, but for some reason my dockstar installation needed the /etc/resolv.conf edited to add "nameserver 192.168.1.1" where the IP address was that of my home router's. This was so the dockstar could see the outside network and access the apt repositories.
  2. Have displaylink adapter plugged into dockstar, and screen plugged into adapter.
  3. Confirmed that udlfb driver was working with linux kernel (got the green screen when plugging in displaylink adapter)
  4. SSH into the dockstar
  5. Installed X windowing server
  6. Installed feh (image display program)
  7. Edit /etc/rc.local so that on reboot it will run "startx" to start the x server
  8. Create directory to store images in
  9. .xsession:
    1. Put .xsession in the root directory ( / )
    2. Edit .xsession so that it won't go into powersave mode and turn off the screen
# disable DPMS (Screen blanking) 
xset -dpms
xset s noblank
xset s off
    1. Added line to .xsession to start the feh program.
      •  feh -R 2 -F /root/picture.jpg 
      • This will refresh (-R) displaying the picture.jpg file every 2 seconds, at Fullscreen (-F)

Cycling Through Pictures

  1. apt-get install cron
  2. create a script (SelectRandom.sh) that does the following
#!/bin/bash
cd /root/backgrounds
for i in 1 2 3 4 5
do
        cp $(find -name '*.jpg' | shuf | head -1) /root/picture.jpg
        sleep 9
done
  1. edit your cronjobs ( crontab -e )
  2. put in the following line to run the script every 9 seconds
* * * * * /root/pictureframescripts/SelectRandom.sh
    • We do this because the minimum amount of time you can run a cron job is 1 minute. So in the script, we speficy how often we want to replace the picture being displayed. Cron will then run that script once a minute.

(Optional) Using dockstar as a terminal

This project is meant to be a picture frame, which should be fairly hands off once running. But if you wanted to use the dockstar as a terminal, you would have to make the following modifications.

  1. Plug in a mouse and keyboard
  2. ssh into the box
  3. If not already installed, apt-get install fluxbox
  4. pkill the feh process
    • Since feh was likely the only process running, when you kill feh, the X server will also stop
  5. change /.xsession to run fluxbox or another lightweight windowing manager
  6. run the "startx" command to restart the X server

Future Plans

  • Add wireless. Brimstone mentioned he had success with Dlink DWA-125.
  • Pull Images from a samba share
  • Pull Images from a gmail account
  • Pull Images from a facebook album
  • Pull Images from flickrfs

At this point, on boot, feh should start cycling through pictures on the local memory

Resources

Physical

  • Old Dell LCD Screen
  • USB-to-VGA Adapter
  • Dockstar
  • 8Gb Thumb Drive
  • Hama brand wireless 802.11b usb stick

References

Tips from Makers

  • Pulling a random file (tip from brimstone )
    • find -name '*.jpg' | shuf | head -1
      • find will find all files of specified type in provided directory and all subdirectories
      • shuf will randomize whatever list is provided to it. in this instance, all the filenames found from the 'find' command
      • head will provide the number of entries at the top of the provided list. The '-1' specifies to provide just the first entry.
  • brimstone says a displaylink adapter is ideal
    • use lsmod to determine if SiS module is loaded when plugging in the adapter I have
  • ramgarden says to try this for adding to photostream dynamically:
    • http://spoon.cx/~larcher/2009/01/06/flickr-screensaver-for-linux/
    • Then you can email new photos to the flickr account for this photo frame using the special email address unique to each account.
    • Then run the podget every 5 - 10 minutes or so to get the latest pictures from the flickr account.
    • There might be a better way since podget will download every picture but OK if the file location is pointing somewhere with plenty of space.

Linux Concepts

  • The udlfb kernel module provides a frame buffer for things to be displayed via the hardware (USB-to-VGA adapter).
  • X / X11 is a windowing server, that sends output to the frame buffer.
  • gdm / xdm are login managers, which appear only briefly, and display their outputs to the windowing server (X / X11) before continuing on to start the windowing manager (fluxbox).
  • fluxbox is a windowing manager, allowing you to have multiple windows to output to the windowing server.