![]() |
#256 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 35
Karma: 10232
Join Date: Nov 2010
Device: G090G1 5.9.7 G090G1 5.10.2
|
Ok, I think I've figured out what is going on. When I plug the device in, it thinks there is both a keyboard and a mouse active. It's putting the mouse on event2, the volume buttons (brightness) on event3, and the keyboard (up/down/tab/enter) on event4. According to the KindleLazy doc it only reads event2 and event3.
I'm not sure why it's putting a keyboard on both event3 and event4. I tried changing the symlinks to redirect the things to event2/3 but that didn't work. Probably wouldn't last anyway between starts/stops. Code:
[root@kindle by-path]# ls -la drwxr-xr-x 2 root root 160 Apr 1 00:27 . drwxr-xr-x 4 root root 240 Apr 1 00:27 .. root 9 Apr 1 00:27 platform-fsl-ehci.0-usb-0:1:1.0-event-mouse -> ../event2 root 9 Apr 1 00:27 platform-fsl-ehci.0-usb-0:1:1.0-mouse -> ../mouse0 root 9 Apr 1 00:27 platform-fsl-ehci.0-usb-0:1:1.1-event-kbd -> ../event3 root 9 Apr 1 00:27 platform-fsl-ehci.0-usb-0:1:1.2-event-kbd -> ../event4 root 9 Jan 7 2000 platform-imx-i2c.0-platform-max77696-onkey.0-event -> ../event0 root 9 Apr 1 00:00 platform-imx-i2c.1-event -> ../event1 Code:
eventfd2 = open("/dev/input/event2", O_RDONLY); Code:
eventfd2 = open("/dev/input/event4", O_RDONLY); Any ideas on why my device is using event3 and event4 for the keyboard and others are not? I assume others use event2 and event3. |
![]() |
![]() |
![]() |
#257 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Using a logical path (c.f., /dev/input/by-path) might be better to handle enumeration quirks like that
![]() (Plus, some Kindle variants *natively* have more stuff enumerated over USB (usually, an accelerometer or some weird extra thingy on 3G models)). |
![]() |
![]() |
![]() |
#258 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 35
Karma: 10232
Join Date: Nov 2010
Device: G090G1 5.9.7 G090G1 5.10.2
|
Quote:
Returns "event4" Code:
grep -B2 'EV=120013' /proc/bus/input/devices | grep -o 'event[0-9]' Code:
grep -B2 'EV=1f' /proc/bus/input/devices | grep -o 'event[0-9]' Spoiler:
Explanation for the bitmasked EV field here: https://unix.stackexchange.com/quest...t-devices-data |
|
![]() |
![]() |
![]() |
#259 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
That is indeed another solution, provided you're building the path dynamically
![]() i.e., we do that in KOReader to pickup the Accelerometer on one or both of the Oasis. In a hard-coded compiled program, I find a by-path path usually does the job, but, yes, it depends on the exact task (and, indeed, here, the USB controller can be different and/or use a different name on various Kindle models). EDIT: I haven't checked, but if you want to go that way in C/C++, libevdev might have higher-level tools to do that without having to reinvent the wheel ![]() Last edited by NiLuJe; 02-21-2019 at 11:44 AM. |
![]() |
![]() |
![]() |
#260 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 35
Karma: 10232
Join Date: Nov 2010
Device: G090G1 5.9.7 G090G1 5.10.2
|
FYI, I got it to work for now. I used a hex editor to patch in event4 vs event2 into the file kindlelazy in /mnt/us/extensions/KindleLazy/bin. Here's the file if it helps anyone. Sheesh, probably 20 hours pondering and trying various ways, and this way took about 5 minutes.
|
![]() |
![]() |
![]() |
#261 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 35
Karma: 10232
Join Date: Nov 2010
Device: G090G1 5.9.7 G090G1 5.10.2
|
I've successfully gotten KindleLazy to stop and start when a wireless presenter is plugged and unplugged with a Paperwhite 3 2015 Wifi G090G1 5.9.7.
The default behavior of KindeLazy will require a manual press of the start KindleLazy button after plugging your USB device in, and also each time after your Kindle goes to sleep. These scripts should alleviate all instances of having to press the start KindleLazy button. This will only work if you have the same presenter as the author of KindleLazy specified. If you don't have that one see the end of the post. I've attached the 6 files required to make it work. The first two files have to go on the OS partition. 98-StopKindleLazy.rules - Place in /etc/udev/rules.d/ 99-KindleLazy.rules - Place in /etc/udev/rules.d/ The other 4 files can be placed via plugging the Kindle into your PC: start.sh stop.sh udev.sh start-reverse.sh Place all of these in /mnt/us/extensions/KindleLazy/bin/ and that's it. We're done. If you don't have the same presenter you can modify the two .rules files to make it work. You'll need shell access over wifi or serial, shell via USB will not suffice. In your shell, run "udevadm monitor" and plug your device in, you'll see output similar to the following: Code:
UDEV [1551143135.411150] change /devices/platform/imx-i2c.0/i2c-0/0-003c/max77696-battery.0/power_supply/max77696-battery (power_supply) KERNEL[1551143139.121037] add /devices/platform/fsl-ehci.0/usb1/1-1 (usb) UDEV [1551143139.124513] add /devices/platform/fsl-ehci.0/usb1/1-1 (usb) KERNEL[1551143139.125857] add /devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0 (usb) KERNEL[1551143139.129246] add /devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.1 (usb) KERNEL[1551143139.132509] add /devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.2 (usb) UDEV [1551143139.210115] add /devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.1 (usb) UDEV [1551143139.212820] add /devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0 (usb) UDEV [1551143139.214625] add /devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.2 (usb) Copy whatever shows up after the last "add" and run the following command: Code:
udevadm info -a -p /devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.2 Code:
looking at device '/devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.2': KERNEL=="1-1:1.2" SUBSYSTEM=="usb" DRIVER=="usbhid" ATTR{bInterfaceNumber}=="02" ATTR{bAlternateSetting}==" 0" ATTR{bNumEndpoints}=="01" ATTR{bInterfaceClass}=="03" ATTR{bInterfaceSubClass}=="01" ATTR{bInterfaceProtocol}=="01" ATTR{modalias}=="usb:v0458p0189d1001dc00dsc00dp00ic03isc01ip01" ATTR{supports_autosuspend}=="1" looking at parent device '/devices/platform/fsl-ehci.0/usb1/1-1': KERNELS=="1-1" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{configuration}=="" ATTRS{bNumInterfaces}==" 3" ATTRS{bConfigurationValue}=="1" ATTRS{bmAttributes}=="a0" ATTRS{bMaxPower}=="100mA" ATTRS{urbnum}=="26" ATTRS{idVendor}=="0458" ATTRS{idProduct}=="0189" ATTRS{bcdDevice}=="1001" ATTRS{bDeviceClass}=="00" ATTRS{bDeviceSubClass}=="00" ATTRS{bDeviceProtocol}=="00" ATTRS{bNumConfigurations}=="1" ATTRS{bMaxPacketSize0}=="64" ATTRS{speed}=="12" ATTRS{busnum}=="1" ATTRS{devnum}=="7" ATTRS{devpath}=="1" ATTRS{version}==" 1.10" ATTRS{maxchild}=="0" ATTRS{quirks}=="0x0" ATTRS{avoid_reset_quirk}=="0" ATTRS{authorized}=="1" ATTRS{manufacturer}=="Genius" ATTRS{product}=="Wireless Mouse" Now run Code:
udevadm test /devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.2 Code:
udev_rules_apply_to_event: RUN '/mnt/us/extensions/KindleLazy/bin/udev.sh' /etc/udev/rules.d/99-KindleLazy.rules:5 udevadm_test: run: '/mnt/us/extensions/KindleLazy/bin/udev.sh' Last edited by eruditionastic; 02-28-2019 at 08:12 AM. |
![]() |
![]() |
![]() |
#262 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2018
Device: PW3
|
KindleLazy works on PW3 5.9.6.1, with the patched binary from eruditionastic. I'm using the same presenter the KL developer recommended (Model DSIT001 written on the box) and was getting the event4 device name as well.
After a couple KL start/stops, the event4 (kbd) device stopped showing up, but it seems a kindle reboot makes it show up again when KL starts. Thanks to everyone who worked on KL and the jailbreak, and everything else involved! |
![]() |
![]() |
![]() |
#263 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
|
Thanks @eruditionastic - that's great work.
Even better that it was a work out of love! I'll see how I can include them in the main release. About future kindles, I had a PW4 to setup and was ready to jailbreak it, but embarrassingly accidentally updated over wifi... so the chance of getting to make KindleLazy work on PW4 was delayed until I can try again ![]() Once I remember/re-learn how to set up the necessary development tools in order to compile kindle stuff, I'll make a few little updates. Thanks |
![]() |
![]() |
![]() |
#264 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@zxczxc: see https://github.com/koreader/koxtoolchain for a refresher course
![]() |
![]() |
![]() |
![]() |
#265 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2018
Device: PW3
|
After a sleep/wake cycle, KL only picks up events from the event1 ('mouse') device, and none from the event4 ('kbd') device. A restart of the kindlelazy binary in kterm fixes that. Is there a way to detect 'wake' events and reopen the input devices ? Or should the udev rules posted earlier fix this as well ?
|
![]() |
![]() |
![]() |
#266 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 35
Karma: 10232
Join Date: Nov 2010
Device: G090G1 5.9.7 G090G1 5.10.2
|
Quote:
The udev rules and scripts I posted should make it so you never have to press start or stop button for any reason, at least that's how mine has been working so far. I'd be gratified if someone else would test it out though before I claim it really works all the time ![]() |
|
![]() |
![]() |
![]() |
#267 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
|
Thanks NiLuJe, and eruditionastic.
I should be getting a dev setup soon ![]() Then I can compile the PW4 kernel modules for things like mouse etc, and get someone to test if it works! |
![]() |
![]() |
![]() |
#268 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Slight caveat for kernel-related work: unless you intend to rebuild and flash a custom kernel, if you want to build modules for a production kernel, you'll have to dig up the relevant *identical* TC that Amazon used, not mine
![]() |
![]() |
![]() |
![]() |
#269 | |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Mar 2019
Device: Kindle PW3
|
Thank you zxczxc and eruditionastic!
I just picked up a used PW3 today to try and run KindleLazy. I also got the same remote that zxczxc is using. I have FW 5.9.6.1 and after installing KL - I could adjust the screen brightness with the volume buttons on the remote, but the other buttons didn't do anything. I then saw eruditionastic's update with the new kindlelazy download and it started working - woohoo! Page turns worked perfectly. I started trying out different settings and after running the 'Screen Upside Down' setting - the page turns no longer worked. Instead, both buttons now brought up the menu (same result as tapping the top of the kindle). I went back to the normal screen settings and the remote buttons still brought up the menu. I turned on and off the kindle, deleted the plugin, re-installed the plugin - still nothing. Eventually, I re-installed KUAL, along with a fresh install of KL and eruditionastic's update and got the buttons working again. Sweet! I'm totally happy with this but if anybody has an idea why changing the screen settings would cause the remote to stop working, I'd be curious to see if there's a simple fix. Also - would be awesome to have KL automatically start when the wireless presenter is plugged in but I'm a little lost with the first part of the instructions. Can you clarify what the OS partition is that you're talking about or let me know what I can search for to understand what it's involved? Thanks! Quote:
|
|
![]() |
![]() |
![]() |
#270 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
What you don't need to know:
Partition 1 (first) is the OS partition for the "Main" system (your Kindle is dual-boot). Other questions: If you have access to the command line (ssh, telnet, kterm), then the complete filename and the full pathname where each file belongs is shown in the quote you made. Just 'cd' (change directory) to the full pathname, place listed file(s) there. |
![]() |
![]() |
![]() |
Tags |
remote, remote control |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Aura HD Brightness control too bright | cefarix | Kobo Reader | 7 | 05-04-2014 02:28 PM |
Advanced Automatic Brightness and Wifi Control | hieronymos | Kobo Tablets | 2 | 12-02-2011 09:51 AM |
hardware backlight control for brightness? | bells | Apple Devices | 3 | 10-26-2011 11:39 AM |
remote control? | shawn | Sony Reader | 2 | 10-10-2007 12:02 PM |
Remote Control | ecm | Which one should I buy? | 5 | 03-20-2007 12:08 AM |