Now Reading
Constructing an e-ink image body that shows an iCloud picture album

Constructing an e-ink image body that shows an iCloud picture album

2024-01-09 10:45:58

For Christmas, I gave my dad and mom this e-ink image body (constructed from an previous e-reader) that cycles by way of images from a shared iCloud picture album:

It is a re-worked model of a present that I gave to my girlfriend in October, besides that one was in a smaller body that fell aside fairly shortly:

I rebuilt hers to be extra strong, and constructed one for my dad and mom on the identical time. Here is how I did it:

The e-reader

For this undertaking I went with a Nook Easy Contact Reader. Yow will discover them on eBay or Fb Market for $10-$30 used.

The explanation to go together with a Nook as a substitute of a Kindle or one other e-reader is that Nooks run Android underneath the hood. Meaning they’re far simpler to root and to run Android apps on.

For that half, I adopted this wonderful post by Terence Eden. The method was fairly easy; the one factor to notice is that you will want a microSD card.

After you get it operating Android, because the publish describes, you’ll be able to run an historical Android app referred to as Electrical Signal. This app permits you to put any web site on the Nook’s display and have it refresh at a given interval, with a catch: the Nook would not help SSL. Subsequently I needed to arrange an internet site that makes use of http:// as a substitute of https://, which is remarkably tough these days. (I needed to arrange a customized Nginx server, as a result of you’ll be able to’t use one thing like Vercel.)

However as soon as that half was executed, I simply needed to put the web site URL into the Electrical Signal app on the Nook and I used to be all set!

The body

I purchased this pack of 8×10 frames off Amazon, however basically what I used to be searching for was a body that was massive however may maintain a 5×7 image with a matte. That is as a result of the Nook’s show was roughly 5×7, however I wanted an enormous body (8×10) to carry the perimeters and charging cable popping out the underside.

I merely jammed the Nook into the body and compelled the latches on the again shut, with the cable protruding the underside. It surprisingly matches the Nook, albeit with some bulging within the again.

In the event you look carefully, the black bezels on the prime and backside of the Nook would present by way of the 5×7 gap, so I added some white card inventory to have them mix in a bit higher.

iCloud picture album

I needed to supply the pictures from a shared iCloud picture album. That manner, I may share the album with my dad and mom, and so they may add new images that might present up on the body proper from their Images app.

See Also

iCloud picture albums don’t have any API. Nonetheless, should you share an iCloud picture album to a public hyperlink, you should use the Developer Instruments to examine the API requests Apple is making to get the images. In the event you replicate these requests, you can also load the images from the shared iCloud album (so long as the album stays publicly shared).

Here is my Laravel code that I used, for reference:

$webstream = Http::publish('https://p01-sharedstreams.icloud.com/12345678/sharedstreams/webstream', [
    'streamCtag' => null
]);

$photoGuids = accumulate($webstream->json()['photos'])->pluck('photoGuid');

// I needed the very best high quality variations, so these are the checksums I collected for later. 
$checksums = accumulate($webstream->json()['photos'])->map(operate ($picture) {
    $maxFileSize = 0;
    $maxFileSizeChecksum = null;

    foreach ($picture['derivatives'] as $by-product) {
        if ($by-product['fileSize'] > $maxFileSize) {
            $maxFileSize = $by-product['fileSize'];
            $maxFileSizeChecksum = $by-product['checksum'];
        }
    }

    return $maxFileSizeChecksum;
});

$property = Http::publish('https://p01-sharedstreams.icloud.com/12345678/sharedstreams/webasseturls', [
    'photoGuids' => $photoGuids,
]);

$urls = accumulate($property->json()['items'])
    ->filter(operate ($merchandise, $key) use ($checksums) {
        return $checksums->accommodates($key);
    })
    ->map(operate ($merchandise) {
        return 'https://' . $merchandise['url_location'] . $merchandise['url_path'];
    })
    ->values();

$url = $urls->random(); // Decide a random picture from the album. 

From this, I simply inserted the picture right into a quite simple HTML web page, utilizing the wsrv.nl API to crop the picture to the precise dimensions of the Nook (600×800 pixels):

<img src="{{ route('picture', ['url' => "https://wsrv.nl/?url={$encodedUrl}&w=600&h=800&fit=cover&mod=1.2"], false) }}" />

I did brighten the pictures a little bit (utilizing mod=1.2) in order that they’d look higher on the e-ink display, and likewise you will discover that I am going by way of an picture route — that is a route that proxies Apple’s photographs as a result of these photographs would usually use https and I want them going by way of my http-only server so the Nook can load the picture.

Placing all of it collectively

I mounted the Nook within the body, set the web site with the picture from the shared album, and closed all of it up with a charging cable so it could possibly keep plugged in on a regular basis. It has been working superbly to this point!

Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top