Hi,
I am working on a tool to automatically download content on the Kobo reader (I'm targeting the Glo HD because that's what I have, but it should work on other platforms as well). The tool is called
Wallabako synchronizes wallabag entries into the kobo and generally works well.
The problem I have now is that the Kobo reader doesn't notice when new books are added. I have found a few different ways to work around the issue, but everything I found requires the user to tap the screen. For example, the
Kobo-Mini-Wireless-Sync update.sh script does the following:
Code:
#!/bin/sh
echo usb plug add >>/tmp/nickel-hardware-status # Simulate plugging in the usb
sleep 12 # Wait 12 sec for user to hit connect, and for any processes to run
echo usb plug remove >>/tmp/nickel-hardware-status # Simulate the disconnect of our simulated usb, takes a few sec after the sleep for the change to show up on the device
# When the kobo detects USB connection, it seems to disable wifi, so only run the update after you are finished with uploading/downloading data
So basically, pretend something is plugged in, wait for the user to tap "Connect", then pretend-remove it. This works, but requires someone to tap the screen. If no one else is there, it won't work.
Other sites, for example
this tutorial say that only the last line is necessary... It even suggests using /usr/local/Kobo/udev/usb with which i basically wiped the library (connecting through USB fixed that issue though).
There's also the
refresh_library.sh trick from kobo-wget-sync that is basically to have a "virtual SD card", open and close it and notify Nickel that it's plugged in:
Code:
echo sd add /dev/mmcblk1p1 >> /tmp/nickel-hardware-status
The above command does nothing here. I also tried /dev/mmcblk1p3, the actual device that is on /mnt/onboard, but I suspect I am missing a key component of how the script works.
Finally, there's the
Hacking SD card file system discussion which mentions all sorts of hacks on the sdcard, but it would require more research to see how we could use this as well.
I have also tried just calling the reboot command, but that doesn't trigger a refresh either.
Other solutions that were suggested in this thread:
- Write directly to the Kobo SQLite database: considered out of scope and too risky - the format can change under us and we don't want to reimplement the builtin scanner
- Simulate taps: would need to take a screenshot to figure out where the button is (yes, not always at the same spot!) and then figure out how to send taps to the input devices, see this discussion for more information
- Use the web browser: already suggested by the Chabotsi tutorial, takes over the web browser and downloads only one book at a time, not a solution...
So. What's the proper, simple way to trigger a refresh programmatically, without restarting the kobo and without user intervention?
Thanks!