Alex Raskin

Pic Board

My fiancĂ©e and I are in a long distance relationship. We have a place together, but unfortunately, I can’t always be there. We’re constantly sending each other photos of little things throughout the day, and I thought it would be nice to have a way to share those moments outside of our phones.

Pic Board started there. I wanted a picture frame in our apartment that I could send photos to, wherever I happened to be. She wouldn’t have to open an app or check her phone. The photo would just be there the next time she glanced at the frame.

While working on it, I started thinking about how nice it would be if my parents, brother, and grandparents had one too, so we could all share little moments from our lives without keeping up with another group chat. Now I’m building them for the whole family.

Pic Board frame

I’m using the Seeed reTerminal E1002 for the frames. It has an e-paper display and a battery, which makes it a good fit for something I want to leave sitting on a desk or hanging on a wall. The display only needs power to change the image, so the device can spend most of its time asleep.

The display supports six colors: black, white, red, green, blue, and yellow. Refreshing it takes somewhere between 15 and 30 seconds. It’s obviously not going to look as good as a photo on your phone, but I really like how photos look on e-paper.

How it works#

I built a small web app where you can upload a photo from your phone and crop it to fit the display. The backend handles all the image processing so the frame doesn’t have to do it itself.

Photo uploading page from webapp

Since the display only supports six colors, I use Pillow and Floyd Steinberg dithering to convert the photos. Dithering keeps a lot more of the detail and shading than just snapping each pixel to the closest of the six colors.

Here’s what that looks like with a photo of my cat, Cosmo. On the left is the original, cropped to 800x480, and on the right is the exact bitmap the frame receives.

Original photo of Cosmo, a tabby cat, lying on a bed
Original
The same photo dithered to the display's six colors
Six-color dither

Each frame wakes up roughly once an hour to check for new photos. If there’s nothing new, it goes back to sleep. Each frame also has its own schedule, timezone, and quiet hours. Since my family lives in different places, I wanted everyone to be able to control when their frame updates.

Pressing the green button on the device wakes it up and moves to the next photo. I also store the last 20 photos locally so the frame is still usable if it loses its Wi-Fi connection.

Albums#

Each household gets its own private album, and there’s a shared family album that everyone can upload to. You can switch between albums from the web app, and each frame keeps track of its own position in the album.

I can manage the frames and the shared album, but I don’t have access to anyone’s private albums. Even though I’m the one running everything, I wanted everyone to have some privacy.

Why I went serverless#

I didn’t want to maintain a server for a couple of picture frames. I could have easily put the backend on a small VM, but I’d rather not have another machine to patch and monitor.

Instead, I built everything on AWS using serverless services. It’s probably overkill for a project this small, and it introduces more moving parts than a traditional backend would, but part of the reason I build personal projects is to learn things I don’t get to work with every day.

Most of my work as a DevOps engineer involves running containers on ECS and managing the infrastructure around services that use things like SNS, queues, and RabbitMQ. I spend a lot of time making sure other people’s applications run properly, but I don’t always get the opportunity to write the applications themselves.

With this project, I wanted to build an event driven application from start to finish. I got to spend more time working directly with API Gateway and learn Cognito, which we don’t use at work. It’s one thing to provision these services with Terraform and another to build an application that actually uses them.

I enjoy working with AWS, and having something my family will actually use gives me a good reason to keep learning.

Infrastructure#

Pic Board diagram

The backend is written in Python and runs on ARM64 Lambda functions behind an API Gateway HTTP API. I use DynamoDB in on-demand mode, private S3 buckets for storage, Cognito for authentication, and CloudFront to serve the web app.

Everything is managed with Terraform.

Setting up a frame#

Both of my frames run the same firmware, without any credentials specific to the household baked into it.

When you first turn on a frame, it creates its own Wi-Fi network. You connect to it from your phone, select your home network, and enter your Wi-Fi details. The frame then displays a short pairing code that you enter in the web app to link it to your account. After that, I don’t need to configure anything on the device.

Firmware updates#

The frames check for firmware updates whenever they wake up. They verify that an update comes from me before installing it, and if something goes wrong with the new firmware, they automatically roll back to the previous version.

Since these frames are going to be in different homes, I wanted to be able to update them remotely without asking someone in my family to plug one into a computer and flash it for me.

Final thoughts#

My favorite part of this project is being able to take a photo, upload it, and know that it’ll show up on the frames in our apartment and at my parents’ house the next time they check in.

The photos don’t always come out perfectly with only six colors, but there’s something nice about having them displayed on e-paper. It looks more like a printed photograph than another screen in the house.

I’m happy with how it turned out, and next I want to get more of them into my family’s homes.