![]() |
#1 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 439
Karma: 2666666
Join Date: Nov 2020
Device: none
|
How to upload file to Kindle Scribe?
I want to upload a file to path like `documents/book_name.sdr/LanguageLayer.en.asin.kll` and I'm using this code:
Code:
def upload_file_to_kindle_mtp(driver: Any, source_path: Path, dest_path: Path) -> None: storage = driver.filesystem_cache.storage(driver._main_id) parent = driver.ensure_parent(storage, dest_path.parts) with source_path.open("rb") as f: driver.put_file(parent, dest_path.parts[-1], f, source_path.stat().st_size) source_path.unlink() Original code on GitHub: https://github.com/xxyzz/WordDumb/bl...e.py#L276-L284 Last edited by xxyzz; 12-02-2023 at 02:10 AM. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,176
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The scribe is an MTP device. I dont know of any reason it would work with an android mtp device and not the scribe.
Last edited by kovidgoyal; 12-02-2023 at 09:19 PM. |
![]() |
![]() |
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,737
Karma: 103020299
Join Date: Apr 2011
Device: pb360
|
I thought the scribe is a linux device.
|
![]() |
![]() |
![]() |
#4 | |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,678
Karma: 103503501
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Scribe is MTP and technically MTP is not do if the device is Android. It's a protocol MS developed for the Zune (from 2006 and Windows CE 6 embedded). I think up to Android 3 Google used Mass Storage and it's from 4.0 in 2011 that Android switched to MTP.
Perhaps Kovid meant MTP just like an Android device? Quote:
Last edited by Quoth; 12-02-2023 at 01:53 PM. |
|
![]() |
![]() |
![]() |
#5 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,705
Karma: 168431851
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
![]() |
![]() |
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,737
Karma: 103020299
Join Date: Apr 2011
Device: pb360
|
|
![]() |
![]() |
![]() |
#7 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,678
Karma: 103503501
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,737
Karma: 103020299
Join Date: Apr 2011
Device: pb360
|
Mischaracterizing a device can lead to confusion and other problems.
|
![]() |
![]() |
![]() |
#9 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,705
Karma: 168431851
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 439
Karma: 2666666
Join Date: Nov 2020
Device: none
|
Could this have anything to do with the `@same_thread` decorator in the Windows MTP driver? But I don't find any `ThreadingViolation` exceptions in user posted logs.
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,176
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
My point was if its working for non-scribe mtp devices it should work the same for scribe they are identical as far as the mtp code is concerned. As for threading yes that's definitely a concern to upload a file you should relaly be submitting a job to the gui device manager rather than talking to the driver directly.
|
![]() |
![]() |
![]() |
#12 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 439
Karma: 2666666
Join Date: Nov 2020
Device: none
|
I tested the code on Linux not Windows and the Linux MTP driver don't have this thread checking code, I guess this could be the culprit.
|
![]() |
![]() |
![]() |
#13 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,705
Karma: 168431851
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
One thing to remember is that unlike Windows, Linux and MacOS only allow a single connection to an MTP device. That seems to have bitten quite a few users of those OS when using an MTP device.
|
![]() |
![]() |
![]() |
#14 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 439
Karma: 2666666
Join Date: Nov 2020
Device: none
|
That's not a problem, the code only runs if calibre could connect to the device.
|
![]() |
![]() |
![]() |
#15 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,678
Karma: 103503501
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
I have to stop (not kill as it will respawn) gvfs-mtp-volume-monitor on Linux Mint with Mate before I plug-in an MTP device. Setting MTP to not automount only seems to work (mostly) on Cinnamon, not Mate. Using "unmount" at GUI only works for some MTP devices, others won't communicate without cable re-plugged, which of course remounts it as a filesystem.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Troubleshooting cannot see highlights in book even if My Clippings file is intact [Kindle Scribe] | dnn3 | Amazon Kindle | 6 | 01-21-2025 03:55 PM |
Kindle fire webview camera file upload problem | sluggo | Kindle Fire | 1 | 03-03-2016 01:29 PM |
File Upload from WEbsite | nbcauthor | Related Tools | 1 | 09-20-2013 07:57 AM |
which file to upload | dennis7450 | Workshop | 1 | 11-29-2011 02:20 PM |
How to upload a eb1150 file? | DaleDe | Upload Help | 11 | 09-01-2007 07:26 PM |