Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-07-2010, 06:46 PM   #16
Hydron
Junior Member
Hydron began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2010
Device: Kindle 3
Thanks lrizzo, i was trying to get Ajaxterm going a couple days ago myself, but got put off by the installing-python issue. Great timing!
Hydron is offline   Reply With Quote
Old 11-09-2010, 06:10 PM   #17
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
I successfully compiled Midnight Commander for kindle :-). From ssh it's good. Encoding is ok and mouse is working too. On AjaxTerm is bad encoding (I can rebuild it with ISO-8859-1, but some encoding switch will be nice - especially for different languages (Default <-> UTF8)). But main problem is missing keys (F1..F12, arrows etc.). How Ajaxterm emulate them? How about add some virtual buttons for 'crtl' and 'function key' (for example with mouse click on 'function key' and on keyboard press Q for F1)
Attached Thumbnails
Click image for larger version

Name:	screen_shot-5601.gif
Views:	1953
Size:	34.3 KB
ID:	60920  

Last edited by centaurian; 11-09-2010 at 06:34 PM.
centaurian is offline   Reply With Quote
Advert
Old 11-09-2010, 07:44 PM   #18
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Can't remember if mc is using ncurses or slang, but if it's ncurses, check if using the xterm terminfo file bundled with usbnetwork helps. (The one shipped with the Kindle is like a gazillion years old).

