View Single Post
Old 02-27-2019, 05:51 AM   #261
eruditionastic
Enthusiast
eruditionastic knows the difference between 'who' and 'whom'eruditionastic knows the difference between 'who' and 'whom'eruditionastic knows the difference between 'who' and 'whom'eruditionastic knows the difference between 'who' and 'whom'eruditionastic knows the difference between 'who' and 'whom'eruditionastic knows the difference between 'who' and 'whom'eruditionastic knows the difference between 'who' and 'whom'eruditionastic knows the difference between 'who' and 'whom'eruditionastic knows the difference between 'who' and 'whom'eruditionastic knows the difference between 'who' and 'whom'eruditionastic knows the difference between 'who' and 'whom'
 
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)
We're interested in this part - "/devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.2"

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
You'll get a looong list of stuff, but we're only interested in the first two paragraphs. For the presenter I have, it looks like this:

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"
Note the values in the first paragraph for KERNEL=="1-1:1.2" and SUBSYSTEM=="usb", and ATTRS{idProduct}=="0189" in the second paragraph. Take the values in the quotes and replace the ones in the two .rules files with yours. You'll probably only need to replace the idProduct value, at least on a Paperwhite 3 2015 Wifi only.

Now run

Code:
udevadm test /devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.2
And you will see if your rules are recognizing your device or not. You should see lots of text and two lines similar to the following if it is successful

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'
Thanks for the various helps and to the author. My girlfriend finally has her Valentine's day present.
Attached Files
File Type: zip KindleLazyStartOnPlugin.zip (2.0 KB, 673 views)

Last edited by eruditionastic; 02-28-2019 at 08:12 AM.
eruditionastic is offline   Reply With Quote