Kindle Display: Unterschied zwischen den Versionen

Aus FHEMWiki
(→‎fhem configuration: Hinweis auf das LastUpdate Reading hinzugefügt)
(updated man things)
 
(10 dazwischenliegende Versionen von 4 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
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.<br>
This article shows how to configure an Amazon Kindle eBook-Reader as a information display for Fhem.
Since such eBook-Readers use eInk displays which keep their display even when the device is completely switched off,
this offers a nice method to visualize Fhem devices and readings on a battery powered device which is mainly in deep sleep mode and
only powers up to fetch new data from Fhem and update the display e.g. every 10 minutes.
 
Use this manual at your own risk. Jailbreaking a Kindle is quite easy but there is no guarantee for breaking the system.<br>
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.
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.


'''NOTE: This Article is not yet finished! This note will be removed once i think it's okay ;)<br>
All of the information shown below is collected from the Fhem-forum {{Link2Forum|Topic=21821|LinkText=fhem-Forum}}.  
As long as I'm working on it, this information will be shown.'''
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 [http://www.mobileread.com mobileread board].
All of the information shown below is collected from the fhem-forum [http://forum.fhem.de/index.php/topic,21821.0.html 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 [http://www.mobileread.com mobileread board].


=Hardware requirements=
=Hardware requirements=
==Kindle Touch / Paperwhite / Paperwhite 2==
==Kindle Touch / Paperwhite / Paperwhite 2==
You can use Kindle Touch / Paperwhite / Paperwhite 2 without any limitations.  
You can use Kindle Touch / Paperwhite / Paperwhite 2 without any limitations.  
==Kindle 4==
==Kindle 4 or Kindle 5==
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.
For setting this up on the Kindle 4 (graphite color and with the 5-way button) or Kindle 5 (black and with the 5-way button) you need some more configuration but it's also working. Addidional tasks for this version are shown down below.


=Prerequisites=
=Prerequisites=
==fhem and server configuration==
==fhem and server configuration==
===Server configuration===
===Server configuration===
Not sure if still needed, but just for in case it is, install imagemagick on your linux system.<br>
The Fhem side that provides the image to display an a Kindle device typically creates this image by replacing placeholders in an SVG-file and the converting the result into a suitable PNG-file. For this conversion you need imagemagick or some other command line utility to convert SVG into PNG in the right format.
:<code>apt-get install imagemagick</code>
:<code>apt-get install imagemagick</code>
That's it :)
===fhem configuration===
===fhem configuration===
First you need a svg-template. You can find one in the first posting on the [http://forum.fhem.de/index.php/topic,21821.0.html 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.<br>
First you need an SVG-template. You can draw one e.g. with inkscape or you can find one in the first posting on the {{Link2Forum|Topic=21821|LinkText=fhem-Forum}} thread.  
For example, you can set XYZ at the place where the first temperature should be shown and ABC for the first humidity value.<br>
In the template just replace the data with some placeholder you like. Later this placeholder is found via a regular expression and replaced with your data.
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 [http://www.fhemwiki.de/wiki/Icons Icons]. Most important information is to save the SVG as a "normal SVG" and not as an inkscape SVG.<br>
For example, you can set XYZ at the place where the first temperature should be shown and ABC for the first humidity value.
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.<br> Copy the Kindle_Template.svg to <nowiki>/opt/fhem/www/images/</nowiki>.<br><br>
If you want to edit the template you can use the free software [www.inkscape.org/de/ Inkscape] for example.  
Download and install the [http://forum.fhem.de/index.php/topic,21821.msg200310.html#msg200310 FileReplacer.pm from fhem Forums], save it to /opt/fhem/FHEM and load the module. You can also restart fhem instead.<br><br>
For more information about generating SVGs for Fhem please refer to this article [[Icons]].  
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.<br>
The most important information is to save the SVG as a "normal SVG" and not as an inkscape SVG.
:<code>define kindledisplay FileReplacer /opt/fhem/www/images/template1.svg /opt/fhem/www/images/status1.svg 60</code>
For the Kindle Paperwhite the resolution of the SVG must be 758 x 1024 for the Kindle 4 and 5 version use 600x800. This is mandatory.  
:<code>attr kindledisplay DoPNG 1</code>
Wrong scaled images won't be displayed on the Kindle.<br>  
:<code>attr kindledisplay UTF8-Encode 1</code>
Copy the Kindle_Template.svg to <nowiki>/opt/fhem/www/images/</nowiki>.
 
All we're doing now is using the FReplacer module which is part of Fhem to read the SVG template, replace a search pattern with our data and save it.
 
:<code>define kindledisplay FReplacer /opt/fhem/www/images/template1.svg /opt/fhem/www/images/status1.svg 60</code>
:<code>attr kindledisplay PostCommand convert /opt/fhem/www/images/status.svg -type GrayScale -depth 8 /opt/fhem/www/images/status.png 2>/dev/null & </code>
:<code>attr kindledisplay ReplacementEncode UTF-8</code>
:<code>attr kindledisplay room Display</code>
:<code>attr kindledisplay room Display</code>


DoPNG enabled the generation from SVG to PNG. UTF8-Encode is needed to support special characters.<br>
PostCommand defines that the external command will be issued after the replacement to convert the resulting SVG to a PNG in 8 bit GreyScale mode.  
UTF8-Encode might be needed to support special characters.
 
 
Now just create your mappings:
Now just create your mappings:
:<code>attr kindledisplay Regex1 XYZ </code>
:<code>attr kindledisplay Rep01Regex XYZ </code>
:<code>attr kindledisplay Expr1 sprintf("%.1f", ReadingsVal("Sensor1", "Temp1", 0)) </code>
:<code>attr kindledisplay Rep01Reading Sensor1:Temp1</code>
:<code>attr kindledisplay Regex2 ABC </code>
:<code>attr kindledisplay Rep01Format %.1f </code>
:<code>attr kindledisplay Expr2 sprintf("%.1f", ReadingsVal("Sensor1", "Hum1", 0)) </code>
:<code>attr kindledisplay Rep02Regex ABC </code>
And so on... :) The FileReplacer will replace the pattern XYZ with the ReadingsVal from Sensor1.<br>
:<code>attr kindledisplay Rep02Reading Sensor1:Hum1</code>
Now check if the PNG is created [http://your-fhem-ip:8083/fhem/www/images/status1.png http://your-fhem-ip:8083/fhem/www/images/KindleDisplay.png]. If so, be happy, the first part is done!<br>
:<code>attr kindledisplay Rep01Format %.1f </code>
If you want to change readingVals to something in your language you can try using it like this:
And so on... :) The FReplacer module will replace the pattern XYZ with the ReadingsVal from Sensor1.
:<code>attr kindledisplay Expr11 (ReadingsVal("XY", "Reading", "off") eq "on" ? "An" : "Aus")</code>
 
More and up to date details about the configuration of the FReplacer module can be found in the Fhem command reference [https://fhem.de/commandref.html#FReplacer]
 
Now check if the PNG is created [http://your-fhem-ip:8083/fhem/www/images/status1.png http://your-fhem-ip:8083/fhem/www/images/KindleDisplay.png]. If so, be happy, the first part is done!
 
If you want to use more complex Perl expressions to compute the replacement string, you can use the RepExpr attribute instead of RepReading and do someting like this:
:<code>attr kindledisplay Rep11Expr (ReadingsVal("XY", "Reading", "off") eq "on" ? "An" : "Aus")</code>


If you want to add a "last modified" timestamp to the dispaly, create a placeholder for it in your SVG template (like "last modified lmtime123") and then define a Regex / Expr attribute pair to replace it with the Reading "LastUpdate" from your FileReplacer device:
If you want to add a "last modified" timestamp to the dispaly, create a placeholder for it in your SVG template (like "last modified lmtime123") and then define a Regex / Reading attribute pair to replace it with the Reading "LastUpdate" from your FReplacer device:
:<code>attr kindledisplay Regex14 lmtime123</code>
:<code>attr kindledisplay Rep14Regex lmtime123</code>
:<code>attr fr Expr14 ReadingsVal("kindledispay", "LastUpdate", "never")</code>
:<code>attr kindledisplay Rep14Reading kindledisplay:LastUpdate:never</code>


=== Templates ===
=== Templates ===
Zeile 59: Zeile 77:
* OnlineScreenSaver [http://www.mobileread.com/forums/showthread.php?t=236104 Mobileread Forums]
* OnlineScreenSaver [http://www.mobileread.com/forums/showthread.php?t=236104 Mobileread Forums]


* for Kindle 4 only: USBNETWORK [http://www.mobileread.com/forums/showthread.php?t=88004 also Mobileread Forums]
* for Kindle 4 or 5 only: USBNETWORK [http://www.mobileread.com/forums/showthread.php?t=88004 also Mobileread Forums]
<br> Always use the newest version and look for one who fits to your Kindle (e.G. K4).
<br> Always use the newest version and look for one who fits to your Kindle (e.G. K4 or K5).


==Jailbreaking the Kindle==
==Jailbreaking the Kindle==
Zeile 72: Zeile 90:
(Quoted from http://www.mobileread.com/forums/showthread.php?t=88004)
(Quoted from http://www.mobileread.com/forums/showthread.php?t=88004)


=== Kindle 4 / Universal method ===
=== Kindle 4 or 5 / Universal method ===


* Download and unzip the jailbreak.  
* Download and unzip the jailbreak.  
Zeile 96: Zeile 114:
Unzip the folder and copy the matching .azw2 file to the documents directory of your kindle.<br>
Unzip the folder and copy the matching .azw2 file to the documents directory of your kindle.<br>
<br>
<br>
(K2, DX, K3, K4)<br>
(K2, DX, K3, K4, K5)<br>
Put KUAL-KDK-1.0.azw2 in documents folder.<br>
Put KUAL-KDK-1.0.azw2 in documents folder.<br>
Run it by clicking new kindlet (book) document in your list.<br>
Run it by clicking new kindlet (book) document in your list.<br>
Zeile 117: Zeile 135:
After the installation you will find a directory called "linkss" in the Kindle root. Here open the screensavers dir and delete all images.
After the installation you will find a directory called "linkss" in the Kindle root. Here open the screensavers dir and delete all images.


=== Online ScreeSaver ===
=== Online ScreenSaver ===
This application copies the fhem-PNG from your fhem-server to the ScreenSavers hack.
This application copies the PNG image file created on the Fhem side to the ScreenSavers hack so it is displayed when the Kindle start sleeping.
Just download the application from [http://www.mobileread.com/forums/showthread.php?t=236104 here], extract the file and copy the folder into the extensions directory. <br>
Just take the modified version for Kindle 4 and 5 from [https://forum.fhem.de/index.php/topic,21821.585.html] or download the original application for later Kindles from  
[http://www.mobileread.com/forums/showthread.php?t=236104 here], extract the file and copy the folder into the extensions directory.
Now you have to edit the config.sh file up to your need.<br>
Now you have to edit the config.sh file up to your need.<br>
'''NOTE''' Use a linux/unix compatible editor (like notepad++) only!<br>
'''NOTE''' Use a linux/unix compatible editor (like notepad++) only!<br>
You need to enter the image URL, the update interval and the schedule for the updates. That's all.
You need to enter the image URL, the update interval and the schedule for the updates.
 
The onlinescreensaver contains a script called enable.sh in its bin subdirectory.
This should be invoked manually if you are logged into the kindle via ssh or via KUAL from the Kindles menue.
enable.sh takes care that the scheduler of onlinescreensaver is started (also after reboot).


==== Online Screen Saver - Kindle 4 Special Tasks ====
To get it running on a Kindle 4 you need to change some lines in the OnlineScreenSaver files.<br>
You can find a .diff file for the changes here: [http://forum.fhem.de/index.php/topic,21821.msg190911.html#msg190911 fhem forum]<br>
No idea what to do with this file? It just shows you in which lines changes were made and what was changed. I recommend to edit all the files shown in the diff-file locally and then copy the whole package to the kindle first.


==Kindle 4 additional tasks==
==Kindle 4 and 5 differences compared to later models ==
A Kindle 4 differs in a few ways from the later models. It doesn't use upstart but old start up scripts so the online screensaver scripts will not start automatically after a reboot of your kindle. You can either manually start the patched /mnt/base-us/extensions/onlinescreensaver/bin/enable.sh which starts /mnt/base-us/extensions/onlinescreensaver/bin/scheduler.sh as a background process or you can create your own startup script in /etc/init.d or you can create a cron job to periodically update the screen.


Another difference is the power management. The original online screensave was created for a kindle paperwhite which has a real time clock with alarm functions that can be controlled through the sysfs. Utils.sh in the online screensavers bin directory puts the next wake up time in /sys/class/rtc/rtc$RTC/wakealarm to achieve this. So the Paperwhite can sleep most of the time and only wake up to retrieve the latest PNG, display it and go back to sleep. On a Kindle 4 this does not work so the Kinde can not go to sleep and wake up but is has to keep running. Therefore it needs a lot more power than a paperwhite. While the paperwhite might run for two weeks or longer before it needs a recharge (depending on your update frequency) the Kindle 4 will need a recharge after 2 days or a power connection / docking station.
A Kindle 4 and 5 differs in a few ways from the later models. It doesn't use upstart but old start up scripts. The enable.sh script takes care that the appropriate startup skript is copied in the right place.


As your Kindle 4 needs some more attention to get it done, please find the steps here:
Another difference is the power management. The original online screensave was created for a kindle paperwhite which has a real time clock with alarm functions that can be controlled through the sysfs. Utils.sh in the online screensavers bin directory puts the next wake up time in /sys/class/rtc/rtc$RTC/wakealarm to achieve this. So the Paperwhite can sleep most of the time and only wake up to retrieve the latest PNG, display it and go back to sleep.
 
The modified version of onlinescreensaver for Kindle 4 and 5 that can be downloaded from the Fhem forum [https://forum.fhem.de/index.php/topic,21821.585.html] therefore contains an rtcwake binary that puts the Kindle into deep sleep and wakes it up again with the built in real time clock after a defined time.
 
As your Kindle 4 or 5 needs some more attention to get it done, please find the steps here:


=== USB Network Hack ===
=== USB Network Hack ===
Zeile 146: Zeile 168:
Don't wonder you cannot ping the Kindle!<br>
Don't wonder you cannot ping the Kindle!<br>
Now you can use a ssh-client like putty to connect to the Kindle. Telnet is also an option but only when WiFI mode is disabled. So better forget about it. Success? Great job!
Now you can use a ssh-client like putty to connect to the Kindle. Telnet is also an option but only when WiFI mode is disabled. So better forget about it. Success? Great job!
=== Changing the "sleep settings" to keep the Kindle awake ===
=== Changing the "sleep settings" to keep the Kindle awake ===
The modified version of onlinescreensaver for K4 and K5 does this automatically when the above mentioned enable-sh script is run.
For the original onlinescreensaver however this is a manual task:
After you connected to the Kindle you will be asked for a password. Login with root and blank password. Should work.<br>
After you connected to the Kindle you will be asked for a password. Login with root and blank password. Should work.<br>
Now we need to make the filesystem writeable:
Now we need to make the filesystem writeable:
Zeile 159: Zeile 185:


=== Cron setting (optional) ===
=== Cron setting (optional) ===
In my case that all didn't really work for me so i decided to run the onlinescreensaver update script via cron:
In some cases that all didn't really work. In such cases the onlinescreensaver update script can also be called via cron:
:<code>vi /etc/crontab/root</code>
:<code>vi /etc/crontab/root</code>
Add the following line at the bottom. */5 means every 5 minutes.
Add the following line at the bottom. */5 means every 5 minutes.
Zeile 166: Zeile 192:
Setting back filesystem in read-only mode
Setting back filesystem in read-only mode
:<code>mntroot ro</code>
:<code>mntroot ro</code>
That's it for me. Not working? Ask and look here for help: [http://forum.fhem.de/index.php/topic,21821.0.html FHEM Forum]
That's it for me. Not working? Ask and look here for help: {{Link2Forum|Topic=21821|LinkText=FHEM Forum}}


=Examples and Pictures=
=Examples and Pictures=

Aktuelle Version vom 16. Oktober 2019, 20:40 Uhr

This article shows how to configure an Amazon Kindle eBook-Reader as a information display for Fhem. Since such eBook-Readers use eInk displays which keep their display even when the device is completely switched off, this offers a nice method to visualize Fhem devices and readings on a battery powered device which is mainly in deep sleep mode and only powers up to fetch new data from Fhem and update the display e.g. every 10 minutes.

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 or Kindle 5

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

Prerequisites

fhem and server configuration

Server configuration

The Fhem side that provides the image to display an a Kindle device typically creates this image by replacing placeholders in an SVG-file and the converting the result into a suitable PNG-file. For this conversion you need imagemagick or some other command line utility to convert SVG into PNG in the right format.

apt-get install imagemagick

fhem configuration

First you need an SVG-template. You can draw one e.g. with inkscape or 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 with 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 example. For more information about generating SVGs for Fhem please refer to this article Icons. The 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 and 5 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/.

All we're doing now is using the FReplacer module which is part of Fhem to read the SVG template, replace a search pattern with our data and save it.

define kindledisplay FReplacer /opt/fhem/www/images/template1.svg /opt/fhem/www/images/status1.svg 60
attr kindledisplay PostCommand convert /opt/fhem/www/images/status.svg -type GrayScale -depth 8 /opt/fhem/www/images/status.png 2>/dev/null &
attr kindledisplay ReplacementEncode UTF-8
attr kindledisplay room Display

PostCommand defines that the external command will be issued after the replacement to convert the resulting SVG to a PNG in 8 bit GreyScale mode. UTF8-Encode might be needed to support special characters.


Now just create your mappings:

attr kindledisplay Rep01Regex XYZ
attr kindledisplay Rep01Reading Sensor1:Temp1
attr kindledisplay Rep01Format %.1f
attr kindledisplay Rep02Regex ABC
attr kindledisplay Rep02Reading Sensor1:Hum1
attr kindledisplay Rep01Format %.1f

And so on... :) The FReplacer module will replace the pattern XYZ with the ReadingsVal from Sensor1.

More and up to date details about the configuration of the FReplacer module can be found in the Fhem command reference [1]

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!

If you want to use more complex Perl expressions to compute the replacement string, you can use the RepExpr attribute instead of RepReading and do someting like this:

attr kindledisplay Rep11Expr (ReadingsVal("XY", "Reading", "off") eq "on" ? "An" : "Aus")

If you want to add a "last modified" timestamp to the dispaly, create a placeholder for it in your SVG template (like "last modified lmtime123") and then define a Regex / Reading attribute pair to replace it with the Reading "LastUpdate" from your FReplacer device:

attr kindledisplay Rep14Regex lmtime123
attr kindledisplay Rep14Reading kindledisplay:LastUpdate:never

Templates

You can find my templates here: fhem Forum. Feel free to use and modify.

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 or K5).

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 or 5 / 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.
Download the software from here: MKK
Unzip the folder and copy the .bin file to the root directory of your kindle. Please note that you need to install the Kindle matching version (e.g. K4 = Kindle 4 with 5-way-button).
On the Kindle goto Menu -> Settings -> Menu -> Update your Kindle.
After the update it is installed.

KUAL

The Kindle Unified Application Launcher (KUAL) running applications on the Kindle.
Download it from here: KUAL
Unzip the folder and copy the matching .azw2 file to the documents directory of your kindle.

(K2, DX, K3, K4, K5)
Put KUAL-KDK-1.0.azw2 in documents folder.
Run it by clicking new kindlet (book) document in your list.

(Touch, PaperWhite)
Put KUAL-KDK-2.0.azw2 in documents folder.
Run it by clicking icon.

Backdoorlock

This is used to prevent from getting automated updates which could remove the JailBreak.
Download from here: Backdoorlock
Unzip the folder and copy the .bin file to the root directory of your kindle. Please note that you need to install the Kindle matching version (e.g. K4 = Kindle 4 with 5-way-button). On the Kindle goto Menu -> Settings -> Menu -> Update your Kindle. After the update it is installed.

ScreenSavers Hack

The ScreenSavers Hack let you show custom screen savers on the kindle.
Download the file: ScreenSaver Hack
Install the corresponding .bin file as the others before and use the "update your kindle" function to install it.
After the installation you will find a directory called "linkss" in the Kindle root. Here open the screensavers dir and delete all images.

Online ScreenSaver

This application copies the PNG image file created on the Fhem side to the ScreenSavers hack so it is displayed when the Kindle start sleeping. Just take the modified version for Kindle 4 and 5 from [2] or download the original application for later Kindles from here, extract the file and copy the folder into the extensions directory. Now you have to edit the config.sh file up to your need.
NOTE Use a linux/unix compatible editor (like notepad++) only!
You need to enter the image URL, the update interval and the schedule for the updates.

The onlinescreensaver contains a script called enable.sh in its bin subdirectory. This should be invoked manually if you are logged into the kindle via ssh or via KUAL from the Kindles menue. enable.sh takes care that the scheduler of onlinescreensaver is started (also after reboot).


Kindle 4 and 5 differences compared to later models

A Kindle 4 and 5 differs in a few ways from the later models. It doesn't use upstart but old start up scripts. The enable.sh script takes care that the appropriate startup skript is copied in the right place.

Another difference is the power management. The original online screensave was created for a kindle paperwhite which has a real time clock with alarm functions that can be controlled through the sysfs. Utils.sh in the online screensavers bin directory puts the next wake up time in /sys/class/rtc/rtc$RTC/wakealarm to achieve this. So the Paperwhite can sleep most of the time and only wake up to retrieve the latest PNG, display it and go back to sleep.

The modified version of onlinescreensaver for Kindle 4 and 5 that can be downloaded from the Fhem forum [3] therefore contains an rtcwake binary that puts the Kindle into deep sleep and wakes it up again with the built in real time clock after a defined time.

As your Kindle 4 or 5 needs some more attention to get it done, please find the steps here:

USB Network Hack

This hack is used to get SSH/Telnet Access to your Kindle. We need this on Kindle 4 to change some settings on the system.
Download and install the kindle-usbnetwork file from here: USBNETWORK
I'm sure you know what to do in the meantime ;-)
After that, activate the USBNetwork via KUAL and connect the Kindle via USB.

Connecting to the Kindle

Before you can connect you need to install the RNDIS driver. Here you can find a very good "HowTo" to do this. Note that the IP-Addresses you need to configure are different then addresses used in the example. Your RNDIS Interface needs to have 192.168.15.201 configured, the Kindle uses 192.168.15.244 on this interface.
Don't wonder you cannot ping the Kindle!
Now you can use a ssh-client like putty to connect to the Kindle. Telnet is also an option but only when WiFI mode is disabled. So better forget about it. Success? Great job!

Changing the "sleep settings" to keep the Kindle awake

The modified version of onlinescreensaver for K4 and K5 does this automatically when the above mentioned enable-sh script is run. For the original onlinescreensaver however this is a manual task:

After you connected to the Kindle you will be asked for a password. Login with root and blank password. Should work.
Now we need to make the filesystem writeable:

mntroot rw

Changing the root password:

passwd

Changing the timeouts:

cd /etc/kdb.src/yoshi/system/daemon/powerd/

Edit the t1_timeout (time before the secreensaver gets displayed) with the editor "vi" and change the last line to 200.
Same for the t2_timeout but here we enter 200000 in the last line to keep the Kindle awake for at least 2 days.
These values are setting the "sleep" counters on the Kindle. Unfortunately this will lower the battery faster then normal so I recommend to have the display in a docking station.

Cron setting (optional)

In some cases that all didn't really work. In such cases the onlinescreensaver update script can also be called via cron:

vi /etc/crontab/root

Add the following line at the bottom. */5 means every 5 minutes.

*/5 * * * * /mnt/us/extensions/onlinescreensaver/bin/update.sh
/etc/init.d/cron restart

Setting back filesystem in read-only mode

mntroot ro

That's it for me. Not working? Ask and look here for help: FHEM Forum

Examples and Pictures

KindleDisplay.jpg Kindle Display Example on Kindle 4