|  01-30-2017, 03:59 PM | #1 | 
| Connoisseur   Posts: 83 Karma: 192 Join Date: Jul 2013 Location: Planet Ocean Device: Kobo Glo HD, Onyx Boox Note Pro 2, Samsung Galaxy Tab S5e, Pixel 4a | 
				
				Triggering a library refresh automatically
			 
			
			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 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 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: 
 So. What's the proper, simple way to trigger a refresh programmatically, without restarting the kobo and without user intervention? Thanks! Last edited by anarcat; 01-31-2017 at 10:42 AM. Reason: integrate ideas from the thread | 
|   |   | 
|  01-31-2017, 12:35 AM | #2 | 
| Groupie            Posts: 172 Karma: 4282 Join Date: Dec 2016 Location: Hungary Device: Kobo Aura H2O | 
			
			Currently, as far as I know, the only way for nickel to add new books is to connect to usb, safely disconnect, then nickel processes the content. Or maybe you have to "hack" the Kobo database, which has the potential risk of corrupting it and loosing your library. I'm also working on a project that can send content (books) to the Kobo over wifi, I'm trying to hack the built-in Sync and the Bookstore, but that also requires the user to interact with Kobo to get the content. Which is not really bad I think.
		 | 
|   |   | 
|  01-31-2017, 12:38 AM | #3 | 
| Grand Sorcerer            Posts: 24,905 Karma: 47303824 Join Date: Jul 2011 Location: Sydney, Australia Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos | 
			
			You can download a book using the browser. This will add the book to the database.
		 | 
|   |   | 
|  01-31-2017, 06:26 AM | #4 | 
| Linux User            Posts: 2,282 Karma: 6123806 Join Date: Sep 2010 Location: Heidelberg, Germany Device: none | 
			
			You can simulate the tap too, only problem is, the button appears at different coordinate for every device so you have to provide a config file where users can set the coordinate that works unless you want to somehow detect it by looking at the frame buffer itself (I attempted such a thing in my screensaver mod with scanline but it's not a great solution). Or you could let the user tap the first time and then just replay the same tap in the future, that would work until a firmware update slightly moves the dialog. Then you still have to deal with this popup appearing only after some unknown delay... It would be nice to find a simpler way, but I don't know of one. I think even the browser just runs an update for the specific book and not search for other ones. | 
|   |   | 
|  01-31-2017, 09:29 AM | #5 | ||||
| Connoisseur   Posts: 83 Karma: 192 Join Date: Jul 2013 Location: Planet Ocean Device: Kobo Glo HD, Onyx Boox Note Pro 2, Samsung Galaxy Tab S5e, Pixel 4a | 
				
				responses
			 Quote: 
 Quote: 
 Quote: 
  Quote: 
  So far I'm using the "wait for tap" approach. It's not so bad, because the process is actually interactive: the user needs to cycle the Wifi connection to trigger the sync anyways, so it's expected that *something* will show up.. Keep the suggestions coming, I'll update the OP with changes... | ||||
|   |   | 
|  01-31-2017, 09:57 AM | #6 | 
| Connoisseur   Posts: 83 Karma: 192 Join Date: Jul 2013 Location: Planet Ocean Device: Kobo Glo HD, Onyx Boox Note Pro 2, Samsung Galaxy Tab S5e, Pixel 4a | 
			
			note: i ended up making a new thread about wallabako, but the conversation about triggering syncs should of course continue here. thanks!
		 | 
|   |   | 
|  01-31-2017, 10:00 AM | #7 | 
| Wizard            Posts: 4,466 Karma: 6900052 Join Date: Dec 2009 Location: The Heart of Texas Device: Boox Note2, AuraHD, PDA, | 
			
			"Tshering" used to have a fmon script to simulate a USB connection and disconnect, that would make for a scan, to update the DB.  You could check out how he did it for KSM. Luck; Ken | 
|   |   | 
|  01-31-2017, 10:04 AM | #8 | |
| Linux User            Posts: 2,282 Karma: 6123806 Join Date: Sep 2010 Location: Heidelberg, Germany Device: none | Quote: 
 | |
|   |   | 
|  01-31-2017, 10:43 AM | #9 | 
| Connoisseur   Posts: 83 Karma: 192 Join Date: Jul 2013 Location: Planet Ocean Device: Kobo Glo HD, Onyx Boox Note Pro 2, Samsung Galaxy Tab S5e, Pixel 4a | |
|   |   | 
|  01-31-2017, 10:53 AM | #10 | 
| Groupie            Posts: 172 Karma: 4282 Join Date: Dec 2016 Location: Hungary Device: Kobo Aura H2O | 
			
			yes, it does
		 | 
|   |   | 
|  01-31-2017, 11:06 AM | #11 | |
| Wizard            Posts: 3,489 Karma: 2914715 Join Date: Jun 2012 Device: kobo touch | Quote: 
 I remember faintly that I have seen another approach some years ago somewhere at this forum. I cannot remember the details, but it was about creating a virtual sd and downloading the books to this. If you mount the virtual sd nickel reads its contents and updates its library. | |
|   |   | 
|  01-31-2017, 11:17 AM | #12 | |
| Connoisseur   Posts: 83 Karma: 192 Join Date: Jul 2013 Location: Planet Ocean Device: Kobo Glo HD, Onyx Boox Note Pro 2, Samsung Galaxy Tab S5e, Pixel 4a | Quote: 
   | |
|   |   | 
|  01-31-2017, 12:19 PM | #13 | 
| Linux User            Posts: 2,282 Karma: 6123806 Join Date: Sep 2010 Location: Heidelberg, Germany Device: none | 
			
			if you use the virtual sd you are stuck with it though. library entries for sd card are different from those in internal memory. Of course I guess you could work with the database from there and remove the sdcard binding but... from my experience with autoshelf, nickel caches a lot of data and thus does not see the database changes until reboot. it's only, again, actual usb connection when it re-reads the database and thus my autoshelf mod also requires one additional connect-to-pc step :-/ Someone bribe a Kobo developer, give us an API for things   | 
|   |   | 
|  01-31-2017, 01:16 PM | #14 | 
| Groupie            Posts: 172 Karma: 4282 Join Date: Dec 2016 Location: Hungary Device: Kobo Aura H2O | |
|   |   | 
|  | 
| Tags | 
| filesystem, hack, reload, sdcard | 
| Thread Tools | Search this Thread | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Refresh library | MrX | Calibre | 11 | 06-07-2016 04:45 PM | 
| Is it no possible to refresh the page automatically in Moon+ Reader? | cicabum | Android Devices | 4 | 10-22-2015 12:23 PM | 
| Library refresh after editing metadata | kelleybean | Library Management | 2 | 01-13-2015 09:10 AM | 
| Refresh library view? | Pepin33 | Development | 4 | 08-31-2012 05:18 AM | 
| 7.40 - Automatically refresh the covers | edbro | Calibre | 0 | 01-14-2011 10:02 PM |