I used the Inky impression eInk display to automatically show pictures I send it via email! Made with a Pi Zero W, a Pimoroni inky impression and an IKEA RIBBA picture frame (10x15cm) which fits (almost 😅) perfectly! A cron job checks for new Mail every 5 minutes, automatically resizes the attached image to fit the eInk display’s resolution and displays it. You can also select the picture from your smartphone.
Nice work. I built a frame and used your code as a very good starting point. I am currently working on adding email security to protect from displaying images from rogue image posters and a secure photo admin management web gui. I have cron checking email for new photos every 5 minutes. I also have a script that scans the photo_store directory, randomizes the list of photos, and presents a new photo every 10 minutes. If a new photo is detected the new photo is presented and the presentation script restarts with a new randomizes list to display.
I am running the frame from a 2700ma 2s battery. I really like how well this project is coming along
So far the frame has been up for 3 days… 75% left.
I am going to see if there are enough GPIO pins available to add a Sleepy PI or equiv
to stretch battery life out.
I’ll send an archive out to you as soon as I get a chance to clean it up. after all you started this project. If I add a sleepy pi and the pi ups board I will make a 3d printed back shell for the photoframe because I can’t fit it.
Your code gave me a quick head start on my eink frame project. I attached a tar with everything. The file directory structure is slightly different. All credential files and and the mailid.txt file is in /home/pi/python_files/photo_store. I included my bash script that will randomly display all the files in the directory and start with another randomized list of files when done. getmail.py now references a file called email_allowed.txt for user accounts that are allowed to post to the frame.
I still have work to do. Next step I plan on encrypting passwords.
I am not sure what I am going to use for a webgui. It needs to be lightweight and works well on a smartphone. I am still research it. Once done I will make a debian package that just drops everything in place.
I am still testing battery life. Maybe if I throttle down the CPU after displaying an image and throttling it back up when receiving and processing an image will help. I’d probably need to throttle up the CPU when Apache is active too.
Hopefully Pimoroni will have a larger 7 color eink screen available soon.
I’ve came up with some new ideas for the Photo Frame Management GUI.
It will be able to mange the eink email account cresdentials, display saturation level, photo display time, time interval for fetching new photos by email, upload and download photos, cpu max low frequency. I want to add username and password encryption next. The photo frame email account and password will all be encrypted in a hash. When I get it to the point where encryption is added I’ll create a debian installer package. I moved the cron job to system cron in /etc/cron.d since it’s easy to deliver with the debian package.
The photo frames I used are here:
When installing don’t use the glass plate.
After I get the debian package delivery built I’ll design a back panel for the frame.
I’d like to use the rpi UPS board to power this frame. I’m still looking for one that has
an RTC and is arduino based. It might be the Witty Pi 3 or Sleepy Pi. The best solution might be a RPI UPS board with arduino, RTC, and usb connectivity … not sure yet. I started a battery test with a full charge. Will the getmail.py running every 5 minutes and photos updating once per minute battery usage has been higher.
24hrs and 25% power used so far. If I throttle down the cpu to a lower frequency than what I am using right now when idle I might get more time. Also maybe check for new photos by email once every 15 minutes and present each photo for 10 minutes.
I figured what I am testing now is worse case.
I have another display coming in. Chicago Electronic Supply had them… so I am building another photo frame.
hey jerrynsr, your project is really helpfull for me, you did a great job. Have you finished your program and your research about battery life ?
Thanks !
Yes I did. It adds cost to the frame but it works well! I use the Witty Pi.
A good source for it is here:
It works well. I tried solutions without it by putting the wifi interface in sleep mode and throttling down the cpu… and waking and throttling up on a regular interval set in a configuration file, check for new emailed photos, display the next photo and throttle down again, but I didn’t really see the power savings that I wanted. I wanted to stretch the battery life to one month. The Witty Pi will get it done. It’s got an onboard rtc, it will power up the picture frame at a set interval. At the moment I have the witty pi power up the frame at 5am, after the frame checks for photos and displays a new photo, the frame will shutdown until 5am the following day.
That’s really cool, so now how long do the battery last since your upgrade ?
And would it be possible for you to share the updated version of your code ?
Oh and another question. You are still using the same 2700 ma battery ?
Thanks for the answer !
Same battery, I ran the frame for 4 weeks, battery was still at 75%. I needed the battery to power a camera when I was out at my r/c clubs airfield.
I bought a218650 batteries and holder, I just haven’t had time to switch it over.
Code is all on the witty pi. Just configure the scheduler to power up the pi and shut it down in 3 minutes. It’s easy, just use uugear installer. This winter I will update the code to use more of the witty pi features.
You want the witty pi 3 mini version. Not the full size one featured in the link
Wow it’s pretty good in my opinion. I was talking about the code for the raspberry pi ton control the screen. Have you editted it since January or it is just the same as this one here : pimironi-einkframe.tar.gz - Google Drive
You already share before.
Hello again, at the same time for your battery what kind of Converter do you use ? I guess it is not giving you a direct 5v.
Thanks by advance ! I hope you will answer past message too !
I am still powering the frames with the large usb battery that I listed. I modified the update_photofrme script to shutdown after 10 minutes. I hit the powerb button on the battery pack to update the photos. This winter I planned on designing a cheap circuit that will turn control a power reset after time had elapsed with no voltage detected. Basically it goes in line with the photoframe and battery. I decided to do this when the cost of the smartypi increased to even more than the pi zero w. Its peak r/c flying season for me right now. I won’t work on this until late November.
Hi @fabian_pe interested in your automatic resizing. I’m a bit of a python novice - would you help me understand how you use imageargument and newimage in line 25 of anyimage.py please?
I current have:
# Randomly select an image
selected_image = random.choice(image_files)
image_path = os.path.join(image_directory, selected_image)
# Load the image
img = Image.open(image_path)
# Resize the image to fit the display (if necessary)
img = img.resize(inky.resolution)
# Convert the image to the appropriate mode
img = img.convert("RGB")
# Display the image
inky.set_image(img)
inky.show()
but the resizing is stretching some images (say, portrait images) weirdly.
Hmm it’s been a long time since I wrote the code, I’d suggest trying all the parameters I used in line 25 — especially the -extent one, it sets the background to a color (white in my example) and it might be responsible for not stretching the image: ImageMagick – Command-line Options
So when I post a square photo for example, there’s white space at the sides.
It might also have something to do with ‘-gravity center’
Hey, you have to call the script by giving it the image file name as an argument. So for example in the directory where anyimage.py is located you can type this in the terminal:
./anyimage.py test.jpg
Then test.jpg is being displayed
Ah see in my python script I’m selecting a random photo from a directory (and using a cron job to change every ten minutes).
If I read from the bottom up of your script (Python novice, so bear with…) I can see you display image at line 32 inky.set_image(image, saturation=saturation) image seems to be defined from newimage at line 27… newimage seems to be defined at line 23, like you say, from the argument passed when you call the script.
My confusion/question is around line 25 where you do the image conversion - you mention both newimage and imageargument.
With my python script where I’ve already selected one image at random from a directory, it is defined as img and I’m wondering if I could use your line 25 in my script to adjust my img…
# Randomly select an image
selected_image = random.choice(image_files)
image_path = os.path.join(image_directory, selected_image)
# Load the image
img = Image.open(image_path)