Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-26-2016, 03:44 AM   #61
glasnost
Connoisseur
glasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbit
 
Posts: 54
Karma: 60222
Join Date: Aug 2016
Device: PW3, Kobo Aura H2O
Quote:
Originally Posted by coplate View Post
lucida's attachment here should work for mouse and keyboard
https://www.mobileread.com/forums/sho...4&postcount=26

It just needs to know what device to point at ( /dev/input/event1, /dev/input/event2, etc. ) and which keys you want to trigger it.


I'm still working on one that would support hot-swapping, but I've been distracted by World of Warcraft's Legion invasion.

It still needs the hid.ko and everything from the starg-otg.sh scripts, but it would replace the './mouseturn $(./config.sh) &' line, with one that points at your device and button configurations.
you are right, hid.ko is magic :-)

What I am trying to do is get the keyboard to function as a keyboard, ideally in xterm (though elsewhere would be fine as well.)

I initially attempted to change my /etc/xorg.conf
Code:
#mount -o bind /mnt/us/Projects/Xorg.conf /etc/xorg.conf
to simply add the keyboard as in input device and then restart the xserver. Unfortunately
Code:
#killall -s KILL Xorg
rebooted the framework entirely, which seemed to shunt my bind into some sort of a FUSE state over on /var/local/xorg.conf ?

I'll keep poking around, but I can understand why the Orcs are more important. ;-)
glasnost is offline   Reply With Quote
Old 08-26-2016, 06:29 AM   #62
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Yes, /mnt/us (the visible USB storage) is a fuse file system.

Your bind mount will fail when the system is exported.

Put the file you are binding in the other, always available, user area /var/local
knc1 is offline   Reply With Quote
Advert
Old 08-27-2016, 12:08 AM   #63
coplate
Guru
coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.
 
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
Quote:
Originally Posted by glasnost View Post
you are right, hid.ko is magic :-)

What I am trying to do is get the keyboard to function as a keyboard, ideally in xterm (though elsewhere would be fine as well.)
Look at my post here:

https://www.mobileread.com/forums/sho...3&postcount=35

Grab the bolded sections for the keyboard, they will need to go into the next part.

Then grab my download here:
https://www.mobileread.com/forums/sho...4&postcount=52
( cursor2.zip )

in mouse.sh I have the bind

mount --bind /mnt/us/cursor/makexconfig /etc/upstart/makexconfig

And my example makexconfig that has a mouse section in it.

Thats the file you need to edit, and bind, just change the mouse section I put in there into the keyboard section from my earlier post. And change the 'ServerLayout' to have "InputDevice keyboard", instead of "InputDevice mouse"

Then you can use `restart x` instead of killing x

This way you only have to bind 1 file, instead of binding Xorg.conf, and making sure this makexconfig process doesnt muck it up.


The 'upstart' process is what sets this off, you can opten up /etc/[upstart/x.something ] to see it all kick off the makexconfig program.

This worked in the search boxes in the store, but I didnt try it in x-term.

Can anyone link me the package for xterm for PW3?

Last edited by coplate; 08-27-2016 at 12:23 AM.
coplate is offline   Reply With Quote
Old 08-27-2016, 03:30 AM   #64
glasnost
Connoisseur
glasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbit
 
Posts: 54
Karma: 60222
Join Date: Aug 2016
Device: PW3, Kobo Aura H2O
Quote:
Originally Posted by coplate View Post
Look at my post here:

https://www.mobileread.com/forums/sho...3&postcount=35

Grab the bolded sections for the keyboard, they will need to go into the next part.

Then grab my download here:
https://www.mobileread.com/forums/sho...4&postcount=52
( cursor2.zip )

in mouse.sh I have the bind

mount --bind /mnt/us/cursor/makexconfig /etc/upstart/makexconfig

And my example makexconfig that has a mouse section in it.

Thats the file you need to edit, and bind, just change the mouse section I put in there into the keyboard section from my earlier post. And change the 'ServerLayout' to have "InputDevice keyboard", instead of "InputDevice mouse"

Then you can use `restart x` instead of killing x

This way you only have to bind 1 file, instead of binding Xorg.conf, and making sure this makexconfig process doesnt muck it up.


The 'upstart' process is what sets this off, you can opten up /etc/[upstart/x.something ] to see it all kick off the makexconfig program.

This worked in the search boxes in the store, but I didnt try it in x-term.

Can anyone link me the package for xterm for PW3?
And after all that work I just put into my thread. :-p

xterm upstream source: http://www.fabiszewski.net/kindle-terminal/

Lemme get this up and running and I'll report back!
glasnost is offline   Reply With Quote
Old 08-27-2016, 02:21 PM   #65
glasnost
Connoisseur
glasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbitglasnost with a running start, can leap into geosynchronous orbit
 
Posts: 54
Karma: 60222
Join Date: Aug 2016
Device: PW3, Kobo Aura H2O
@coplate,

I miswrote - by xterm, I meant kterm.

