Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 12-20-2009, 11:53 AM   #1
jjje555
Member
jjje555 began at the beginning.
 
jjje555's Avatar
 
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
jjje555 is offline   Reply With Quote
Old 12-20-2009, 12:20 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-20-2009, 12:32 PM   #3
jjje555
Member
jjje555 began at the beginning.
 
jjje555's Avatar
 
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
Attached Files
File Type: zip boox.zip (160 Bytes, 682 views)
jjje555 is offline   Reply With Quote
Old 12-20-2009, 12:36 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Your zip file doesn;t contain any actual files in it, just an empty directory
kovidgoyal is offline   Reply With Quote
Old 12-20-2009, 12:42 PM   #5
jjje555
Member
jjje555 began at the beginning.
 
jjje555's Avatar
 
Posts: 10
Karma: 10
Join Date: Dec 2009
Device: BOOX
Sorry for the inconvenient. Compressed again and uploaded it.

Thanks in advance.
Attached Files
File Type: zip boox.zip (2.8 KB, 700 views)
jjje555 is offline   Reply With Quote
Advert
Old 12-20-2009, 01:08 PM   #6
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
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.
user_none is offline   Reply With Quote
Old 12-20-2009, 01:24 PM   #7
jjje555
Member
jjje555 began at the beginning.
 
jjje555's Avatar
 
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
jjje555 is offline   Reply With Quote
Old 12-20-2009, 01:34 PM   #8
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
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
This will output all usb devices connected to your computer. The form for connected devices on Linux is (vendor_id, product_id, bcd, vendor_string, product_string)

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)"
Where 123 is replaced by the number you want to convert.
user_none is offline   Reply With Quote
Old 12-20-2009, 01:46 PM   #9
jjje555
Member
jjje555 began at the beginning.
 
jjje555's Avatar
 
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
jjje555 is offline   Reply With Quote
Old 12-20-2009, 02:01 PM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
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
kovidgoyal is offline   Reply With Quote
Old 12-20-2009, 02:52 PM   #11
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by jjje555 View Post
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.
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.
user_none is offline   Reply With Quote
Old 12-21-2009, 03:10 PM   #12
jjje555
Member
jjje555 began at the beginning.
 
jjje555's Avatar
 
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
Attached Files
File Type: zip boox.zip (1.1 KB, 617 views)
jjje555 is offline   Reply With Quote
Old 12-21-2009, 04:17 PM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Thanks, will be in next release.
kovidgoyal is offline   Reply With Quote
Reply

Tags
boox, calibre, plugin

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 02:26 AM.


MobileRead.com is a privately owned, operated and funded community.