Today I would like to write few words about a somewhat strange project I did. The need came from the fact that I was quite ill lying in bed for substantial amount of time with problems to move because of sores. I wanted to read something on my Kindle. I found it quite irritating to be forced to move my hand every minute or so to turn the page. I almost immediately thought, come on, there must be a smarter way to do it, and I came up with an idea of a remote page turner for kindle.
But how could that be done? One obvious choice is solenoids mounted on page switchers – but, hey, its the 21st century already. That would not be cool at all. So, the next choice is to hook up to the kindle’s usb port, but the problem is that the kindle works as a slave, not as a host – attaching any HID devices to its usb port is not really possible. USB is out of the picture. After searching the internet, I found that Kindle also has a serial interface. Unfortunately, it is not available unless you open it and solder the port yourself (even though I have done things like that in the past I certainly didn’t want to do it now) there has to be another way of approaching this problem. And finally I got it. WIFI 🙂 – Why didn’t I think of it in the beginning?
Ok, so WIFI, but how can I connect to my kindle using WIFI? Tt is the kindle that connects to the router. Maybe it would be possible to somehow connect (via ssh) to kindles IP address and send commands that way. That was the idea, but, as it turned out it wasn’t that straight forward after all – but doable! 🙂 after figuring out different bits and pieces I was able to ssh to my kindle from a pc great! That’s a big step. Sending commands that would imitate keystrokes should not be that hard since it’s all Linux under the hood. Few internet searches later I got the answer:
[root@kindle root]# echo "send 193" > /proc/keypad [root@kindle root]# echo "send 191" > /proc/keypad
Et voila – those are the commands for turning pages forward and back respectively. I still I need a pc to connect to my kindle via ssh and send those commands. It doesn’t bring me any closer to the goal of being able to turn pages remotely, or at least without any large movements. The solution was to write an android app that does all that, and the actual remote would be a wired audio remote attached to my Samsung’s headhones. After maybe an hour of searching the internet, and another half hour of actual coding, I had an Android app in place and ready to operate. It is very rough and could probably be improved in almost every aspect, but it does its job perfectly. I can now lie in bed holding my wired remote between my fingers and read my kindle – isn’t that awesome?
There is still the possibility to go completely wireless with something like a bluetooth camera shutter, but I think that the first solution is good enough.
Here you can see the assembled piece in action: http://youtu.be/hb3-mywNwF4
Android application code available there: https://github.com/mbarabasz/KindleTurn
Steps:
1. Jailbreak Kindle
2. Install USBNetwork update
3. Enable SSH over WIFI
4 Test out commands to turn pages via usb link
5. Write Android app to listen to remote commands and send commands to Kindles ssh server
Links:
ssh lib for java
http://wiki.jsch.org/index.php?Manual%2FExamples%2FJschExecExample
kindle rooting and getting access to its ssh
http://wiki.mobileread.com/wiki/Kindle4NTHacking#Debricking_.2F_Un-demoing_.2F_Flashing_firmware
http://www.turnkeylinux.org/blog/kindle-root
http://blog.joschika.tk/2012/03/01/kindle-4nt-ssh-over-wifi/
http://members.ping.de/~sven/kindle.html
http://www.shatteredhaven.com/2012/11/1337365-ssh-on-kindle-4-usbnetwork-hack.html
UPDATE (17/08/2014):
Just few days ago I finally received my remote shutter for Android and iOS. It is a pretty cool device even if used for its original purpose. As stated in the previous post I was intending to at some point to “go completely wireless” and having remote shutter would make it possible. So here we go:
This is exactly how my device looks like. I bought it on ebay for just over 3$ with free shipping (it took almost one month to arrive but still it is a good deal).
After connecting device to my phone over bluetooth (which was dead easy, just pair devices) it was recognized as a bluetooth keyboard. I opened my camera app and it worked straight away I was able to take pictures with it (small android buttoe n). Of course I was curious about the bigger button, it would be cool to use it as FORWARD in this project where as the small one would fit for PREVIOUS perfectly. When pressed in home screen it is putting volume up – brilliant.
After quick modification of Android app I wrote, changing the keys that should turn the pages and adding possibility to modify kindle’s ip, kindle’s username, and kindle’s password. I was good to go for a first test. It worked!
As for the usage – it works pretty much perfectly, it is quick and reliable. The range is sufficient as you still need to see the Kindle, so1m is more than enough (I haven’t tested it but it should do at least 5m). There is one remark I need to make thou: The shutter turns itself to power preservation mode after around one minute from last usage – this means you need to read at least one page per minute to keep it up, which shouldn’t be a problem for a typical person. Pressing the button after that time takes around 3s to reconnect and then turns the page, I think it is acceptable.
The modified code can be found in github. At some point I am planning to put it to Google Play (even got developers account for that purpose), I am a little concerned thou since getting this setup to work requires few extra steps and some basic understanding. Stay tuned.
Wireless version in action: http://youtu.be/DCK1khQHFfE