(That is, if AjaxTerm does indeed set xterm as TERMINFO, and the browser doesn't mess things up after that. Make sure you have a proper environment set up in your shell too (ie. a proper login shell, not just calling /bin/sh, or source /etc/profile at least).).

Granted, that won't change a thing for the key mapping, but it'll maybe help with the color/ansi escape stuff.

Last edited by NiLuJe; 11-09-2010 at 07:49 PM.
NiLuJe is offline   Reply With Quote
Old 11-10-2010, 03:21 AM   #19
lrizzo
Member
lrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tongue
 
Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
i am working on completing the ANSI/xterm support in my version of ajaxterm (it is done in the backend, myts.c, function page_append(). Currently, support is limited to the basic positioning commands and line/screen erase.
Full support for colors and attributes requires a small revision of the code, to keep track of attributes for every single character (right now i only track the cursor position).
Encoding is UTF-8, but the code at the moment only supports plain ascii codes (0-127).

Key emulation instead belongs to the javascript code. i already remapped ALT so that it works as CTRL
(but you lose numbers on the Kindle3, you need to use sym for that) and the 'prev-page' on the left to generate an ESC. I'd avoid depending on mouse clicks on some area of the screen as it takes time to move the mouse to the right position. Maybe shift-alt could be used instead, possibly also popping up a window with the mappings so people don't have to remember them.

Last edited by lrizzo; 11-10-2010 at 07:22 AM. Reason: remove leftover text
lrizzo is offline   Reply With Quote
Old 11-10-2010, 03:24 AM   #20
lrizzo
Member
lrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tongue
 
Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
[removed, it was a duplicate]

Last edited by lrizzo; 11-10-2010 at 07:23 AM. Reason: remove duplicate msg
lrizzo is offline   Reply With Quote
Advert
Old 11-10-2010, 11:00 AM   #21
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
Yes,but in this way it still don't have some keys.


I think, that's best way to add two virtual modifiers - one for CTRL, second for FN.
Click image for larger version

Name:	KEYS.GIF
Views:	1027
Size:	13.7 KB
ID:	60939

For example you click on CTRL modifier and on real keyboard on C key -> emulates CTRL+C. Second press on key C only C.
FN modifier keys:
Click image for larger version

Name:	FN.JPG
Views:	1052
Size:	48.2 KB
ID:	60940
In this way is possible to emulate all keys without too much cursor moving on virtual keyboard.

What do you think?
centaurian is offline   Reply With Quote
Old 11-18-2010, 05:57 AM   #22
thebroker
Junior Member
thebroker began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2010
Device: Kindle DXG
6 mounth ago I developed a nice simple Webshell for hacking embedded devices like NAS or E-Book readers.

Is more simple that ajaxterm, but with less features:

http://downloads.plextor.nas-central...ock/webshell.c
thebroker is offline   Reply With Quote
Old 11-27-2010, 05:00 PM   #23
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
OK. Just by do it yourself metod, I make some changes in ajaxterm.js and implemented full keyboard support and handles some UTF8 characters from terminal.

Changes from Luigi last version:

Virtual keys:
Zoom: Change font size (to better fit to window), tree steps
Alt: Toggle alt key. Real alt key is working too, but by this way, you can press more combinations such as ATL+Q etc. (ALT+Q on real kindle keyboard meas 0)
Ctrl: Toggle Ctrl key.
Fn: Toggle virtual FN key. Shows help image. In this way, you can use F1-F2 keys, arrows, TAB, ESC etc.
Click image for larger version

Name:	FN.JPG
Views:	1220
Size:	30.8 KB
ID:	61925

Keys on side of Kindle:
Up: Toggle FN key (same as virtual button)
Down: Toggle CTRL key (same as virtual button)

Double UTF8 handling (only some characters).

Screenshots:
Click image for larger version

Name:	screen_shot-25833.gif
Views:	1656
Size:	36.7 KB
ID:	61922
Click image for larger version

Name:	screen_shot-25832.gif
Views:	1606
Size:	28.7 KB
ID:	61921

Instalation: just replace ajaxterm.js
Attached Files
File Type: zip ajaxterm.zip (35.3 KB, 655 views)

Last edited by centaurian; 11-27-2010 at 05:09 PM.
centaurian is offline   Reply With Quote
Old 11-27-2010, 05:15 PM   #24
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
Here is compiled MidnightCommander for use in Kindle term. Fully functional.
Just extract it to flash root (/mnt/us/) and start it with:

cd /mnt/us/local/terminal/

Edit:
Added missing libslang.so.2
Attached Files
File Type: zip kindle_mc(2).zip (3.30 MB, 1283 views)

Last edited by centaurian; 11-30-2010 at 02:19 PM.
centaurian is offline   Reply With Quote
Old 11-29-2010, 08:51 AM   #25
ankigodzi
Junior Member
ankigodzi began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2010
Device: Kindle
running ajaxterm on nell or kindle DX

hey,
how can we use this hack of Ajaxterm for Nell (Kindle DX) which doesn't have a wifi option.
Can we use it on wan?
Is it possible throught USBNet hack. if yes how?
ankigodzi is offline   Reply With Quote
Old 11-29-2010, 02:40 PM   #26
lrizzo
Member
lrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tonguelrizzo can tie a knot in a cherry stem with his or her tongue
 
Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
Quote:
Originally Posted by ankigodzi View Post
hey,
how can we use this hack of Ajaxterm for Nell (Kindle DX) which doesn't have a wifi option.
Can we use it on wan?
Is it possible throught USBNet hack. if yes how?
I have not sure but there is probably a better approach, as described below, that we might be able to implement in not too much time.

As the author of "launchpad" mentioned me, and there is code included in his latest version, see

https://www.mobileread.com/forums/showthread.php?t=97636

the Kindle's framebuffer is accessible through /dev/fb with a standard and easy API (the screen is memory mapped, and there are a few ioctls to update the screen).

So we can implement a proper terminal by merging launchpad and ajaxterm as follows:

1. extend launchpad with some option to enter a "terminal" mode where input from keyboard and fiveways is captured (so, not sent to the kindle's framework) and used as below;

2. convert kindle events into keycodes produced by a terminal (with ALT, CTRL, cursors...). This is more or less what ajaxterm.js does .

3. use the code in myts.c (the ajaxterm backend) to send keycodes to a shell, and interpret the responses to update a virtual screen (we need better ANSI emulation)

4. convert the screen into a proper bitmap that we can display in the framebuffer.

The missing code is not particularly difficult, just boring to write: for #2 is purely a translation from js to C, for #3 we need to extend the ANSI emulation, for #4 we need a 7 pixel-wide monospace font (so we can display 80 columns on the Kindle3 which has 600 pixels) and extend the blitting code so it can handle areas that are not byte-aligned (the Kindle3 has 4bpp so a 7-pixel font occupies 3.5 bytes per line; not sure if the DX has 4bpp or less).

cheers
luigi
lrizzo is offline   Reply With Quote
Old 11-29-2010, 04:12 PM   #27
jetfin
Enthusiast
jetfin has a complete set of Star Wars action figures.jetfin has a complete set of Star Wars action figures.jetfin has a complete set of Star Wars action figures.jetfin has a complete set of Star Wars action figures.jetfin has a complete set of Star Wars action figures.
 
Posts: 37
Karma: 434
Join Date: Apr 2010
Location: Zagreb, Croatia
Device: Kobo Aura One, KPW, K3, K2i, K2US
Quote:
Originally Posted by centaurian View Post

I made run script for launchpad. On first run it runs AjaxTerm from /mnt/us/local/terminal/ directory. On second run it kills it.
I can't get this to run through launchpad, it just fails. Here's my launchpad.ini entry:
Code:
T = !/mnt/us/local/terminal/terminal.sh > /dev/null
The terminal works fine when I start the server through ssh.... Any ideas?

Also, regarding MC, when i try to run it I get:
./mc: error while loading shared libraries: libslang.so.2: cannot open shared oy

Last edited by jetfin; 11-29-2010 at 04:24 PM.
jetfin is offline   Reply With Quote
Old 11-30-2010, 02:27 PM   #28
centaurian
Member
centaurian began at the beginning.
 
centaurian's Avatar
 
Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
I added missing library to that archive.

I running it with:
Code:
B = !/bin/sh /mnt/us/local/terminal/terminal.sh ;echo 101 >/proc/eink_fb/update_display
It runs script and show lines on screen to show script execution.

What I found, ajaxterm works only, if you are connected to wifi network. After going to sleep it's frozen, so you will need to restart it with double execution of Shift-B.
centaurian is offline   Reply With Quote
Old 12-01-2010, 09:52 AM   #29
jetfin
Enthusiast
jetfin has a complete set of Star Wars action figures.jetfin has a complete set of Star Wars action figures.jetfin has a complete set of Star Wars action figures.jetfin has a complete set of Star Wars action figures.jetfin has a complete set of Star Wars action figures.
 
Posts: 37
Karma: 434
Join Date: Apr 2010
Location: Zagreb, Croatia
Device: Kobo Aura One, KPW, K3, K2i, K2US
Thanks, the launchpad shortcut now shows "Success!" but the server still does not seem to be running... -still works fine when I start it through command line on ssh...
jetfin is offline   Reply With Quote
Old 12-24-2010, 09:50 AM   #30
ranza
Junior Member
ranza began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2010
Device: Kindle 3 wifi
Maybe i just dont get it but i dont have a ctrl key on my kindle? Is it some magic hidden key?
ranza is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle, Calibre, Author sort gdaydigger Calibre 5 03-11-2014 08:21 PM
Kindle app for iPad appears in the App Store pilotbob News 46 04-06-2010 08:25 PM
kindle app? is it possible to design a app to full support PDF? lili1989 Amazon Kindle 12 02-05-2010 05:29 PM
Author Sort & Kindle seagull Calibre 0 12-25-2009 12:42 PM
How does kindle sort pictures? princeofegypt Amazon Kindle 1 04-24-2009 04:54 PM


All times are GMT -4. The time now is 08:48 PM.


MobileRead.com is a privately owned, operated and funded community.