E-paper desk calendar on Kindle

2024-02-29
2023-07-20

I tried to create the desk calendar with the unused Kindle. It can show my schedule from Google Calendar and weather data.

kindle-calendar-2.jpg

Device & Spec

  • Kindle 8th generation (Kindle Touch 3)
  • Firmware version: 5.14.2 (already jailbreak)
TitleSpec
Size6 inch
Resolution600x800 dots
Pixels per inch167
Gley scale16

Installed packages for Kindle are the below:

  • MRPI
  • KUAL
  • KUAL Helper
  • Kterm
  • USBNetwork

Enable SSH

After installing USBNetwork, enable Toggle USBNetwork. If you would like to connect via Wi-Fi, you should first connect via USB and place the config file.

Configuration of macOS

Set the IP address in Settings > Network > RNDIS/Ethernet Gadget of your Mac.

IP address: 192.168.15.201

After completing these settings, you can connect via USB using SSH without a password.

terminal

$ ssh root@192.168.15.244

SSH with identityfile

Enable public key SSH connection.

terminal

$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.15.244

Connect with SSH over Wi-Fi

Enable KUAL > USBNetwork > Allow SSH over WiFi. Then check the IP address in a local network.

The network information is displayed when entering ;711 in the search window. If the information is not displayed, you can also check the address using the following command:

terminal

$ ifconfig | grep inet

You can connect to Kindle via Wi-Fi using IP address.

terminal

$ ssh -i ~/.ssh/id_rsa root@<Kindle's IP>

E-paper produced by E Ink is implemented on Kindle, and this can be controlled by eips.

The following command displays the image.

terminal

$ eips -g|-b image_path [-w waveform -f -x xpos -y ypos -v]

The option is below:

  • -g for png|jpg, -b for bitmap
  • -w waveform can be gc16 gl16 or du, default is gc16
  • -f for full update, default is partial update
  • -x in units of pixels (does not work on K4)
  • -y in units of pixels (does not work on K4)
  • -v for inverted picture (does not work on K4)

Reference: MobileRead Wiki - Eips

Generate the calendar image

Generate the calendar image for display on Kindle. See this article for details.

https://blog.mktia.com/e-calendar

Note that bmp image won't displayed correctly so you should use jpg.

Automate image generation, transfer and display

Based on the above, the flow from image generation to display is as follows.

  1. Generate images with Python
  2. Transfer images to Kindle via scp (or rsync)
  3. Execute the command to display the image on Kindle via SSH

terminal

$ poetry run python kt3w.py
$ scp -i ~/.ssh/id_rsa path/to/image.jpg root@<Kindle's IP>:/mnt/us
$ ssh -i ~/.ssh/id_rsa root@<Kindle's IP> '/usr/sbin/eips -f -g /mnt/us/image.jpg'

To run the above commands automatically, put them in a script file and run cron. It is available running commands with crontab in Mac.

https://blog.mktia.com/crontab-on-macos

It is necessary to declare PATH at the top of the script because it runs as a system job.

Add an interface

Since only the updated part of the image displayed on the screen is overwritten, the calendar display will be broken if it is accidentally touched. Therefore, the last image received is stored and can be displayed manually.

kindle

# mkdir /mnt/us/extensions/custom

Prepare the require files in the created directory.

config.xml

<?xml version="1.0" encoding="UTF-8"?>
<extension>
  <information>
    <name>Custom commands</name>
    <version>1.0</version>
    <author>mktia</author>
    <id>customcommands</id>
  </information>
  <menus>
    <menu type="json" dynamic="true">menu.json</menu>
  </menus>
</extension>

menu.json

{
  "items": [
    {
      "name": "show",
      "priority": -998,
      "items": [
        {
          "name": "Show Calendar",
          "action": "./show.sh",
          "priority": -997,
          "exitmenu": true,
          "refresh": true
        }
      ]
    }
  ]
}

show.sh

#!/bin/sh
sleep 3;eips -f -g /mnt/us/image_600x800.jpg

Since the screen is refreshed after a menu operation, there is a delay before the drawing with eips starts.

My impressions

The 16-level display is nice with anti-aliasing. However, the colors are a little pale.

kindle-calendar-1.jpg

The previous one I built was too big to put on a desk, but the Kindle is just the right size. Since it is not controlled by Raspi, it does not need a constant power supply and can be placed anywhere.

kindle-calendar-2.jpg

The e-paper only consumes power when switching images. However, the screen saver is disabled because SSH isn't connected when the Kindle goes to sleep, so the power consumption may be high.

The interface (time, battery level, etc.) can be disabled, but it is easier to know when to recharge the battery if it is displayed, so it is left enabled.

(P.S. 2024.1.12)

I found that if I left it on all the time, the battery would run out in a little over a day. Now, a portable battery connects to Kindle. As it would be difficult to move the device if the cable remained connected, I decided to use it with a mobile battery of the right size that I happened to have with me.

kindle-calendar-3.jpg

Reference