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 05-28-2012, 09:16 AM   #1
Rod Whiteley
Junior Member
Rod Whiteley began at the beginning.
 
Rod Whiteley's Avatar
 
Posts: 5
Karma: 10
Join Date: May 2012
Location: UK
Device: Kindle Touch
Question Re-entering USB drive mode?

After stopping USB drive mode is there any way to restart it other than physically unplugging the cable and plugging it back in?
Rod Whiteley is offline   Reply With Quote
Old 05-28-2012, 09:29 AM   #2
knc1
Helpdesk Junkie
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 6,852
Karma: 6314522
Join Date: Feb 2012
Device: Too many.
Quote:
Originally Posted by Rod Whiteley View Post
After stopping USB drive mode is there any way to restart it other than physically unplugging the cable and plugging it back in?
From which end of the cable did you "stop" it?

In other words: What have you done?
What OS is the machine running that it is plugged into?
knc1 is offline   Reply With Quote
Old 05-28-2012, 09:52 AM   #3
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677557
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by knc1 View Post
From which end of the cable did you "stop" it?

In other words: What have you done?
What OS is the machine running that it is plugged into?
I don't think that really matters.

To re-phrase the OP's question differently (if I understood it correctly): After the drive was ejected from the computer, but the cable is still plugged in, is there a way to (programmatically) set the Kindle to USB drive mode again?

I am not aware of any solution.

However, the same question would be interesting for USB Network: after turning on USB network, you also have to unplug and replug the cable for the device to be recognized as a "new one". Maybe there is some software solution to "reset" the USB port which would act as if the cable was unplugged/replugged? This certainly must be possible, but I'm completely lost when it comes to electronics and circuitery, so I probably can't be of any help.
ixtab is offline   Reply With Quote
Old 05-28-2012, 10:38 AM   #4
knc1
Helpdesk Junkie
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 6,852
Karma: 6314522
Join Date: Feb 2012
Device: Too many.
Quote:
Originally Posted by ixtab View Post
I don't think that really matters.
It might. There are two machines involved, both responding to "hot plug" events.

Let's walk this through in a bit of detail.
Quote:
Originally Posted by ixtab View Post
To re-phrase the OP's question differently (if I understood it correctly): After the drive was ejected from the computer, but the cable is still plugged in, is there a way to (programmatically) set the Kindle to USB drive mode again?
"Drive ejected from the computer" - that is done on the "host end" computer. You have just told the "host" that the USB drive should be disconnected (from the OS).

