-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto start KindleLazy #7
Comments
Nice idea, I never thought about this. Maybe because I (like most people) rarely reboot their kindle so it's not a big problem to start KindleLazy after each reboot. Maybe the /dev/input/event2 device simply isn't ready at that time KindleLazy is started? That's all I can assume from the error message. I guess it's possible to do a little investigation using the script.sh file, for example seeing if you can see if the event2 device is readable/exists at that time. |
Ok I'll post there. I do think it's a timing issue and some things just are not loaded yet, and udev is sensitive about how long a script runs so I can't wait forever. One workaround is to use the "at" command to hand off script execution from udev, but that command doesn't seem to be present on the kindle. I downloaded some other arm linux distros and couldn't find "at", either. So you said you only start kindlelazy after a reboot....whenever my kindle goes to sleep and I wake it up, I have to restart kindlelazy. Does yours stay functional as long as you don't restart it? After it sleeps and I wake it up, everything is working technically. modules are there, events get keycodes, and kindlelazy process is present, but it won't turn the page until I go start it again. That's what I was trying to avoid with this. |
Ok, I got it to work! See mobileread thread for the info if you're interested. Any interest in adding the changes here? Not sure how that works since you files have to be placed outside of /mnt/us and can't just be dropped in /mnt/us/extensions. The trick for XOpenDisplay to work under udev context was to export a display variable. Also I had to start one script, then hand off to "start.sh &" for some reason. I don't know why. Other main changes were adding some timing, and using kill -9 instead of killall. Killall wouldn't terminate process started under the udev context. |
Cool that you got some progress. EDIT -- Ah, my mistake. The clue is in the word udev rules, so this runs when you plug the presenter in, fantastic!! My kindle works exactly the same as your regarding KindleLazy, it needs to be started/restarted every once in a while etc. I haven't used it in a while to be honest so I forget the exact way to use it! |
yeah so far with my testing, it loads and unloads itself under every scenario properly - definitely not for just at bootup. It loads and unloads upon wake, sleep, plug in, unplug. I have not had to manually start it once for any reason yet. |
For anyone interested, the final script written by OP is here: https://www.mobileread.com/forums/showpost.php?p=3815253&postcount=261 |
Ok one more thing :) I've been trying to get KindleLazy to autostart, but it wont' start when calling start.sh from udev. It works fine if I run start.sh on the command line. It works fine if I run it from a different script. I've added some logging stuff to try and troubleshoot. Here is my start.sh at this point.
It works just fine using [root@kindle bin]# ./start.sh - I get this output:
When I call start.sh from a udev rule, I get this:
My udev rule is this, and it works fine and calls the script every time.
I tried putting a 2nd script in the KindleLazy directory that then calls bin/start.sh, because it looks like that's how the UI calls it, but that didn't help either. Calling the exact same full path to the script /mnt/us/extensions/KindleLazy/bin/start.sh also works, as long as it's command line.
The modules are all loaded.
The character devices are all there and they work.
The only difference I can find is that $USER is root at all times except when i'm calling start.sh from udev and then get the ERROR opening evdev2 device. I'm at a loss :/
The text was updated successfully, but these errors were encountered: