12-20-2009, 11:53 AM | #1 |
Member
Posts: 10
Karma: 10
Join Date: Dec 2009
Device: BOOX
|
Plugin for BOOX reader
Hi all:
I've just bought a new brand Boox reader and it's not supported by Calibre. Anyway, reviewing the source code and the faq, it's seems it's quite easy to develop a new one, and in fact, I've coded a new one. But, is there some way to start to use a custom device plugin with the last Calibre version? or have I to wait for a new release to include it? Is there some develop in curse to support Boox readers ? Thanks |
12-20-2009, 12:20 PM | #2 |
creator of calibre
Posts: 44,353
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
http://calibre-ebook.com/user_manual/customize.html
Device drivers are also plugins, so the procedure is similar. |
Advert | |
|
12-20-2009, 12:32 PM | #3 |
Member
Posts: 10
Karma: 10
Join Date: Dec 2009
Device: BOOX
|
Thanks again Kovid. As I said in the other thread I read the manual. In fact, I coded a plugin, hacking the bebook plugin (so no python knowledge, only find/replace, change the product/vendors Ids and so on). I attatch the plugin.
But when I try to adding it to Calibre I get this error: Traceback (most recent call last): File "/tmp/init.py", line 48, in <module> File "/home/kovid/build/calibre/src/calibre/customize/ui.py", line 431, in main File "/home/kovid/build/calibre/src/calibre/customize/ui.py", line 266, in add_plugin File "/home/kovid/build/calibre/src/calibre/customize/ui.py", line 76, in load_plugin calibre.customize.ui.InvalidPlugin: No se ha encontrado ningún complemento válido en boox.zip Sorry for last line in spanish. Translated: No valid plugins found in boox.zip Bye |
12-20-2009, 12:36 PM | #4 |
creator of calibre
Posts: 44,353
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Your zip file doesn;t contain any actual files in it, just an empty directory
|
12-20-2009, 12:42 PM | #5 |
Member
Posts: 10
Karma: 10
Join Date: Dec 2009
Device: BOOX
|
Sorry for the inconvenient. Compressed again and uploaded it.
Thanks in advance. |
Advert | |
|
12-20-2009, 01:08 PM | #6 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
From the driver in the zip file it looks like the BOOX is a Hanlin reader because that file is almost identical to the BeBook driver. If this is the case it would be better to just make a subclass of the BeBook driver for the BOOX.
One issue I see right away in the BOOX driver is the BCD is incorrect. The BCD cannot be a decimal. Run calibre-debug -d to get the value of the BCD. If you are on Windows take the value and put 0x before it. If you are on Linux you will need to take the value and convert it to hex first. |
12-20-2009, 01:24 PM | #7 |
Member
Posts: 10
Karma: 10
Join Date: Dec 2009
Device: BOOX
|
Thanks user_none. You're right, BCD code in no hex format seems to be wrong but I wrote it in that way because it's what I see when run "lsusb -v" (in linux):
Bus 001 Device 009: ID 0525:a4a5 Netchip Technology, Inc. Linux-USB File Storage Gadget Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x0525 Netchip Technology, Inc. idProduct 0xa4a5 Linux-USB File Storage Gadget bcdDevice 3.22 iManufacturer 1 Linux 2.6.26-466-ga04670e with fsl-usb2-udc iProduct 2 File-backed Storage Gadget iSerial 3 372041756775 bNumConfigurations 1 I don't know how Calibre manage to identify devices, but if it try to find text strings and compare them with the coded in the plugin... well, maybe it could work... Thanks, bye |
12-20-2009, 01:34 PM | #8 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
You don't want to use the ouptput of lsusb because it will convert certain values to make them easier to read. Use the calibre-debug with the -d option.
Code:
$ calibre-debug -d The vendor_id, product_id and bcd are all in decimal so you will want to convert them to hex for use in the plugin. Decimal will work but hex is preferred for consistency. You can easily convert decimal to binary by doing: Code:
$ python -c "print hex(123)" |
12-20-2009, 01:46 PM | #9 |
Member
Posts: 10
Karma: 10
Join Date: Dec 2009
Device: BOOX
|
Using "calibre-debug -d" I get the same code I tried before: 0x322. I get the same error when I try to import. So, it's not a problem with ids or hex/no hex. It's a problem related to structure/syntax of the plugin file. "calibre-customize" is not able to deal with it.... I'm missing.
Thanks anyway. Bye |
12-20-2009, 02:01 PM | #10 |
creator of calibre
Posts: 44,353
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Note that as of 0.6.29 calibre-debug -d should be outputting hex ids anyway
|
12-20-2009, 02:52 PM | #11 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Sorry for not being clear. I was pointing out an error that would have been an issue you would have run into later with the BCD being a decimal.
|
12-21-2009, 03:10 PM | #12 |
Member
Posts: 10
Karma: 10
Join Date: Dec 2009
Device: BOOX
|
Finally I managed to fix the error when adding the plugin. The error was in the first line:
# -*- coding: utf-8 -*- For some reason, this line appears in the plugins packed with Calibre, but it's not recognized when adding with "calibre-customize". Well, saving the file in utf-8 and adding the plugin works!. I attach my custom Boox reader plugin in this message. I hope it's useful for other users. Thanks for your patience and help, kovid and user_none. Best regards, Jes |
12-21-2009, 04:17 PM | #13 |
creator of calibre
Posts: 44,353
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Thanks, will be in next release.
|
Tags |
boox, calibre, plugin |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 12:11 PM |
EPD Onyx Boox 60 Ebook Reader | Dvalin21 | Onyx Boox | 5 | 03-24-2010 08:41 AM |
BOOX ebook reader by Onyx International | Nate the great | News | 85 | 01-05-2010 11:03 AM |
Microsoft Reader plugin "Read in" for Word doesn't load anymore | K-Thom | Reading and Management | 15 | 04-17-2009 05:52 AM |
BOOX ebook reader UPDATE: new information & Youtube Video | Nate the great | News | 86 | 03-09-2009 02:20 PM |