Kindle Display

Aus FHEMWiki

NOTE: This Article is not yet finished! This note will be removed once i think it's okay ;)
As long as I'm working on it, this information will be shown.


This article shows how to configure a Amazon Kindle eBook-Reader as a information display for fhem. Use this manual at your own risk. Jailbreaking a Kindle is quite easy but there is no guarantee for breaking the system.
I will show how to configure it with the FileReplacer.pm from Stefan. The "old" method with the special function in MyUtils is not part of this article.

All of the information shown below is collected from the fhem-forum fhem-Forum. Many thanks to everybody who participated on the development of this information to get it done.Special thanks to "alex" and "stefan" from the board. Further information is from the mobileread board.

Hardware requirements

Kindle Touch / Paperwhite / Paperwhite 2

You can use Kindle Touch / Paperwhite / Paperwhite 2 without any limitations.

Kindle 4

For setting this up on the Kindle 4 (with the 5-way button) you need some more configuration work but it's also working. Addidional tasks for this version are shown down below.

Prerequisites

fhem and server configuration

Server configuration

Not sure if still needed, but just for in case it is, install imagemagick on your linux system.

apt-get install imagemagick

That's it :)

fhem configuration

First you need a svg-template. You can find one in the first posting on the fhem-Forum thread. In the template just replace the data with some placeholder you like. Later this placeholder is found via a regular expression and replaced by your data.
For example, you can set XYZ at the place where the first temperature should be shown and ABC for the first humidity value.
If you want to edit the template you can use the free software [www.inkscape.org/de/ Inkscape]. For more information about generating SVGs for fhem please refer to this article Icons. Most important information is to save the SVG as a "normal SVG" and not as an inkscape SVG.
For the Kindle Paperwhite the resolution of the SVG must be 758 x 1024 for the Kindle 4 version use 600x800. This is mandatory. Wrong scaled images won't be displayed on the Kindle.
Copy the Kindle_Template.svg to /opt/fhem/www/images/.

Download and install the FileReplacer.pm from fhem Forums, save it to /opt/fhem/FHEM and load the module. You can also restart fhem instead.

All we're doing now is to using the FileReplacer module to read the SVG template, replace a search pattern with our data and saving it.

define kindledisplay FileReplacer /opt/fhem/www/images/template1.svg /opt/fhem/www/images/status1.svg 60
attr kindledisplay DoPNG 1
attr kindledisplay UTF8-Encode 1
attr kindledisplay room Display

DoPNG enabled the generation from SVG to PNG. UTF8-Encode is needed to support special characters.
Now just create your mappings:

attr kindledisplay Regex1 XYZ
attr kindledisplay Expr1 sprintf("%.1f", ReadingsVal("Sensor1", "Temp1", 0))
attr kindledisplay Regex2 ABC
attr kindledisplay Expr2 sprintf("%.1f", ReadingsVal("Sensor1", "Hum1", 0))

And so on... :) The FileReplacer will replace the pattern XYZ with the ReadingsVal from Sensor1.
Now check if the PNG is created http://your-fhem-ip:8083/fhem/www/images/KindleDisplay.png. If so, be happy, the first part is done!

Modifying the Kindle

To prevent from error messages like "your Kindle is no longer registered as a test Kindle..." please make sure your Kindle is connected to a valid Amazon Account.
We need to download some software to install it on the Kindle.
Please download it from Mobileread Forums


Always use the newest version and look for one who fits to your Kindle (e.G. K4).

Jailbreaking the Kindle

Don't worry. This sounds more hard and dangerous than it is in fact. It's just a few steps to have full access to your Kindle.

Kindle Touch/Paperwhite

  • Download the kindle-jailbreak-0.12.N.zip file, and unpack it. In there, you'll find some .bin files, and a src directory.Leave the directory alone, and upload the correct Update_*_install.bin file for your kindle & FW version to the root directory of your Kindle.


  • Now, eject & unplug your Kindle, and go to [HOME] -> [MENU] > Settings -> [MENU] > Update Your Kindle. It should be quick.
    (And, on FW 2.x only, it should FAIL (With a U006 error, in the bottom left corner of the screen). It's completely normal, intended, and harmless).


And that's it, your Kindle is now ready to install custom hacks!
(Quoted from http://www.mobileread.com/forums/showthread.php?t=88004)

Kindle 4 / Universal method

  • Download and unzip the jailbreak.
  • Plug in the Kindle and copy the data.tar.gz & ENABLE_DIAGS files plus the diagnostic_logs folder to the Kindle's USB drive's root
  • Safely remove the USB cable and restart the Kindle (Menu -> Settings -> Menu -> Restart)
  • Once the device restarts into diagnostics mode, select "D) Exit, Reboot or Disable Diags" (using the 5-way keypad)
  • Select "R) Reboot System" and "Q) To continue" (following on-screen instructions, when it tells you to use 'FW Left' to select an option, it means left on the 5-way keypad)
  • Wait about 20 seconds: you should see the Jailbreak screen for a while, and the device should then restart normally
  • After the Kindle restarts, you should see a new book titled "You are Jailbroken", if you see this, the jailbreak has been successful.

Installing additional software

MKK

The Mobileread Kindlet Kit (MKK) is used to execute custom Kindlets (programs) on the Kindle.

KUAL

The Kindle Unified Application Launcher (KUAL) running applications on the Kindle.

Backdoorlock

This is used to prevent from getting automated updates which could remove the JailBreak.

ScreenSavers Hack

The ScreenSavers Hack let you show custom screen savers on the kindle.

Online ScreeSaver

This application copies the fhem-PNG from your fhem-server to the ScreenSavers hack.

Kindle 4 additional tasks

coming soon :)