Skip to content

ozh/cadrephoto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โœ‰โžœ๐Ÿ–ผ๏ธ Cadrephoto

An email-to-photo-frame for your Grandma, powered by Raspberry Pi and eink display

Cadrephoto (french for "photo frame") is a project that allows you to send photos on a digital photo frame via email : no app needed, no knowledge, perfect for users of all ages and who may not be tech-savvy.

image

๐Ÿ“‘ Table of Contents

๐Ÿ’ก Features

The principle is the following:

  • Raspberry Pi runs a Python script displaying photos on an eink screen
  • It checks at regular intervals for new emails on a given email account
  • When a new email with a photo arrives, the photo is displayed on the screen
  • Email sender and photo frame owner receive an email notification
  • Only the most recent photos are kept, making things ephemeral and an incentive to send newer pics ;)
  • Everything is fully configurable via a simple configuration file

The buttons on the frame are used to perform various actions:

  • โบ Button 1 (short press) โ†’ display next photo (when Grandma wants something new)
  • โบ Button 2 (long press) โ†’ delete current photo (if Grandma doesnโ€™t like it)
  • โบ Button 3 (long press) โ†’ debug screens with useful info (for curious Grandpa)
  • โบ Button 4 (long press) โ†’ clean shutdown of the Raspberry Pi (when Grandma relocates the frame)

๐Ÿ–ฅ๏ธ Hardware

  • A Pimoroni Inky Impressions eink display (I used the 7.3")
  • Any Raspberry Pi (built on a Raspberry Pi Zero 2 so any model should work)
  • Obviously all the required stuff to run a Raspberry Pi (power supply, SD card, etc.)
  • A case (I slightly hacked an Ikea 13 cm x 18 cm frame to house the screen ; there are also lots of 3D print templates available)

โš™๏ธ Installation

  1. You'll want to create a dedicated email account, on a server that supports IMAP and SMTP (most email providers should work) to receive the photos, since the script will delete all emails after processing them.
    (The wow factor with Grandma and her grand kids from having an email such as photoframe@your-domain.com is neat ;)

  2. Then, dependencies. You'll have to pip install the following Python packages:

  • inky (check this guide if you're new to this)
  • pillow
  • pillow-heif
  • lgpio and gpiod
  • python-dotenv
    (as always, all packages must be installed in the virtual environment -- I sticked to the one created by the Pimoroni Inky setup script)
  1. Clone this repository, copy the .env-example file to .env, and edit everything to match your setup.

  2. Test the script by running it : python -u main.py (in the appropriate virtual environment)
    If everything is set up correctly, you can setup the service, see below.
    If not, I included a few tests to help you troubleshoot things.

๐Ÿงฉ Setup the service

Once everything is working, you can setup the service, so the script runs automatically at Raspberry boot, and restarts if it crashes.

  1. Create a systemd service file
$ sudo nano /etc/systemd/system/cadrephoto.service
  1. Copy the following content into the file and modify it to match paths and user :
[Unit]
Description=Cadrephoto
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/home/ozh/.virtualenvs/pimoroni/bin/python /home/ozh/cadrephoto/app.py
WorkingDirectory=/home/ozh/cadrephoto
Restart=always
RestartSec=120
User=ozh
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
  1. Enable and start the service :
$ sudo systemctl daemon-reload
$ sudo systemctl enable cadrephoto.service
$ sudo systemctl start cadrephoto.service
  1. You can now :
# Check the status of the service:
$ sudo systemctl status cadrephoto.service

# Stop the service:
$ sudo systemctl stop cadrephoto.service

# View the logs in real-time:
$ journalctl -u cadrephoto.service -f
  1. I think it's a good idea to install log2ram to avoid writing constantly on the SD card, which is not good for its longevity.

๐Ÿ“ท Pictures

Photo frame full shot

20250818_183325

Button A displays next photo. Button B deletes current photo.

Debug screens

Long Press on Button C displays a debug screen with various info, then another screen with the application log

20250818_162448

Shutdown screen

20250818_172115

(Customisable message like everything in the project)

๐Ÿ“ Inspiration and License

This was my first Raspberry Pi project and first Python project ๐ŸŽ‰.

Special thanks to projects that inspired me:

Any crappy code is mine alone ๐Ÿ˜‰

Project licensed under the WTF Public License. WTFPL Feel free to do whatever the hell you want with it.

About

โœ‰โžœ๐Ÿ–ผ๏ธ Email to photo frame for Raspberry + eInk

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages