Tony Aldridge

Desktop self-care screen

A small e-paper display, showing the words "Always do your best. Your best will change from day to day". The text is superimposed over a 1-bit image of a night-time street.

Desktop self-care screen is a simple embedded Rust project that hooks up

  • A Rasperry Pi Pico 2 W
  • A Waveshare 2.13" ePaper Display Module
  • A connection to the selfcare.tech Mastodon feed

to produce a little desk toy that will show much-needed self-care tips.

Implementation details

This project is written using the Embassy framework, which is designed to make multitasking in Rust easy and pain-free.

The device connects to a provided WiFi network and then, once per hour, requests the latest message from the Mastodon feed. Armed with this chunk of wholesome text, one of a set of background images is chosen (cycled through during the lifetime of the program), and these are blended together and fed through to the display.

If a request fails, an appropriate error message is rendered to the screen.

While the program is running, a blinking LED allows us to quickly verify if the process has crashed.

The library used for rendering to the ePaper display is synchronous - so while the screen is being rendered, all other tasks running on the device are blocked. Being that the only other tasks that would be running are the one to blink the LED, and the one to request data from the feed, this is an acceptable drawback. At some point, time permitting, switching to a asynchronous version of the library would make this problem go away.

The drivers provided to talk to the WiFi chip do not appear to properly broadcast when the connection to the network is dropped. Code exists to alert when this would happen, but it is never called. Perhaps a later version of the firmware will correct this.

Currently, the handling of HTML is very basic. The feed infrequently posts messages with these in the content, but future work would involve stripping these out properly.

A small e-paper display, showing the words "Review your todo lists. Is there something you no longer need to do?". The text is superimposed over a 1-bit image of the top of a forest, at night, with a large crescent moon.