1. d2j2d was installed
2. Restart Kindle
3. On Kindle - "Create input for Calibre" to export the existing collections
4. Connect Kindle to computer
5. Imported into the Kindle Calibre Collections (Custom Column "Kindle")
- In the root directory of the Kindle was a file created called "kindle_collections_path_cache.calibre"

6. edit "Collections" in Calibre (Column "Kindle")
7. Export with "Create Colloections on the Kindle from Calibre"
8. Disconnect Kindle / Select "Import data from Calibre on the Kindle
9. I see the screen "Importing Content Catalog ...." forever but the device does not restart
10. I reboot the Kindle manually
11. The collections were not taken.

Is it because "Save template starts with: calibre," ???
What do you mean?

There is no readme in it, but I understand that the usbnetwork.sh (attached) should take care of the firewall, but does it start the ssh daemon?

I have read that one before...

As written, it opens port 22 for the network device wlan0 (usually the Wifi, unless renamed in a udev rule).

In fact, it adds that rule regardless of the action to be taken (adding or removing) the usb networking entry from the launcher menu; without checking if that iptables rule already exists.
Which can lead to multiple copies of the same firewall rule in iptables, one copy for each time this script was run. Not harmful, just a bit messy.

Whereas the usb networking would be network device usb0 (unless renamed somewhere in the device scripting - such as with the udev rules).

So once this script has been run (conditions set to add the usbnetworking to the lanucher menu)....

Then there should be an entry in your launcher menu to turn on (start the ssh daemon) and diddle the firewall rule in iptables for device usb0.

Check in your launcher menu for the usbnetworking menu entry, turn it on.

Notes:
If the "-i wlan0" argument to that iptables rule was removed, then port 22 would always be open in the firewall for any device rather than only the specified interface "-i" device.

Since the addition of the iptables rule is in both sides of the condition statement, then it could be outside of the condition statement.
And since it is never removed - made part of the package installation (complete with a check to see if another package has already added the rule or the general rule without the interface device specification).
Again, not harmful, just a bit messy to be diddling a rule for wlan0 in a script for installing access to the usb0 interface device.

I took some time away from this and now I am back. I have run the import process twice and still the books are not showing up in collections. The wheel is not turning, how do I know if it doing anything?

I've uploaded a verbose mode you can try. If it says "collection has no calibre content" on import, then you are not compliant with requirement #4.

I made this restriction so that collections not managed through Calibre are left untouched because the import script only loops through collections in the file produced by the plug-in.

1. d2j2d was installed
2. Restart Kindle
3. On Kindle - "Create input for Calibre" to export the existing collections
4. Connect Kindle to computer
5. Imported into the Kindle Calibre Collections (Custom Column "Kindle")
- In the root directory of the Kindle was a file created called "kindle_collections_path_cache.calibre"

6. edit "Collections" in Calibre (Column "Kindle")
7. Export with "Create Colloections on the Kindle from Calibre"
8. Disconnect Kindle / Select "Import data from Calibre on the Kindle
9. I see the screen "Importing Content Catalog ...." forever but the device does not restart
10. I reboot the Kindle manually
11. The collections were not taken.

Is it because "Save template starts with: calibre," ???
What do you mean?

I'm not sure if this is caused by this or the Kindle Collections plugin, but it won't delete empty collections. The plugin reports less collections, but they never disappear when I reboot the kindle. The only way to remove the collections is to do a factory reset which is a pain, to say the least.

For now, I'm going to stick to creating tags based on tags which is genre for most books and fandom for fanfiction.

I changed the import script to delete empty collections.

By the way, to delete an empty collection on the Kindle, touch the collection name until a menu pops up asking if you want to add/remove items or rename/delete the collection.

I've uploaded a verbose mode you can try. If it says "collection has no calibre content" on import, then you are not compliant with requirement #4.

I made this restriction so that collections not managed through Calibre are left untouched because the import script only loops through collections in the file produced by the plug-in.

Though Calibre creates the collections all right, I cannot import them into the Kindle. When I run the script json2db.sh -v* through SSH, I get :
...
process collection Utility
delete empty collection
process collection Food
collection has no calibre content
...
Then collections seem to be OK in the json file. The script yields no errors, but when I restart the Kindle, the collections are not imported. (The "Food" collection is the only one present in the Kindle before the script was run.)
BTW: I did Change "{author_sort}/{title} - {authors}" to "calibre/{author_sort}/{title} - {authors}" in the Calibre Preferences.

1) After you changed the template to begin with calibre/, did you re-sync with calibre and verify that the content is now in documents/calibre? You may have to delete/re-add your content so it ends up in the right place. The json file only contains UUID's for books and collections. The file locations are in the cc.db file on the Kindle. If calibre hasn't moved the files after you changed the template, then you'll get that error.

2) Towerle reported problems until he switched from the portable version of calibre to a normal version.

Quote:

Originally Posted by lsi

Though Calibre creates the collections all right, I cannot import them into the Kindle. When I run the script json2db.sh -v* through SSH, I get :
...
process collection Utility
delete empty collection
process collection Food
collection has no calibre content
...
Then collections seem to be OK in the json file. The script yields no errors, but when I restart the Kindle, the collections are not imported. (The "Food" collection is the only one present in the Kindle before the script was run.)
BTW: I did Change "{author_sort}/{title} - {authors}" to "calibre/{author_sort}/{title} - {authors}" in the Calibre Preferences.

1) After you changed the template to begin with calibre/, did you re-sync with calibre and verify that the content is now in documents/calibre? You may have to delete/re-add your content so it ends up in the right place.

I'm confused now.
When I buy a book from Amazon, it lands in the documents folder on the Kindle. I usually then copy it to the Calibre library on the PC as a backup and to organize the collections. If Calibre then sends it to the documents/calibre folder, I suppose I will end up with 2 copies on the Kindle: one original in documents and another one in documents/calibre?

I'm confused now.
When I buy a book from Amazon, it lands in the documents folder on the Kindle. I usually then copy it to the Calibre library on the PC as a backup and to organize the collections. If Calibre then sends it to the documents/calibre folder, I suppose I will end up with 2 copies on the Kindle: one original in documents and another one in documents/calibre?

True, unless you then delete the copy from your original purchase and keep the copy managed by calibre. I never considered it an issue because the first thing I do when I purchase a book from Amazon, Barnes & Noble, or (as of a few weeks ago) Apple is to strip out the DRM so that everything in my calibre library is DRM-free.

I'll have a think on it and see if I can come up with a solution that does not require #4 but still allows one to have collections and content not managed by calibre live in peace with that managed by calibre.

True, unless you then delete the copy from your original purchase and keep the copy managed by calibre. I never considered it an issue because the first thing I do when I purchase a book from Amazon, Barnes & Noble, or (as of a few weeks ago) Apple is to strip out the DRM so that everything in my calibre library is DRM-free.

I'll have a think on it and see if I can come up with a solution that does not require #4 but still allows one to have collections and content not managed by calibre live in peace with that managed by calibre.

OK, I understand it now.
I can live with this workflow, and I'll try to implement it...
Thanks for your support!