November 21, 2013 at 10:14 am
Ok there is something already out there that does it: http://www.orin.com/access/pagebot/ but I like mine more 🙂
November 22, 2013 at 4:11 pm
and another one – http://www.ifixit.com/Guide/Kindle+3+Remote+Page+Turn+Switch+Replacement/5749
February 11, 2014 at 5:07 pm
I like yours better too, but I’m a little nervous about jailbreaking my Kindle Fire. Will this work with a Fire as well?
February 23, 2014 at 10:32 am
Unfortunately I don’t have access to kindle fire, but as far as I know it is using Android underneath. In theory you should be able to install ssh server app on it and do something similar. Another option is to write Android app that is sitting on the device itself and listens to remote commands. It might still be required to root the device though, which I understand is not the way you want to go. Anyway thanks for commenting. cheers
April 14, 2014 at 9:35 am
Could you provide a .apk of the app? I’d love to use this but I do not have the time to get into how to build apk from source….
April 14, 2014 at 9:47 am
Found it: https://github.com/mbarabasz/KindleTurn/blob/master/KindleTurn/bin/KindleTurn.apk
April 14, 2014 at 1:44 pm
But i keep getting a parsing error when trying to install
May 30, 2014 at 11:08 pm
Will this work with a Kindle Paperwhite?
Pingback: Kindle holder | mbarabasz
September 18, 2014 at 11:38 am
Nice work there.
How long does the remote shutter’s battery last?
March 10, 2015 at 10:32 pm
Hello and thank you for posting this, I have been looking to do something like this but mechanical. Your idea rocks.
I’m a little confused as you have two different working versions here… Would I still need to jailbreak the kindle and then install the apk file for this to work?
March 12, 2015 at 7:37 pm
Jailbreaking is unfortunately needed in order to allow ssh connections to your kindle. Currently I am working on upgrading the idea to eliminate the need of having a phone in the middle. It will be a bit more expensive though. Stick by as I should upload descriptions soon.
March 21, 2015 at 9:37 am
Looking forward to it!
March 10, 2015 at 10:47 pm
I actually have a kindle paperwhite 😦
March 15, 2015 at 11:39 am
This is exactly what i was searching for my PW2. Maybe connect kindle to BT module?
Subscribed for updates
April 19, 2015 at 8:27 pm
Would love one that doesn’t need the phone in between because I want to turn pages remotely while I run on a treadmill and would rather not have to have the phone in my pocket, but it’s not tragic either way. If this works with a paperwhite, and you’d be willing to make, I’d be interested in buying one.
May 19, 2015 at 8:39 pm
Thanks for this post, it helped a lot to make the remote page turn possible for my kindle 🙂 I based my Android app on yours and optimized some parts:
Biggest impact had the decoupling of session and sending a command via channel. I open a session when the Android app starts and disconnect it when the app is closed (or hidden). That way you don’t have to make the login procedure for every page turn, which makes it noticeable reacting faster to button presses.
If you are interested, I can upload the full sourceode somewhere.
November 16, 2015 at 12:51 pm
Mugendon, PLEASE upload the source code. Thanks.
November 16, 2015 at 7:42 pm
@Mike Here you go:
http://pastebin.com/sVxeaBfV
Pasted all in one big class, I hope it still helps 🙂
You set the ip in the EditText and press enter on the keyboard. The password ist hardcoded.
It is optimized for oled displays, therefore the activity is black and fullscreen.
The code is not really optimized and the user experience is not the best, since I never looked back at the code after it worked the first time for my purpose 😉
February 29, 2016 at 6:52 am
I’m slugging through the learning curve. I did the jailbreak, the install of USBNetwork, got my keys working, and logged in through SSH.
The K3 directed its echo to /proc/keypad.
The newer K5 Paperwhite doesn’t have a /proc directory. Any suggestions on what other directory to use as an alternate device stream, or even if the code for the PW forward and backward is the same as for the K3?
Instead of generating forward and back codes from a remote device, I’m wondering if I can write an executable script to loop and generate the codes for a slideshow of a PDF file. In a perfect world, I’d write the script, display my PDF, the run the script to slideshow through the pages in the PDF, one page at a time, forward, then backward, repeat.
Can an executable script made to cycle through to send codes to the device?
I’ll also be posting on mobileread.com developer section, just in case. Thanks.
December 28, 2016 at 4:32 pm
this is the best way for turn page with a remote comand or now (almost 2017) some1 found a better solution? (like phonefree)
i have a PW2 and turn the page kill my hands 😦
December 28, 2016 at 10:17 pm
Still has some disadvantages though.
December 18, 2017 at 6:37 pm
Hi, i tried compile your source for Kindle PW1 (it doesn’t have /proc/keypad).
I change command in
“KindleTurn1\app\src\main\java\pl\whipsoft\kindleturn\COMMAND.java”
to “xdotool mousemove 650 550 click 1”.
When i connect for kindle via putty – this command works (i’d copy xdotool earlier), but app don’t work. Maybe you can help me with it? I saw many peoples on mobileread who also want remote for their kindle paperwhite. You can help all of us.
December 18, 2017 at 6:44 pm
I am completelly not a programmer
December 18, 2017 at 9:01 pm
Hello,
I think that you could try with exposing http server from your kindle, and then interacting with it from your phone or whatever. Good starting point could be https://www.instructables.com/id/Kindle-Web-Remote-Control/, actually my follow up post with esp8266 remote for kindle uses this method.
July 29, 2018 at 11:11 am
Interesting. I’m lying here in bed reading and the idea occurred to me as well. 30 minutes later in settled here in this blog post. Marcin, contact me.