And even when I use the original /etc/upstart/makexconfig file, X crashes when I use your script and my keyboard (no mouse). I'll have to play with this more.
glasnost is offline   Reply With Quote
Advert
Old 08-27-2016, 03:55 PM   #66
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by glasnost View Post
@coplate,

I miswrote - by xterm, I meant kterm.

And even when I use the original /etc/upstart/makexconfig file, X crashes when I use your script and my keyboard (no mouse). I'll have to play with this more.
Didn't make any difference, you got the link to kTerm anyway.
knc1 is offline   Reply With Quote
Old 09-15-2016, 12:59 PM   #67
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
Quote:
Originally Posted by lucida View Post
Try this. the first /dev/input/eventX is the OTG device(not kindle), then a list of button keycode and coordinates of point.

Code:
	kindle-evdev /dev/input/eventX btn1:x1,y1 btn2:x2,y2....
You can start by running
Code:
     kindle-evdev /dev/input/eventX  1:1,1
from ssh/kterml, check the output to get keycode.
Thanks for your help! Nice code!

Although why do this every minute?
lipc-set-prop com.lab126.powerd -i touchScreenSaverTimeout 1
Any reason why not every button press, like what would happen every real screen touch?

(In the spoiler are my mistakes, feel free to ignore, I this understand this stuff more now!)
Spoiler:

Ok I am trying to do this, I plugged in a usb keyboard (actually little presenter remote control, it just sends left+right/pageup/pagedown) - yet when I type 'kindle-evdev /dev/input/eventX 1:1,1' I see no output when I press buttons. You say the first eventX is my device, so that would be event0?

In /dev/mnt/ - withouth the usb inserted I see:
by-path, event0, event1, mice, uinput


When the usb is inserted I see:
by-id, by-path, event0, event1, event2, event3, event4, mice, mouse0, uinput


Any advice? I'm not great at unix stuff sorry, I'm happy to learn though.
Thanks

-edit. Ok, within 'by-id' I see 4 devices, this usb thing isn't only being recognized as a keyboard then... strange, it doesn't have any mouse functions but maybe the firmware etc inside it does, and the creators were a little lazy.
So, I try all devices I see:
./kindle-evdev /dev/input/by-id/usb-8ea3_Wireless_Receiver-event-if01 1:1,1
./kindle-evdev /dev/input/by-id/usb-8ea3_Wireless_Receiver-event-kbd 1:1,1
./kindle-evdev /dev/input/by-id/usb-8ea3_Wireless_Receiver-event-mouse 1:1,1
./kindle-evdev /dev/input/by-id/usb-8ea3_Wireless_Receiver-mouse 1:1,1

but when I press buttons on the device I get no output on the kindle...

I guess I misunderstood the aim of this program.

I thought I give it an input device as an argument, and it would output the codes of the buttons I press... but I'm not so sure... ha

I think I understand,...
./kindle-evdev /dev/input/by-id/example buttoncode1:X,Y

When I run it and leave it running in the background, it will tap the screen at X,Y, each time I press a button that has buttoncode1.

I will look what codes correspond to what keyboard keys.



After rmmod mousedev, the keys are being read properly now, no problems there, before it was intermittent at best.

My volume buttons are being recognized fine as codes 114-115 as they should.
But they are only recognized on event3, whilst all the other keys are being recognized on event2... ha.


- lucida, your mouseturn executable is just a altered version of kindle-evdev?
or something much different? I imagine it is very similar, but I can't see the source code of mouseturn, so I'm asking

Thanks for all the information in here everyone, soon it will start to get much colder and remote page turning will be appreciated even more! (hands under the blanket etc)

Last edited by zxczxc; 09-16-2016 at 02:15 PM.
zxczxc is offline   Reply With Quote
Old 09-20-2016, 11:01 AM   #68
lucida
Enthusiast
lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.
 
Posts: 30
Karma: 118906
Join Date: Jul 2016
Device: PW3
I do this in every one minute because I wasn't sure about the load of the command at that time(seems minimal though). Should have no problem to run it on every touch.

and mouseturn is different from evdev as it relies on /dev/input/mice so it's plug&play, sth. like this.

And if you have multiple devices you can run multiple instances of kindle-evdev or try this updated version. it goes like

kindle-evdev2 -f /dev/input/eventX /dev/input/eventY ... -c key1:x,y key2:x,y.....
Attached Files
File Type: zip kindle-evdev2.zip (3.7 KB, 253 views)
lucida is offline   Reply With Quote
Old 09-20-2016, 04:12 PM   #69
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
Quote:
Originally Posted by lucida View Post
I do this in every one minute because I wasn't sure about the load of the command at that time(seems minimal though). Should have no problem to run it on every touch.

and mouseturn is different from evdev as it relies on /dev/input/mice so it's plug&play, sth. like this.

And if you have multiple devices you can run multiple instances of kindle-evdev or try this updated version. it goes like

