04-06-2013, 07:29 AM | #1 |
Enthusiast
Posts: 31
Karma: 30000
Join Date: May 2012
Device: KT B011
|
Switch to USB-NET when detecting a file
Some applications, especially external applications, occasionally freezes my KT, it's the best choice to have usb-net enabled to rescue the system or just reboot, instead of hard-resetting.
But usb-net devours lots of battery power in peacetime, so it's better to use usb-drive mode to save battery power when KT is fine. My idea is, when the GUI freezes, I will connect it to my computer, create a file on it. A background program tries to check it when KT disconnects from the computer. If the file exists, it'll delete the file, beep, and switch to usb-net mode automatically. Could anyone help to develop such a very useful program? Sorry as I'm a beginner. Last edited by wisecrick; 04-06-2013 at 07:56 AM. |
04-06-2013, 08:00 AM | #2 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Surely it is the "Wireless Networking" rather than the actual mode that is consuming the power.
Also rather than testing for the existence of the file every minute would it not be better to attach such a test to the (power?) button event itself (via dbus maybe?) So, I am asking. "Toggle wireless & usbnetworking mode: when (X) file exists and power button is pressed" Would that be perhaps the specification? (That could work on the PW too) Or maybe "Toggle wireless & usbnetworking mode: Home button is down and power button is pressed" - KT only I guess Or maybe simply " Kill all processes in list (A) when power button and home button are depressed" Or maybe simpler " Kill all processes NOT in list (B) when power button and home button are depressed" Just struggling to understand what it is you actually need. Thanks Last edited by twobob; 04-06-2013 at 08:05 AM. |
Advert | |
|
04-06-2013, 08:07 AM | #3 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Oh... Also: you have a "kindle 4 Touch" listed as your device... Can you update that? It was confusing me. Thanks
The 4 is Non Touch The kindle 5 is Touch. Which is it? |
04-06-2013, 08:31 AM | #4 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
That is an important point - since the K4 and the K5 have different behavior when "inactive" (different low power states).
In fact, you should probably give us not only the Model, but the firmware version being used and the first four characters of your serial number. Whatever model/firmware/device it is, twobob is probably correct about the battery drain - you most likely have Wifi and/or 3G enabled at that time. USB networking does not "eat the battery" but the wireless devices certainly do (even Amazon says so). Last edited by knc1; 04-06-2013 at 08:34 AM. |
04-06-2013, 01:20 PM | #5 |
Enthusiast
Posts: 31
Karma: 30000
Join Date: May 2012
Device: KT B011
|
Thanks for the reply.
I've owned Kindle Touch v5.3.2.1 at present, the first 4 characters is B011, correct the confusion. When KT freezes, I usually issue these commands: kill the application, restart the framework (sometimes framework itself suspends). So I think the best choice here is: Kill all processes NOT in list (B) when long-pressing power button and home button are depressed, and then restart the framework. Or just reboot the device. When I'm away from my computer. Switch to usb-net when short-pressing power button and home button. If I want to rescue KT myself. Thanks very much for your help Last edited by wisecrick; 04-06-2013 at 01:25 PM. |
Advert | |
|
04-06-2013, 01:48 PM | #6 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Hmm... yeah. It's what knc1 said: usbnetwork as such does not drain Kindle power. Neither does the SSH daemon. So the simplest suggestion is to keep your Kindle in usbnetwork mode all the time. Once it screws up, connect it to a PC and issue "restart framework".
|
04-06-2013, 03:16 PM | #7 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
OK, when it goes into the mode that displays screensavers, the ssh daemon will be stopped and the USBnetwork connection lost. Install the KUAL launcher and the "Prevent ScreenSaver" helper button, that (on the K5) not only prevents the screensaver mode, it also prevents the SoC from shifting into its lowest power mode. Battery management will cycle the charger on/off in this state. The SSH daemon will continue to run, and the connection will stay up. Since this is avoiding the lowest power mode - you should keep it on external power - since the kernel never enters the "suspend" mode. (Most of the time, a Kindle is (next to) stopped, but not when used like this.) |
|
04-07-2013, 02:25 AM | #8 |
Enthusiast
Posts: 31
Karma: 30000
Join Date: May 2012
Device: KT B011
|
On My KT, usbnet needs lots of power. I'll charge KT about every 5 days on usb-drive mode, but I have to charge it every 2 days on usb-net mode.
|
04-07-2013, 03:40 AM | #9 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Do me a favour, jump into a console and run htop. then switch between the two modes.
Observe the difference in processor/resources used in the two modes. Also, you don't indicate whether or not you have wireless enabled constantly. Going to need better information than those anecdotal metrics. |
04-07-2013, 08:51 AM | #10 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Everything, on any device, even your table lamp - - "eats battery" when "on" compared to "off". Please provide the information twobob has requested above. You might also include the battery report (which reports battery current also - there is a KUAL button for that) in each of the requested reports. |
|
04-07-2013, 12:35 PM | #11 |
Wizard
Posts: 1,669
Karma: 2300001
Join Date: Mar 2011
Location: Türkiye
Device: Kindle 5.3.7
|
Kite could be used to do this with a proper command file. It can execute command files on shutdown, restart, exiting form usb mode etc.
on your scenario you can copy a proper sh file into the folder of kite whenever it is frozen and you want to open the usbnetwork or just reboot the kindle. only thing you need apart from the kite is a proper sh file to: 1- (open wifi) 2- switch to usbnetwork mode 3- will delete(or disable) itself. or : 1- restart the framework 2- remove(or disable) itself BTW I think there is an alternative to kite also.. EDIT: Found it : EventHandler could be used in a similar way Last edited by thomass; 04-08-2013 at 11:49 AM. |
04-07-2013, 06:50 PM | #12 |
Guru
Posts: 916
Karma: 13928438
Join Date: Jan 2013
Location: Ely, Cambridgeshire, UK
Device: Kindle Oasis 3, Kindle Oasis 1
|
Hm, if powertop works on the Kindle's kernel it might be interesting to see what it says. (It may very well not work.)
|
04-07-2013, 07:14 PM | #13 |
Groupie
Posts: 165
Karma: 593460
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
|
My KT B011 5.3.2 does not stop the ssh daemon nor loose the USBnetwork connection when the screensaver turns on. It sure is convenient, but I wonder why. Any ideas?
|
04-07-2013, 07:46 PM | #14 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
The Kpw does as I described, I do not have a Kt to test with here. Note: The K4 also works as stepk describes. |
|
04-08-2013, 11:40 AM | #15 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle DX -- USB File Transfer | Red Line Train | Amazon Kindle | 6 | 07-01-2009 07:17 PM |
File management: how to copy file from USB stick? | Lec0mte | iRex | 5 | 05-04-2009 07:19 AM |
Free file downloads via USB? | JKKINDLE | Amazon Kindle | 4 | 03-06-2009 08:34 AM |