View Single Post
Old 08-17-2014, 10:58 PM   #1
ottdmk
Wizard
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: 1,221
Karma: 3804496
Join Date: Feb 2012
Location: Ottawa, Ontario, Canada
Device: Kobo Libra 2, Lenovo Tab M10 FHD Plus, Lenovo Tab M9
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