Networking with Kindle over USB


5 posts
by jcg » Tue Jul 17, 2012 10:03 pm
Hello,

This project could bear a title like "all your Kindle are belong to R-Pi."

I have a Kindle 3 on which I am root. See this guide:
http://www.turnkeylinux.org/blog/kindle-root.

I would like to do four things:

(1) I would like to harness the Kindle's display for use by the R-Pi,
(2) I would like to harness the Kindle's storage for use by the R-Pi,
(3) I would like to harness the Kindle's wifi chip for use by the R-Pi,
(4) I would like to harness the Kindle's CPU + RAM for use by the R-Pi.

The "pi in the sky" ideal solution would be a distributed operating system that abstracts away all the nasty details, but that doesn't exist for this application (AFAIK...).

The next best thing would be to set these things up over a USB network. I gather X has support for (a portion of) this functionality, but I have no idea how to do any of it.

But, is doing this in X the right thing? People have VNC'd Kindles to various computers, but that seems wrong to me for a variety of reasons which should be obvious. The R-Pi and Kindle are both ARM boxes, they are both running Linux, they are both Xorg capable. However, it would be nice to have the R-Pi's TTY pop up on the Kindle screen if connected at boot.

It seems to me the Kindle is the ideal complementary device to the R-Pi. It is cheap ($80US for the new ones), low power, and easy to hack. Getting a plug & play solution to at least the display and wifi problems working (1 and 3 above) would be huge. Shared storage would be grand. CPU sharing (even if it's an MPICH2 type thing) would be epic.

By "plug & play" I mean the startup sequence should be something like:
(1) run ./rpi in the Kindle shell,
(2) boot the R-Pi with it connected to Kindle over USB,
(3) profit.

So, could you folks who know lots more about this stuff than I do tear this idea apart? Pointers to relevant documentation would be a big help! As is likely apparent I know very little about networking.
Posts: 25
Joined: Mon Jul 16, 2012 10:19 pm
by jcg » Wed Jul 18, 2012 10:47 pm
Apologies for the bump, but I couldn't edit my previous post. This is just a URL dump of Kindle-related resources.

The first ~8 minutes of this video (Jesse Vincent's Kindle 2 summary):
http://blip.tv/file/2391051,

igorsk's blog with lots of Kindle 2 stuff:
http://igorsk.blogspot.com/,

hacks for Kindles 2 and 3 (wiki):
http://wiki.mobileread.com/wiki/Kindle_Screen_Saver_Hack_for_all_2.x_and_3.x_Kindles,

hacks for Kindles 2 and 3 (forum):
http://www.mobileread.com/forums/showthread.php?t=88004,

some more good stuff:
http://code.google.com/p/savory/downloads/list.
Posts: 25
Joined: Mon Jul 16, 2012 10:19 pm
by jcg » Thu Jul 19, 2012 5:48 am
Ok, someone yell at me if continuously bumping this thread is annoying. There isn't much traffic here, the `edit post' feature seems to be `broken', and I just found some more cool Kindle-related stuff. Specifically, some info about the display framebuffer, and other things.

https://github.com/dpavlin/k3libre
http://wiki.mobileread.com/wiki/Kindle_Hacks_Information
http://www.mobileread.com/forums/showthread.php?t=128704

Little did I know the Kindle has been hacked a LOT!! Also, the newer Kindles seem to be better suited for use as a remote display for the R-Pi because they run X11 ``out of the box'' rather than using a framebuffer. The following thread applies to the Kindle Touch:

http://www.mobileread.com/forums/showthread.php?t=162022
Posts: 25
Joined: Mon Jul 16, 2012 10:19 pm
by devacc12 » Fri Jul 20, 2012 9:08 am
@jcg, as per my post on the mobileread and responding to your points here.

Once the jailbreak, launchpad, usbnet, terminal, vnc viewer are installed on the Kindle you’ll get usbnet and access to native linux terminal as root on the Kindle and a VNC viewer for the Xvnc/x2vnc configuration describe in the mobileread thread.

1. Kindle screen to Pi, I'm very interested in and the Xvnc approach works over USB or WiFi but it’s a bit laggy and more work is need to configure Openbox to make it useful and for everything to start from boot without another monitor. There would be the problem locating the mouse cursor initially from the native X term and disappearing off one side of the Kindle screen if it went too far but those are relatively small problems. The screen update is the digger problem. It perhaps would be useful to have a text only solution (maybe some performance improvement and for graphics.

I would like to be able to use the Kindle as the primary display for the Pi but I don’t want to totally repurpose the Kindle. I still want to take my Kindle on holiday and read my books in the Sun. :-) The goal for me would be have an eInk display I can use with a full size keyboard (to the Pi) for some compute capability. An alternative approach would be a full sized keyboard on the Kindle but that’s another story. I’d probably be replace this configuration later this year with an Android Tablet that has a PixelQi screen when they finally hit the market. The usual promises of imminent release have been going on for months.

It’s NOT that bricking the Kindle is bad, it probably adds lots more options but that’s not an approach some may wish to take although sure there will be others who are prepared to sacrifice the Kindle eReader functionality to this aim.

2. Why do you want to do that? Isn’t is easier to add more USB or SD storage to the Pi? It sounds like nfs can be used .

3. Do you mean IP pass through from USBnet to WiFi so the Kindle acts as a WiFi adapter/router?

4. This should be relatively at a process/task level but what do you have in mind beyond MPICH2?

:-)
Posts: 10
Joined: Sat Jul 07, 2012 6:22 pm
by jcg » Fri Jul 20, 2012 10:47 pm
I'm really beginning to think a more web-based approach is the way to go for a lot of it. With a JVM web server on each device, you could just use something like this:

http://ajaxian.com/archives/webtty-server-terminal-on-webpage-using-ajax

Furthermore, you could use each JVM server as a cluster node doing different things, and get at the GPU with WebGL.

EDIT: And yes, I do mean using the kindle as a bridged router over USB to the R-Pi.

EDIT: I should unpack this a little more. The idea is to be able to write in one language: Clojure. That would mean doing AJAX things (but instead, it would be AJACs). Since using the GPU to display graphics on the Kindle would be pointless, the GPU would be running in a browser session on the R-Pi which you would send GPGPU WebCL code to.

Resources:

(1) Kindle JVM + Web server
(2) Kindle Screen ( + web browser -- All UI visualization happens here)
(3) R-Pi JVM + web server
(4) R-Pi web browser (headless)
(5) R-Pi keyboard input, sent over the wire to the Kindle web browser.
(6) Kindle wifi connection piped over USB to the R-Pi

So it basically turns the machine into a sort-of-dual-core JVM thingy with a headless GPU.

Maybe do something like X2X or X2VNC with VNC for X running on R-Pi later. Terminal only is the first step.
Posts: 25
Joined: Mon Jul 16, 2012 10:19 pm