kindle-evdev2 -f /dev/input/eventX /dev/input/eventY ... -c key1:x,y key2:x,y.....
Thanks, although no source - but it's not a problem because:
I am in the process of changing kindle-evdev to make it check all /dev/input/eventX devices for the keys specified in a config file.

Do you think it is 'bad' for the battery to be constantly checking /dev/input/event0 /dev/input/event1 /dev/input/event2 etc?

Plus I want the user to be able to remove the usb device and insert without problems, so the list of input event devices will be checked and repopulated every 10 seconds/30 seconds/1 minute.

I am happy to code this myself, but do you see any problems?
I'm just worried that this constant checking will impact the device somehow, I wouldn't want that.

Thanks for your work!

Last edited by zxczxc; 09-20-2016 at 04:22 PM.
zxczxc is offline   Reply With Quote
Old 09-20-2016, 05:48 PM   #70
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
I do not think that event numbering is dynamic, not in the way device number is.
(After all, its an event source, not a device. )

I have not look but I expect they are assigned in u-dev rules.
You could look there, or just play with some test code and plug/un-plug to see what is needed.

And I would suggest a "wait event" type of approach rather than any kind of looping test.

Keep in mind your Kindle only has a few hours of battery run time (the marketing pitch of weeks or months includes the time the device is asleep).

Also keep in mind that 'hack' is just a four letter word.
knc1 is offline   Reply With Quote
Old 09-20-2016, 10:01 PM   #71
lucida
Enthusiast
lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.
 
Posts: 30
Karma: 118906
Join Date: Jul 2016
Device: PW3
Quote:
Originally Posted by zxczxc View Post
Thanks, although no source - but it's not a problem because:
I am in the process of changing kindle-evdev to make it check all /dev/input/eventX devices for the keys specified in a config file.

Do you think it is 'bad' for the battery to be constantly checking /dev/input/event0 /dev/input/event1 /dev/input/event2 etc?

Plus I want the user to be able to remove the usb device and insert without problems, so the list of input event devices will be checked and repopulated every 10 seconds/30 seconds/1 minute.

I am happy to code this myself, but do you see any problems?
I'm just worried that this constant checking will impact the device somehow, I wouldn't want that.

Thanks for your work!
You need to use poll/select to read these events.

For hotplug, I think the best way to do so is using udev rules, however this requires modifying rootfs -- one thing I'm reluctant to do.


The daemon service itself use very little power/cpu if coding properly, the OTG device itself can be a power hog though.
lucida is offline   Reply With Quote
Old 09-20-2016, 11:32 PM   #72
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by lucida View Post
- - - - -
The daemon service itself use very little power/cpu if coding properly, the OTG device itself can be a power hog though.
My point was, no matter how little power it uses, it still uses a lot more than if the cpu is stopped and powered down.

(Its hard to beat: "off" for power savings. )
knc1 is offline   Reply With Quote
Old 09-21-2016, 12:02 AM   #73
lucida
Enthusiast
lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.
 
Posts: 30
Karma: 118906
Join Date: Jul 2016
Device: PW3
Quote:
Originally Posted by knc1 View Post
My point was, no matter how little power it uses, it still uses a lot more than if the cpu is stopped and powered down.

(Its hard to beat: "off" for power savings. )
There is little difference the page turn is triggered by an external program or an internal touchscreen event -- the system has to handle an input event regardless -- and much more CPU is used for rendering the new page.

Stop reading to maximize your power saving.
lucida is offline   Reply With Quote
Old 09-21-2016, 09:09 AM   #74
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by lucida View Post
There is little difference the page turn is triggered by an external program or an internal touchscreen event -- the system has to handle an input event regardless -- and much more CPU is used for rendering the new page.

Stop reading to maximize your power saving.
True, but you where suggesting running a daemon that will keep it awake in-between page turns.
I was tired but not bd when I suggested an event-driven rather than test-loop driven solution.
knc1 is offline   Reply With Quote
Old 09-21-2016, 11:25 AM   #75
lucida
Enthusiast
lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.
 
Posts: 30
Karma: 118906
Join Date: Jul 2016
Device: PW3
Quote:
Originally Posted by knc1 View Post
True, but you where suggesting running a daemon that will keep it awake in-between page turns.
I was tired but not bd when I suggested an event-driven rather than test-loop driven solution.
poll/select
enough said.
lucida is offline   Reply With Quote
Reply

Tags
otg, usb


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tools Software Jailbreak for PW2, PW3, PW3W, KT2, KV, KOA and KT3 knc1 Kindle Developer's Corner 3376 05-31-2023 09:43 AM
USB device to turn the page arnicas Kindle Developer's Corner 23 02-20-2017 01:20 PM
CC and USB/OTG support GEB Calibre Companion 2 05-30-2015 12:24 PM
ebook android readers and usb host - otg support sasimako Which one should I buy? 4 02-18-2015 06:26 AM
USB OTG Mythic Bookeen 7 11-11-2007 12:39 PM


All times are GMT -4. The time now is 08:32 AM.


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