Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-09-2014, 12:52 AM   #1
mwfogleman
Junior Member
mwfogleman began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2013
Device: Kindle PaperWhite
Can't Access Kindle

When I try to connect my Linux machine (Arch) to my Kindle Paperwhite (1st Generation), I receive errors like this one:

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

'utf8' codec can't decode byte 0xf1 in position 19: invalid continuation byte

Traceback (most recent call last):
File "/usr/lib/calibre/calibre/gui2/device.py", line 86, in run
self.result = self.func(*self.args, **self.kwargs)
File "/usr/lib/calibre/calibre/gui2/device.py", line 490, in _books
mainlist = self.device.books(oncard=None, end_session=False)
File "/usr/lib/calibre/calibre/devices/kindle/driver.py", line 339, in books
bl = USBMS.books(self, oncard=oncard, end_session=end_session)
File "/usr/lib/calibre/calibre/devices/usbms/driver.py", line 215, in books
for path, dirs, files in os.walk(ebook_dir):
File "/usr/lib/python2.7/os.py", line 284, in walk
if isdir(join(top, name)):
File "/usr/lib/python2.7/posixpath.py", line 80, in join
path += '/' + b
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf1 in position 19: invalid continuation byte
I know there are other threads on this site that mention this problem, but none have a solution. Someone suggested it might have to do with a specific title of a certain book, or even several books. However, running Calibre in debug mode gives a similar / identical error, and so I can't, as suggested, figure out whether this is the problem, or which book has the problematic title.

Does anyone have any suggestions?
mwfogleman is offline   Reply With Quote
Old 03-09-2014, 01:19 AM   #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,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
list the files on your kindle

find /media/Kindle (or whatever)

then delete the one that has bogus bytes in its filename.

And if you cannot find the file by inspecting the list, use this one-liner
Code:
calibre-debug -c "from calibre import walk; files = [f.decode('utf-8', 'replace') for f in walk(b'/media/Kindle')]; print b'\n'.join(f.encode('utf-8') for f in files if u'\ufffd' in f)"
Replace /media/Kindle above with the path to your kindle.
kovidgoyal is offline   Reply With Quote
Old 03-09-2014, 04:04 AM   #3
mwfogleman
Junior Member
mwfogleman began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2013
Device: Kindle PaperWhite
I ran this command, tried to remove the related files, and have mucked things up so that Calibre won't start. (Oh no!)

When I run calibre-debug -g, it says:
calibre 1.27 isfrozen: False is64bit: False
Linux-3.13.5-1-ARCH-i686-with-glibc2.0 Linux ('32bit', 'ELF')
('Linux', '3.13.5-1-ARCH', '#1 SMP PREEMPT Sun Feb 23 00:10:07 CET 2014')
Python 2.7.6
Linux: ('', '', '')
mwfogleman is offline   Reply With Quote
Old 03-09-2014, 04:09 AM   #4
mwfogleman
Junior Member
mwfogleman began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2013
Device: Kindle PaperWhite
OK, I take it back. I restarted my laptop, ran Calibre (and it worked, phew!), mounted my Kindle, and now everything seems to be in working order.

One last concern: all of the files with "bad bytes" were from Amazon's Send-to-Kindle feature. Is there any way I can prevent this from happening in the future, if I continue to use the service?
mwfogleman is offline   Reply With Quote
Old 03-09-2014, 04:19 AM   #5
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,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Make sure your kindle is mounted with whatever the correct codepage is for its FAT32 filesystem. I'm afraid the details for how to do that depend on your linux distro.
kovidgoyal is offline   Reply With Quote
Reply

Tags
calibre, error, kindle, paperwhite


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The New Yorker All Access for Kindle bokolobs Amazon Kindle 0 05-05-2013 03:06 PM
Access my library with Kindle wi-fi???? Saxguy Library Management 10 10-15-2011 12:42 AM
Cant access facebook from kindle 3 granturissimus Amazon Kindle 7 10-01-2011 10:10 PM
kindle/library access winding trail General Discussions 14 07-29-2011 08:27 AM
Kobo Firmware Access and Early Access Program PeterT Kobo Reader 115 08-09-2010 08:06 PM


All times are GMT -4. The time now is 05:30 PM.


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