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 10-28-2011, 10:10 AM   #1
myudkowsky
Enthusiast
myudkowsky began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
Device Mounted as MTP file system does not allow writing to folders

I have an Asus Transformer, which uses the MTP protocol. Although it might be possible in theory to connect it as an ordinary USB device, I mount this on my computer to create an accessible folder called /media/mtp.

I created /media/mtp/Books to act as the repository for my calibre library. I used the "connect to folder" option to transfer books.

This transfer consistently fails. The error report is:

Quote:
calibre, version 0.8.24
ERROR: Error: Error communicating with device

[Errno 38] Function not implemented: u'/media/mtp/Books/.metadata.calibre'

Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 81, in run
File "site-packages/calibre/gui2/device.py", line 354, in _sync_booklists
File "site-packages/calibre/devices/usbms/driver.py", line 383, in sync_booklists
File "site-packages/calibre/devices/usbms/driver.py", line 381, in write_prefix
IOError: [Errno 38] Function not implemented: u'/media/mtp/Books/.metadata.calibre'
The contents of .driveinfo.clalibre make sense, namely a hash or JSON:
Quote:
{"device_store_uuid": "09d163b0-a733-4bd6-a266-8ec18442e2e0", "prefix": "/media/mtp/Books/", "device_name": "Folder Device", "calibre_version": "0.8.24", "location_code": "main", "last_library_uuid": "4b0acef2-8fee-4003-a47b-2c0243d1c048", "date_last_connected": "2011-10-28T13:37:34.989924+00:00"}
The contents of .metaata.calibre are simple "[]", an empty array.

After this erorr, books are on the device but Calibre fails to recognize them. When I attempt re-connect to the device, I get a similar error:
Quote:
Underlying error: [Errno 38] Function not implemented: u'/media/mtp/Books/.driveinfo.calibre'

Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 81, in run
File "site-packages/calibre/gui2/device.py", line 312, in _get_device_information
File "site-packages/calibre/devices/usbms/driver.py", line 106, in get_device_information
IOError: Failed to access files in the main memory of your device. You should contact the device manufacturer for support. Common fixes are: try a different USB cable/USB port on your computer. If you device has a "Reset to factory defaults" type of setting somewhere, use it. Underlying error: [Errno 38] Function not implemented: u'/media/mtp/Books/.driveinfo.calibre'
My guess is that these files can't be re-written by calibre. According to the filesystem, these files are set to rwx for everyone, not just the user (an apparent quirk of the mtp library).

The work-around would be to either figure out how to make the device appear as a USB device, or to create a local "shadow" folder that shadows the device's books folder and sync that shadow folder to the device.

However, perhaps there's some setting, tweak, or bug that causes this problem. Any suggestions?
myudkowsky is offline   Reply With Quote
Old 10-28-2011, 10:30 AM   #2
myudkowsky
Enthusiast
myudkowsky began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
I should also mention that I cannot get the user defined USB device to recognize the MTP device.

I used the Preferences' tool to detect the USB driver information that is present by the device when it is plugged in. Regardless, the user defined USB device expects a block-style interface, and MTP is not a block device.

So -- even if on Linux you see a USB interface to your MTP device, that just means the device is present. It does not mean that you're able to use it to connect to your MTP device.
myudkowsky is offline   Reply With Quote
 
Enthusiast
Old 10-28-2011, 10:30 AM   #3
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: 25,622
Karma: 4998489
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That calls that are failing are standard calls to open files in write mode, without those working there's no way calibre will work with the folder.
kovidgoyal is offline   Reply With Quote
Old 10-28-2011, 10:43 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: 25,622
Karma: 4998489
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you really want to use a MTP based device with calibre, the correct way is to write a calibre device driver based on libopenmtp. This is something that has been on my TODO list for a long time, but then so have about 300 hundred other things
kovidgoyal is offline   Reply With Quote
Old 10-29-2011, 01:19 AM   #5
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,800
Karma: 12528001
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by myudkowsky View Post
I should also mention that I cannot get the user defined USB device to recognize the MTP device.
You have a few alternative methods for getting books to your device. Something like the Dropbox app and keep your library in dropbox. Calibre content server and grab your books via wireless. Other form of cloud storage where you can export your books to.
DoctorOhh is offline   Reply With Quote
Old 11-21-2011, 09:53 PM   #6
myudkowsky
Enthusiast
myudkowsky began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
Oddly enough, a search for my current problem brought me back here.

1. Just for the record, I thought I'd try to use Calibre to create a local folder, and then sync or copy that folder over to the tablet computer.

This fails with the MTP file system -none of the epubs show up. I suspect, from cryptic comments in the file system man page, that the epub file extension is not recognized during copy and therefore never appears correctly on the MTP device. PNG files do appear as expected, by way of contrast.

2. My thanks to everyone for responding -- I also thought about the MTP library, given that more and more tablets use MTP, but I too don't have time for it at the moment.

I guess I'll need to Dropbox, set up a local server, etc, or possibly just use old-fashioned "sneakernet" in the meantime.
myudkowsky is offline   Reply With Quote
Old 11-21-2011, 10:10 PM   #7
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,979
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3 and Fire
Quote:
Originally Posted by myudkowsky View Post
I also thought about the MTP library, given that more and more tablets use MTP, but I too don't have time for it at the moment.
See Impromptu Q&A Session With Android Engineer Dan Morrill Brings To Light Reasons Behind Galaxy Nexus' Lack Of USB Mass Storage for an interesting discussion that suggests that more and more Android devices will be MTP-only.
wallcraft is offline   Reply With Quote
Old 11-21-2011, 10:40 PM   #8
myudkowsky
Enthusiast
myudkowsky began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
MTP File system does not support normal directory creation

I think I've stumble across the problem with MTP filesystems mounted via mtpfs. The ordinary directory ("folder") creation does not work as expected.

"cp -r ~/foo/calibre/* /media/mtp/calibre", which attempts transfer the calibre library below "foo" to the mtpfs-mounted Asus device, fails. The files seem to have been copies, and you can even umount and mount to see them again in the Linux filesystem; but after umount they are not in the Asus system in any place that I can find. I suspect something very off in the directory metadata.

But if I copy only the files and not the directory structure, the files copy normally and can be seen on the device itself. I suspect this is the correct solution, or possibly a solution that separately copies the directory structure and the files.
myudkowsky is offline   Reply With Quote
Old 11-21-2011, 10:46 PM   #9
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: 25,622
Karma: 4998489
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
MTP, like most everything that comes out of Microsoft is an utter and complete disaster. Just read the README from the libmtp project (particularly the sections on dual mode devices and It's not our bug): http://libmtp.git.sourceforge.net/gi...README;hb=HEAD

It will tell you that among other problems, MTP devices dont really support folders. I despair of ever making something user friendly out of this mess.
kovidgoyal is offline   Reply With Quote
Reply

Tags
asus tablet, mtp filesystem

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Testers Wanted: Cherokee has its own writing system with a different unicode range .. Waya ePub 1 10-22-2011 05:05 AM
Mounted Device Conflicts with Toolbar Settings LaneLester Calibre 4 08-11-2011 04:42 PM
folders' structure in the device Brandobras Calibre 13 09-11-2010 02:15 PM
Conflict between Calibre and mounted TrueCrypt device volume acidzebra Calibre 4 08-13-2009 03:11 PM
how to clean more disk space in root file system to upgrade system chinaet iRex 1 12-18-2006 03:54 PM


All times are GMT -4. The time now is 06:14 PM.


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