close () if _name_ = '_main_' : main () Downloading extra photos from Flickr by tag name get ( url ) image_file = open ( path, 'w' ) image_file. _dict_ ) path = '/home/pi/photoframe/flickr/%s' % filename try : image_file = open ( path ) print " -> Already have %s" % url except IOError : print " -> Downloading %s" % url r = requests. walk ( user_id = USER_ID ) for photo in photos : url, filename = make_url ( photo. FlickrAPI ( FLICKR_KEY ) photos = flickr. Photo = "%(id)s_%(secret)s_z.jpg" % photo url = ( " % photo ) return url, photo def main (): print " -> Requesting photos." flickr = flickrapi. Import flickrapi import requests FLICKR_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" USER_ID = def make_url ( photo ): # url_template = " # _.jpg" Once those are installed, save this script as download_flickr.py #!/usr/bin/env python There are two Python library dependencies for this code: pip install flickrapi That way you can get a Flickr API key that you can then use to walk the photos from your account. You’ll need to register your Flickr API app, which is a quick process. Disabled sleep, so your photo frame doesn’t shut off when you don’t want it to.Auto-wifi, so you can download images automatically whenever your Raspberry Pi is turned on.Auto-login, so your Raspberry Pi doesn’t sit at a login prompt.You’ll want to make sure you’re setup with the following: I used double-sided mounting tape as an adhesive, although the wires are being held up by the frame itself. You just need something that can hold a Raspberry Pi and monitor taped to it. You effectively just need an enclosure, but I found that picture frames offer the greatest aesthetics-to-enclosure ratio. There are a number of different sized LCD monitors:ĤGB SD Card with Raspbian (Raspberry Pi + Debian) Note that if you do not plan to solder the composite cable’s two wires, you will need the ugly male-to-male adapter, sold for $1.50 on Adafruit. This would jut out about 2 inches below the device, resulting in a messy look for the frame. If I had connected the monitor using the yellow composite cable, it would have to be with a male-to-male composite adapter, since both the Raspberry Pi and the monitor have a male RCA connection. In the below photo, where the Raspberry Pi is flipped vertically to show off the electrical connections, the monitor’s composite cable and the motion detecting PIR sensor’s red wires are soldered underneath. Make note of the fact that you actually don’t see any of my connections on the top of the board (pictured below). I didn’t want to have to load photos on to an SD card which could then be read by an Arduino.Ĭonnecting the monitor was also trivial on a Raspberry Pi, where an Arduino, Maple, or Beagle Bone would require sourcing a connection between the monitor’s composite input and an output from the device. I chose to use a Raspberry Pi for its simple wifi integration so that photos could be automatically updated. You can also use the eLinux guide to Raspberry Pi and its handy RPi Hardware Basic Setup wiki. The hard part for me was figuring out how to turn the monitor on and off through the command line.Įverything else is gravy, from configuring wifi and autoboot/auto-login on the device to attaching and setting up the motion detecting PIR sensor. Mainly, you should feel comfortable soldering wires and mounting the screen and Raspberry Pi to a board or other object. This photo frame is easy to build, but it does take a bit of know-how. Secondly, there is a motion detector, built using a PIR sensor, which only turns the monitor on when somebody walks by. It then displays a random photo for a configurable six seconds. For one, the software which runs the photo frame, which I explore below, keeps the photos fresh from Instagram and Flickr. My girlfriend bought me a Raspberry Pi for my birthday, and so I became determined to build something with it for her birthday two months later.Īs you can see above, I built a photo frame that has a few interesting parts. Building a living photo frame with a Raspberry Pi and a motion detector JanuaryĮvery hardware hacker has a start, and this one is mine.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |