07-18-2016, 09:20 PM | #1 |
Guru
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
|
New method for Page Turn remote [ I need development help ]
I have a plan for a new version of the page turn remote, that would not require a smartphone and the buttons.
My idea would be to use the ESP8266 in AP mode ( hotspot ), so that my kindle can connect to it, and then using buttons on the ESP8266, send the page turn commands to the kindle. https://learn.sparkfun.com/tutorials...-ap-web-server Things that I need and want
If the ESP8266 was capable of ssh, I could just send the commands over that, but it is not. Alternatively to point 2 or ssh, I could set up telnetd as well I imagine, but I think it would be nice if the package could have the code to tell if it should use libxdo, or the keyboard, for the different kindles. The xdotool I am using I got from twobob's post at https://www.mobileread.com/forums/sho...=162022&page=3 For some reason, I just cannot figure out from all the threads how to get a crosscompiler and all the dependent libraries set up. What I am asking for help on: I need an environment where I can cross compile. Simply download arm-non-eabi-gcc does not get me all the headers I need, and certainly not the libraries that I would need to link to. And this is what I think I really need help with. I'm trying to figure out all the different setups people use, and its just crossing wires in my head. For example, the ext3 file in this post: https://www.mobileread.com/forums/sho...46&postcount=6 And then the following says to install "Debian Wheezy via GRIP" and I have no idea what GRIP is, or what effect this will have on my kindle. If anyone possibly has a step-by-step setup for getting started on the compilers ('m on window ), even if it starts with "Install a debian virtual machine, then do ...", I would be so happy. Edit Step-by-step so far: 0: ubuntu vm and run the apt commands at the bottom 1: Jailbreak kindle 2: git clone https://github.com/NiLuJe/crosstool-ng/ (( the snapshot didnt have the configure and bootstrap - or I hadnt installed all the required dependencies yet )) 3: ./bootstrap 3: ./configure --enable-local 4: ./ct-ng arm-kindlepw2-linux-gnueabi 5: ./ct-ng build 6: ~/x-tools/arm-kindlepw2-linux-gnueabi/bin/arm-kindlepw2-linux-gnueabi-gcc pageturnd.c -o pageturnd 7: scp pageturnd.c <kindleIP>:. Done. Dependencies installed with apt for crosstools-ng ( and some other scripts, but I couldnt back them all out ) sudo apt-get install autoconf sudo apt-get install awk sudo apt-get install bison sudo apt-get install cmake sudo apt-get install crosstool sudo apt-get install crosstool-ng sudo apt-get install flex sudo apt-get install gawk sudo apt-get install git sudo apt-get install glibtool sudo apt-get install gperf sudo apt-get install help2man sudo apt-get install joe sudo apt-get install libncurses sudo apt-get install libncurses-dev sudo apt-get install libtool sudo apt-get install libtool-bin sudo apt-get install linbcurses sudo apt-get install linbcurses-dev sudo apt-get install make sudo apt-get install makeinfo sudo apt-get install svn sudo apt-get install svn2cl sudo apt-get install texinfo sudo apt-get install transifex-client Last edited by coplate; 07-20-2016 at 11:44 PM. |
07-18-2016, 09:22 PM | #2 |
Just a Yellow Smiley.
Posts: 19,161
Karma: 83862859
Join Date: Jul 2015
Location: Texas
Device: K4, K5, fire, kobo, galaxy
|
|
Advert | |
|
07-18-2016, 09:27 PM | #3 |
BLAM!
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
|
07-18-2016, 10:52 PM | #4 |
Addict
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
|
how about trying to make use of amazon's bluetooth attachment? that seems like a nice idea i think!
anyway good luck |
07-18-2016, 11:06 PM | #5 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
Advert | |
|
07-18-2016, 11:13 PM | #6 |
Guru
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
|
NiLuJe
So I've got a copy of both the x-tc tarball, and a clone of your crostool-ng git repo, but I'm lost again. The first thing I tries was just the x-compile in the snapshot, and it tell me that arm-kindlepw2-linux-gnueabi-gcc is not installed. So then I try to build whats in the github repo, and it builds. But it looks like I'm supposed to feed some of the config files from your snapshot into it, and I'm not sure how to do that. Edit - I just found the line in https://github.com/NiLuJe/crosstool-...0toolchain.txt that says how to use a config Last edited by coplate; 07-18-2016 at 11:16 PM. |
07-18-2016, 11:18 PM | #7 |
BLAM!
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
The tree also bundles samples, so, you can just use that, too (however samples are supposed to be used with ct-ng, can't recall OTOH ^^. It's something trivial around make, IIRC).
EDIT: According to my shell history, possibly even simpler than that: ct-ng arm-kindlepw2-linux-gnueabi |
07-18-2016, 11:38 PM | #8 |
Guru
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
|
I had to install a lot of libraries, and If I could export my bash history from this ubuntu image, I'll get them, for future users.
so after readign this http://crosstool-ng.org/ and running ct-ng list-samples I ran: >ct-ng arm-kindlepw2-linux-gnueabi and get Now configured for arm-kindlepw2-linux-gnueabi Then I ran >ct-ng build now its building stuff that takes a long time - 14 minutes and counting ( most time on "installing pass-1 core C gcc compiler " ) [[ 39:48 minutes on my VM ]] My next step for full integration would be to figure out the kindletool it looks like the instructions at https://wiki.mobileread.com/wiki/Kind...ustom_packages gives this sample: >kindletool create ota2 -d k5w -d k5g -d k5gb run.sh data.tar.gz update_custom_script.bin Its not clear to me what will happen with run.sh and data.tar.gz will it make a bin file that always runs the first command, or is there somethign else I'm missing? Edit: I see the comment now >> In case of OTA updates, all files with the extension ".ffs" or ".sh" will be treated as update scripts. Will it run those in any given order, or do they need to be in the top level or ..? Last edited by coplate; 07-19-2016 at 12:04 AM. |
07-19-2016, 12:10 AM | #9 |
Guru
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
|
And Success - Hello world compiles and runs on my kindle.
And this socket tutorial works too - all the network headers are good. http://www.tutorialspoint.com/unix_s...er_example.htm Looks like all I Need now is to wait for the ESP8266 in the mail. Last edited by coplate; 07-19-2016 at 12:14 AM. |
07-19-2016, 12:31 AM | #10 |
BLAM!
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@coplate: Yeah, a TC build takes roughly 30 min on my buildbox (vs. much, much less on my desktop).
And yeah, you probably need a more-or-less complete build envrionment (with static libraries, which might still be an issue for Arch users). Gentoo here, so, that usually completely skips my mind . You can take a look at kindletool help for the full details, but basically you should be good with $ kindletool create ota2 -d kindle5 <input> <output> Or a more fine-grained set of devices, since with that TC binaries won't run on devices earlier than the PW2. As for whatever you feed to it as input, it behaves like tar by default. Scripts (.sh/.ffs) get flagged as update scripts, and are run in alphabetical order by the updater (no matter where they are, although I don't recall anyone ever trying putting them somewhere else than top level). On those devices, the updater always cleans up after itself, so you don't really have to care about that in your install script. (It extracts the package in a temp directory that gets wiped on exit). I have a set of helper stuff for logging & progress handling in update scripts (libotautils5). It's bundled with basically any of my stuff. While I used to recommend the dummy package as an example, basically any of 'em will do . Last edited by NiLuJe; 07-19-2016 at 12:36 AM. |
07-19-2016, 09:53 PM | #11 |
Guru
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
|
Ok, one last update before I focus on cleaning everything up.
I have got the esp8266 connected to the same wifi as the kindle. I have written the lua for it to send a page turn even to my port running on the kindle. I had to open iptables on that port on the wlan interface. Next step will be getting a case for it, with two buttons for forwards/back. I ended up with the adafruit model available at my local microcenter: mfg link: https://www.adafruit.com/products/2821 |
07-20-2016, 11:45 PM | #12 |
Guru
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
|
and project in fully functional state, I'mma get all my code onto github, for people to see ( it is not pretty ), and Im still looking for a better case, and to make a KUAL extension. - And package the xdotool library with it.
But it works! |
07-21-2016, 03:58 AM | #13 |
Addict
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
|
nice to see you are making good progress coplate!
oops, from your reply I assume it doesn't support pw3, my mistake. Last edited by zxczxc; 07-21-2016 at 04:01 AM. |
04-10-2020, 01:26 PM | #14 |
Junior Member
Posts: 2
Karma: 10
Join Date: Apr 2020
Device: PW3
|
Is the pageturnd code available? I would experiment with it, my touchscreen is dead, so I´m looking for a workaround to still use the kindle somehow.
|
04-12-2020, 07:51 PM | #15 | |
Guru
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
|
Quote:
If so, There was another project that inspired this, that used an android phone on wifi to do the same thing, I can poke around and try to find that too. Edit: here was the original: https://www.mobileread.com/forums/sh...hlight=xdotool what his android app did is SSH into the kindle, and then run 'xdotool' to issue a touch at a certian point that woudl change the page. The app I wrote was a little different. It lived on the kindle as a service that was always running ( started with kual ), and then you had to send certain letters to it over telnet to get it to change pages. Last edited by coplate; 04-12-2020 at 07:58 PM. |
|
Tags |
cross-compile, pageturnd |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Remote Page Turning Controller | frostschutz | Kobo Developer's Corner | 45 | 08-25-2020 12:49 PM |
Page turning remote / App wanted | jskvbinmv | Kindle Developer's Corner | 16 | 09-11-2014 12:35 PM |
Paperwhite Page Count Method | marcl | Amazon Kindle | 5 | 10-09-2013 11:44 AM |
PRS-600 How is battery life affected by turn off method | Dave W | Sony Reader | 5 | 10-13-2009 11:45 PM |
Automatic page turn / remote Working Prototype | gregcd | Sony Reader | 5 | 09-14-2009 07:38 PM |