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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-17-2014, 10:58 PM   #1
ottdmk
Guru
ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.
 
Posts: 785
Karma: 3040502
Join Date: Feb 2012
Location: Ottawa, Ontario, Canada
Device: Kobo Aura H2O, Blackberry Playbook, Lenovo Tab 2 A10-70
Connecting a Kobo Aura HD in FreeBSD

Hi,

Just wanted to share my findings on trying to get Calibre fulling working on my FreeBSD 10.0-RELEASE amd64 box. My trusty Kobo Aura HD just would not attach automatically. Mounting it to a directory and doing things that way is suboptimal, as I would like to use the Kobo Extended plugin.

First, I tried all of Koyal's suggestions. Unfortunately that didn't get me very far. So I dusted off my rusty programming skills and set about trying to track down the problem. (Never programmed in Python, so that added a bit to my confusion.)

Running calibre in a terminal gave me the following error message: (forgive me, the line numbers are off due to the debugging statements I've added.):
Code:
Unable to open device <calibre_plugins.kobotouch_extended.device.driver.KOBOTOUCHEXTENDED object at 0x822273510>
Traceback (most recent call last):
  File "/usr/local/lib/calibre/calibre/gui2/device.py", line 194, in do_connect
    dev.open(detected_device, self.current_library_uuid)
  File "/usr/local/lib/calibre/calibre/devices/usbms/device.py", line 891, in open
    self.open_freebsd()
  File "/usr/local/lib/calibre/calibre/devices/usbms/device.py", line 831, in open_freebsd
    raise DeviceError(_('Unable to mount the device'))
DeviceError: Unable to mount the device
Messing around, I discovered that line 718 (fresh downloaded 1.48 file) in open_freebsd (devices/usbms/device.py) was doing this:
Code:
paths = manager.FindDeviceStringMatch('usb.serial',d.serial)
which, for my box, returned:
Code:
/org/freedesktop/Hal/devices/usb_device_2237_4193_N204B42111283_if0
Now, the problem shows up later. Line 728 is written thus:
Code:
dpaths = manager.FindDeviceStringMatch('storage.originating_device', path)
The problem is that no device has
Code:
/org/freedesktop/Hal/devices/usb_device_2237_4193_N204B42111283_if0
as its storage.originating_device entry. Instead, they have
Code:
/org/freedesktop/Hal/devices/usb_device_2237_4193_N204B42111283_if0_scsi_host
, which is a child of the first one.

Now, to get around this, I've used an ugly hack of inserting this code just above line 728:
Code:
mypaths = manager.FindDeviceStringMatch('info.parent', path)
                    mypath = mypaths[0]
. This finds the if0_scsi_host entry, which allows the rest of the code to work properly.

I'm hoping someone who's more experienced with Python and its interactions with DBUS & HAL might be able to help get this into a proper patch.
ottdmk is offline   Reply With Quote
Advert
Old 08-17-2014, 11:10 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: 31,135
Karma: 7777777
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I have no experience with HAL, which as I recall is an awful mess, but from what you describe, simply doing

dpaths = manager.FindDeviceStringMatch('storage.originating _device', path) + manager.FindDeviceStringMatch('info.parent', path)

should do the trick.
kovidgoyal is offline   Reply With Quote
Old 08-17-2014, 11:33 PM   #3
ottdmk
Guru
ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.ottdmk ought to be getting tired of karma fortunes by now.
 
Posts: 785
Karma: 3040502
Join Date: Feb 2012
Location: Ottawa, Ontario, Canada
Device: Kobo Aura H2O, Blackberry Playbook, Lenovo Tab 2 A10-70
Well, I forgot one important thing: I changed the dpaths= line (line 728) to take the new mypath variable. The manager.FindDeviceStringMatch('storage.originating _device' call needs the value that my manager.FindDeviceStringMatch('info.parent' call finds, and without it the rest of the code fails.
ottdmk is offline   Reply With Quote
Old 08-17-2014, 11:35 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: 31,135
Karma: 7777777
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes,but doing this

dpaths = manager.FindDeviceStringMatch('storage.originating _device', path) + manager.FindDeviceStringMatch('info.parent', path)

means that dpaths will now include both matches on originating_device and matches on info.parent, so if no matches are found for originating_device, info_parent will be used.
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Touch Connecting an external keyboard to Kobo Touch/Aura robaire Kobo Reader 12 05-03-2017 07:02 PM
Aura HD Kobo Glo/Aura/Aura HD future firmware feature request thread arspr Kobo Reader 25 03-26-2015 05:19 AM
Dymo tape fix for eBay Kobo Aura and Aura HD covers RobertJSawyer Kobo Reader 2 02-10-2014 10:34 AM
Problem connecting Kobo Aura HD to Internet ktkat1949 Kobo Reader 19 01-17-2014 10:50 AM
Canadian shoppers discount on kobo aura and aura hd eejit Deals, Freebies, and Resources (No Self-Promotion) 4 11-28-2013 01:43 AM


All times are GMT -4. The time now is 07:26 PM.


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