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

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-15-2022, 03:36 PM   #1
JJTech
Nerd
JJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongue
 
JJTech's Avatar
 
Posts: 52
Karma: 22352
Join Date: Dec 2020
Location: USA
Device: Kindle Basic 3 (2019)
Post Re-attaching Kindle after unmount

Hi! Today I found myself in a situation where I wanted to be able to use my Kindle normally, but still have a script be able to push content to the Kindle without user interaction.

The Kindle can be used while plugged into the PC by ejecting it, but I couldn't figure out how to "un-eject" it without unplugging it.

Eventually, I figured it out, and I decided to post it for anyone interested.

Windows:
Spoiler:
  1. Download sg3_utils. There are regular builds for Windows, but I have provided a stripped-down version with only the features you need on GitHub. I have also attached it to this post.
  2. Open an Administrator Command Prompt to the folder you extracted sg3_utils to.
  3. Find the device name of the Kindle:
    Code:
    .\sg_scan.exe
    , noting down the number (e.g. PD2) next to the line that says "Kindle".
  4. To "eject" the Kindle (note that this is NOT the same as ejecting in Explorer, you can't un-eject with that) execute the command:
    Code:
    .\sg_start.exe --eject PD2
  5. To "un-eject" the kindle execute the command:
    Code:
    .\sg_start.exe --load PD2
    Note that you can ignore any "device not ready" errors.

Linux:
Spoiler:

Just use
Code:
eject /dev/sda
to eject, and
Code:
eject -t /dev/sda
to "un-eject", replacing /dev/sda with your Kindle's device.


You're done! I might script this process later, and it could be incorporated into other applications. I also have no idea how this might be accomplished on macOS.
Attached Files
File Type: zip sg3_utils_win.zip (833.6 KB, 51 views)

Last edited by JJTech; 01-15-2022 at 03:41 PM.
JJTech is offline   Reply With Quote
Old 01-15-2022, 04:05 PM   #2
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,263
Karma: 98804578
Join Date: Apr 2011
Device: pb360
I leave USBNetwork always enabled on the kindle and use scp to transfer files. No muss, no fuss.
j.p.s is offline   Reply With Quote
Advert
Old 01-16-2022, 03:39 PM   #3
JJTech
Nerd
JJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongue
 
JJTech's Avatar
 
Posts: 52
Karma: 22352
Join Date: Dec 2020
Location: USA
Device: Kindle Basic 3 (2019)
Unfortunately, my Kindle upgraded itself before I was able to apply a jailbreak, so I can't do that.
JJTech is offline   Reply With Quote
Old 01-17-2022, 01:53 PM   #4
JJTech
Nerd
JJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongueJJTech can tie a knot in a cherry stem with his or her tongue
 
JJTech's Avatar
 
Posts: 52
Karma: 22352
Join Date: Dec 2020
Location: USA
Device: Kindle Basic 3 (2019)
I found a new way to do it on Windows! This method will allow you to "un-eject" the device even if it was ejected with Explorer!

This method does not require any 3rd party applications, it uses the built-in pnputil.

Spoiler:
  1. Open an Administrator PowerShell prompt
  2. Find the parent USB device of the Kindle by running this PowerShell command and copying the "Parent" it shows:
    Code:
    pnputil /enum-devices /connected /relations | Select-String "Kindle Internal Storage" -Context 0,6
    NB: This must be run before ejecting the Kindle!
  3. Un-eject it with this PowerShell command:
    Code:
    pnputil /disable-device "PARENT DEVICE GOES HERE"; pnputil /enable-device "PARENT DEVICE GOES HERE"
    (Insert the parent device from above, it should look something like USB\VID_1949&PID_0324\3040VB5594820045)

    NB: You can "eject" it by running the first part of the command, i.e. the part before the semicolon, or by doing what this ServerFault answer suggests.
You're done!


I’m currently writing a Go wrapper around this, with Linux support, so that you can use it cross platform.

Last edited by JJTech; 01-18-2022 at 08:26 AM. Reason: Add note about Go library.
JJTech is offline   Reply With Quote
Reply

Tags
tutorial

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Feature Request: Option to unmount/mount SD Card after sync RobFreundlich Calibre Companion 4 03-09-2014 09:12 PM
Unmount internal SD card -Ooops! Pier Kobo Tablets 2 11-24-2011 07:52 AM
Request Widget to Unmount SD and USB walt526 enTourage Archive 3 07-15-2010 02:30 PM
Classic 1.2 unmount/eject issue demeulenaere Barnes & Noble NOOK 3 02-12-2010 09:31 AM
eject kindle in linux (not unmount) demoric Amazon Kindle 4 08-02-2009 05:33 PM


All times are GMT -4. The time now is 06:13 AM.


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