? Does the Kindle detect that ? (I don't have a working kindle at the moment to test this).

If the Kindle did not detect that - then nothing has changed at the Kindle "device end" of the connection. And there is nothing to be done at/on the Kindle.
What you need is to "reattach" the USB device on the host end after the "eject" on the host end.
How that gets done depends on the OS the host end is running.

If the Kindle did detect that ("eject" or "safely remove") - then you would have to "reattach" the USB device in both the Kindle/Linux OS and in the host/whatever OS.

Need more details than where provided to answer either case above.
Quote:
Originally Posted by ixtab View Post
I am not aware of any solution.

However, the same question would be interesting for USB Network: after turning on USB network, you also have to unplug and replug the cable for the device to be recognized as a "new one". Maybe there is some software solution to "reset" the USB port which would act as if the cable was unplugged/replugged? This certainly must be possible, but I'm completely lost when it comes to electronics and circuitery, so I probably can't be of any help.
We know what OS is being run at the "device end" - still would need to know what OS is being run at the "host end".
The how-to fake a "hot plug" (or "plug&play") event differs by OS.

I hope that helps clarify the reasons for my question.
knc1 is offline   Reply With Quote
Old 05-28-2012, 10:43 AM   #5
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677557
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by knc1 View Post
"Drive ejected from the computer" - that is done on the "host end" computer. You have just told the "host" that the USB drive should be disconnected (from the OS).

? Does the Kindle detect that ? (I don't have a working kindle at the moment to test this).
Yep, it does. While mounted, it shows the "If you want to read while charging, eject the Kindle, but leave the cable plugged" (or so). After unmounting, it becomes usable (and also, only then do the files on /mnt/us become accessible to programs running on the Kindle, as stated in another thread).
ixtab is offline   Reply With Quote
Old 05-28-2012, 10:45 AM   #6
Rod Whiteley
Junior Member
Rod Whiteley began at the beginning.
 
Rod Whiteley's Avatar
 
Posts: 5
Karma: 10
Join Date: May 2012
Location: UK
Device: Kindle Touch
Quote:
Originally Posted by ixtab View Post
To re-phrase the OP's question differently (if I understood it correctly)...
Yes, you understood my question correctly. I notice that when my computer goes to stand-by while connected, my Kindle appears to do the same, and when my computer wakes up Kindle goes back to USB drive mode. That made me think there might be a way to fool the system. You are right, one way would be to make a special cable or USB hub with a switch to interrupt the connection for a moment.
Rod Whiteley is offline   Reply With Quote
Old 05-28-2012, 10:47 AM   #7
drauger
Enthusiast
drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.
 
drauger's Avatar
 
Posts: 31
Karma: 46558
Join Date: Feb 2012
Device: Kindle4NT
Quote:
Originally Posted by ixtab View Post
Maybe there is some software solution to "reset" the USB port which would act as if the cable was unplugged/replugged?
USB Safely Remove for Windows can return back a device just stopped.
drauger is offline   Reply With Quote
Old 05-28-2012, 10:50 AM   #8
Rod Whiteley
Junior Member
Rod Whiteley began at the beginning.
 
Rod Whiteley's Avatar
 
Posts: 5
Karma: 10
Join Date: May 2012
Location: UK
Device: Kindle Touch
Quote:
Originally Posted by drauger View Post
USB Safely Remove for Windows can return back a device just stopped.
It can? After I stop a device it disappears from the list.
Rod Whiteley is offline   Reply With Quote
Old 05-28-2012, 10:50 AM   #9
knc1
Helpdesk Junkie
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 6,852
Karma: 6314522
Join Date: Feb 2012
Device: Too many.
Quote:
Originally Posted by ixtab View Post
Yep, it does. While mounted, it shows the "If you want to read while charging, eject the Kindle, but leave the cable plugged" (or so). After unmounting, it becomes usable (and also, only then do the files on /mnt/us become accessible to programs running on the Kindle, as stated in another thread).
Thank you.
I couldn't check that myself and I had forgotten that it switched to "charging" mode.

So the process would be to reverse (on the Kindle) the switch to "charging" mode;
Re-enable the "device gadget" kernel module (if it was removed by the switch);
and then - if those changes where not auto-detected by the host end OS - do a "re-attach" at the host end.

At which point, the answer to the O.P's question is: No.

If the host end OS does auto-detect the mode-change at the device (Kindle) end, then the process above should do the job.
In which case the answer to the O.P's question is: Yes.

All too complicated for me - I would rather just unplug/plug the cable.
knc1 is offline   Reply With Quote
Old 05-28-2012, 12:30 PM   #10
hostar
Zealot
hostar is a glorious beacon of lighthostar is a glorious beacon of lighthostar is a glorious beacon of lighthostar is a glorious beacon of lighthostar is a glorious beacon of lighthostar is a glorious beacon of lighthostar is a glorious beacon of lighthostar is a glorious beacon of lighthostar is a glorious beacon of lighthostar is a glorious beacon of lighthostar is a glorious beacon of light
 
Posts: 137
Karma: 12324
Join Date: Dec 2011
Location: CZ
Device: Kindle 4 non-touch
-- DELETED --
hostar is offline   Reply With Quote
Old 05-29-2012, 02:43 AM   #11
drauger
Enthusiast
drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.
 
drauger's Avatar
 
Posts: 31
Karma: 46558
Join Date: Feb 2012
Device: Kindle4NT
Quote:
Originally Posted by Rod Whiteley View Post
It can? After I stop a device it disappears from the list.
I suppose it depends on your setup. After stopping USB device via USBSafelyRemove you should see it in the list as "stopped" and can just click it to return back in the system.
drauger is offline   Reply With Quote
Old 05-29-2012, 08:24 AM   #12
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,070
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by Rod Whiteley View Post
... I notice that when my computer goes to stand-by while connected, my Kindle appears to do the same, and when my computer wakes up Kindle goes back to USB drive mode...
Your host PC is probably powering down the USB port, as part of its "Green" energy-saving features. You should be able to disable that in your BIOS and/or in your Windows control panel. Your kindle cannot charge from a USB port that is NOT supplying power.

How to reset the USB device(s) from (host PC) software to force redetect:
http://stackoverflow.com/questions/9...he-windows-api
Quote:
You can do this by ejecting the device through the CfgMgr API. For example, to go over all USB hubs and eject all devices:

Find all devices having device interface GUID_DEVINTERFACE_USB_HUB with SetupDiGetClassDevs(... DIGCF_DEVICEINTERFACE).
Enumerate over the returned device information set (SetupDiEnumDeviceInfo).
For each device, get the DevInst member:
Invoke CM_Get_Child(DevInst) and then CM_Get_Sibling repeatedly to go over all child nodes of the hub (i.e. the USB devices).
For each child node, call CM_Request_Device_Eject.

Last edited by geekmaster; 05-29-2012 at 09:41 AM.
geekmaster is offline   Reply With Quote
Old 05-29-2012, 09:25 AM   #13
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 728
Karma: 2314258
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Following commands executed on KT did the trick:
Code:
lipc-send-event com.lab126.hal usbPlugIn
lipc-send-event com.lab126.hal usbConfigured
Disclamer: I've tried it on KT 5.1.0 after connecting it to computer with Linux and then "ejecting" KT at computer side (not physically ejecting, but rather programmatically).

Last edited by eureka; 05-29-2012 at 09:28 AM.
eureka is offline   Reply With Quote
Old 05-29-2012, 10:04 AM   #14
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 728
Karma: 2314258
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
BTW, for geeks: KT uses g_file_storage module (with parameter 'removable=y') for exporting it's "disk" as USB Mass Storage device. I've found some descriptions of it's work. As expected, this command exports diagnostic partition :
Code:
echo /dev/mmcblk0p2 > /sys/devices/platform/fsl-usb2-udc/gadget/gadget-lun0/file
Command was issued after connecting KT to computer and programmatic ejecting of KT device from computer (USB plug was still in place).

I believe, it's safe to mount exported diagnostic partition on computer for read/write. It's also could be safe to mount exported main partition on computer for read-only. Partition with /var/local should not be exported via this way (as it's mounted by KT OS in read/write mode). The same applies for userstore FAT parition.
eureka is offline   Reply With Quote
Old 05-29-2012, 10:40 AM   #15
knc1
Helpdesk Junkie
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 6,852
Karma: 6314522
Join Date: Feb 2012
Device: Too many.
Quote:
Originally Posted by eureka View Post
BTW, for geeks: KT uses g_file_storage module (with parameter 'removable=y') for exporting it's "disk" as USB Mass Storage device.
Additional information:
http://git.kernel.org/?p=linux/kerne...2202de;hb=HEAD

Which is a view on: Documentation/usb/gadget_multi.txt in your kernel source tree.
knc1 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting Kindle 3 usb drive mode problem readpro Amazon Kindle 7 10-25-2011 01:22 AM
Classic Stuck in USB Drive Mode, and worse... varelov Barnes & Noble NOOK 5 06-10-2011 11:42 PM
USB Drive Mode copyrite Amazon Kindle 7 02-08-2011 11:47 AM
Troubleshooting Did I get my kindle stuck in USB Drive Mode? peacedog Amazon Kindle 6 02-04-2011 01:11 PM
USB Drive Mode on K3 Paulinafrica Amazon Kindle 5 12-17-2010 01:43 AM


All times are GMT -4. The time now is 03:39 PM.


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