Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-28-2013, 06:04 AM   #1
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
KT - Schedule wifi downloads with cron?

Maybe the mighty developers can help (I posted in the regular Kindle forum and got no help?)
https://www.mobileread.com/forums/sho...d.php?t=206889
I hope this is not against the rules to cross-post? Sorry?

I want to write a simple cron script to connect daily to Amazon to see if I have any documents in my cue. I have a Touch wifi only, and it does not wake and sync with Amazon unless I wake it and press the buttons to connect and sync. I'm just trying to automate it.

What I can do:
Code:
lipc-set-prop com.lab126.powerd wakeUp 1
will wake it up.

I can turn on wireless with
Code:
lipc.set.prop com.lab126.cmd wirelessEnable 1

How do I make it ask Amazon if there are any items to download? With com.lab126.ota ?? This is the part I'm ignorant? There is a /usr/bin/todo program? What's that for? Any help or ideas would be wonderful!

this will put it back to sleep after:
Code:
lipc-send-event com.lab126.powerd.debug dbg_power_button_pressed
Thanks!
brianinmaine is offline   Reply With Quote
Old 02-28-2013, 06:13 AM   #2
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
AFAIK the moment you connect to wifi and are "unlocked to the world" then the docs will be pushed down.

So perhaps...

Sleep 120 would be enough

And yes cross-posting is bad mmmmkay
Attached Thumbnails
Click image for larger version

Name:	Selection_060.png
Views:	209
Size:	65.1 KB
ID:	102100  

Last edited by twobob; 02-28-2013 at 06:16 AM.
twobob is offline   Reply With Quote
Old 02-28-2013, 07:30 AM   #3
knc1
Going Viral
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: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by brianinmaine View Post
Maybe the mighty developers can help (I posted in the regular Kindle forum and got no help?)
https://www.mobileread.com/forums/sho...d.php?t=206889
I hope this is not against the rules to cross-post? Sorry?

I want to write a simple cron script to connect daily to Amazon to see if I have any documents in my cue. I have a Touch wifi only, and it does not wake and sync with Amazon unless I wake it and press the buttons to connect and sync. I'm just trying to automate it.

What I can do:
Code:
lipc-set-prop com.lab126.powerd wakeUp 1
will wake it up.

I can turn on wireless with
Code:
lipc.set.prop com.lab126.cmd wirelessEnable 1
How do I make it ask Amazon if there are any items to download? With com.lab126.ota ?? This is the part I'm ignorant? There is a /usr/bin/todo program? What's that for? Any help or ideas would be wonderful!

this will put it back to sleep after:
Code:
lipc-send-event com.lab126.powerd.debug dbg_power_button_pressed
Thanks!
A cron job the runs while the processor is halted - -
Now that is going to be a very good trick if you can pull it off.

cron is a software program, not access to a hardware timer.
software requires a processor to run it with, and when asleep linux is actually frozen in RAM with the processor shut down.

Install my dmesg -> document KUAL button and study the messages of what is happening during "going to sleep" and "waking up".
knc1 is offline   Reply With Quote
Old 03-01-2013, 01:06 AM   #4
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
Quote:
Originally Posted by knc1 View Post
A cron job the runs while the processor is halted - -
Now that is going to be a very good trick if you can pull it off.

cron is a software program, not access to a hardware timer.
software requires a processor to run it with, and when asleep linux is actually frozen in RAM with the processor shut down.

Install my dmesg -> document KUAL button and study the messages of what is happening during "going to sleep" and "waking up".
Oh, well that makes sense. I guess I just wasn't thinking about it being halted. Just for fun I did do a simple script trying to just wake it up and it didn't work. Thanks for busting my balloon!
brianinmaine is offline   Reply With Quote
Old 03-01-2013, 09:13 AM   #5
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
Ah right... well... since mine almost never drops to a low power state that never occurred.

twobob is offline   Reply With Quote
Old 03-01-2013, 09:30 AM   #6
knc1
Going Viral
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: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by twobob View Post
Ah right... well... since mine almost never drops to a low power state that never occurred.

While testing things on my remotely connected Kpw, it somehow managed to enter an "impossible" state:
USBnetworking ON - cable in - ssh session established with Kindle.
Prevent Screensavers - Enabled (home page showing).
Firewall with BBB filter enabled.
Airplane mode - Disabled - Wifi connection established.

Now that is my "Normal" (workday) setup for the Kpw - and since it is plugged into a "high power" (200ma) USB port - it can run like that approximately forever.
The charger cycles on and off, but the 200ma USB port can run it and keep the battery topped off at the same time.

Since I don't do any graphics with it - I have a tendency to ignore it. It just sits over there in its corner, doing whatever - - - -

I glanced over one day last week and the screen saver image was showing. WTF !!!

SSH session over USB was still up and working -
Wifi connection was still up and working -
But the processor has shifted to the "power saver" state (1/2 normal clock speed on a Kpw) and displayed the screensaver. Even though "prevent screensaver" was still enabled.

Looked the same-same as if it had gone into suspend-to-ram mode, but it was still very much alive and running under the screensaver.

Thinking it was broke - I kicked it out of that mode without taking the time to figure out how to transition to that mode intentionally.

Might be useful someday to learn how that state happened to be entered.

Last edited by knc1; 03-01-2013 at 09:33 AM.
knc1 is offline   Reply With Quote
Old 03-01-2013, 10:44 AM   #7
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
You know it's funny.. I kind of recall it being mentioned that this was the case on some (older?) devices. I also kind of recall (someone?) testing this before and it not working (I.E ssh dies when low power is entered)

So, yes that would be cool

I have to now resort to rebooting my stupid router once a day... for some reason it keeps killing the networking...

ping kt
PING kt (192.168.x.x) 56(84) bytes of data.
From dev.home (192.168.x.x) icmp_seq=1 Destination Host Unreachable

: ) *thinks about hammers and splinters of plastic*

lol
twobob is offline   Reply With Quote
Old 03-01-2013, 11:06 AM   #8
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,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by twobob View Post
PING kt (192.168.x.x) 56(84) bytes of data.
From dev.home (192.168.x.x) icmp_seq=1 Destination Host Unreachable
Now that's what I call paranoid!

ixtab is offline   Reply With Quote
Old 03-01-2013, 12:38 PM   #9
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
heh...

you have no idea..
twobob is offline   Reply With Quote
Old 03-02-2013, 02:05 PM   #10
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
I can't seem to find the link right now, but somewhere on the net I found some info that implied that if the kindle was plugged in either to a computer or to a wall charger, or if debug mode was turned on then the kindle wireless would stay active and be able to sync or even wireless ssh into. I've not done more experimentation on this, maybe I will just to know what the deal is. The way I wanted it to work is impossible, but there might be another way to accomplish what I want. I'd rather not have to plug it in everyday (if I wanted that, I'd have gotten an Android .
brianinmaine is offline   Reply With Quote
Old 03-02-2013, 02:09 PM   #11
knc1
Going Viral
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: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
At least on the Kpw v-5.3.3 firmware, having it plugged in does not prevent it from doing suspend-to-ram (a.k.a: going to sleep).

There is a KUAL DevHelper button that will copy the kernel's message buffer to a document where you can read what is happening/happened.
In that, you will see that it shuts down the Wifi chip on suspend-to-ram.
knc1 is offline   Reply With Quote
Old 03-02-2013, 02:46 PM   #12
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
I haven't used your extension, yet, but is there any reason not to change the cron entry that runs the log rotation every hour? Maybe I'll try once a day instead and try to track more messages for a while.
brianinmaine is offline   Reply With Quote
Old 03-02-2013, 02:50 PM   #13
knc1
Going Viral
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: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by brianinmaine View Post
I haven't used your extension, yet, but is there any reason not to change the cron entry that runs the log rotation every hour? Maybe I'll try once a day instead and try to track more messages for a while.
The button dumps the kernel's ring buffer - the same place the messages recorded by the system logger come from.
__Before__ the system logger gets ahold of them.

The script is setup to copy to a time-stamped, titled, document.
So you will have a series of time-stamped documents to view, merge, delete as you wish without messing with the system logger cron scheduling.
knc1 is offline   Reply With Quote
Old 03-02-2013, 02:56 PM   #14
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
OK installed and tried your extension - works great, thanks! Another question, how does the clock keep track of the time if the processor is suspended? Is the clock a special case, just a timer?

Oh, tinyrot runs every 15 minutes. Sure seems excessive? You just left it alone?
brianinmaine is offline   Reply With Quote
Old 03-02-2013, 03:18 PM   #15
knc1
Going Viral
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: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by brianinmaine View Post
OK installed and tried your extension - works great, thanks! Another question, how does the clock keep track of the time if the processor is suspended? Is the clock a special case, just a timer?

Oh, tinyrot runs every 15 minutes. Sure seems excessive? You just left it alone?
Separate hardware clock.
My set DateTime button will set both the kernel system's date time and update the hardware clock from the International network of public time servers.

The time servers used are in an end-user config file, but the defaults should work anywhere in the world.
The report generated includes a list of the time server networks queried.

I leave the Amazon Image files strictly alone.
That is one of the design goals of the KUAL launcher project - do nothing invasive of the Amazon Image files.

That principle is intended to eleminate the "My kindle updates fail" and "I did something long ago, don't remember what, and now my Kindle is broke" types of trouble reports.

You will find a few buttons that break the "do not disturb" rule.
But only a very few.
knc1 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KT - Schedule wifi downloads with cron? brianinmaine Amazon Kindle 0 02-26-2013 04:10 PM
When/how often to schedule downloads? guspasho Recipes 1 06-23-2012 10:20 PM
Touch Wifi downloads of public library books? bmbriefs Barnes & Noble NOOK 3 03-04-2012 02:45 PM
Automate Trook Downloads (cron-like)? spedinfargo Nook Developer's Corner 5 06-01-2011 02:40 PM
calibre & cron problem Deputy-Dawg Calibre 4 06-19-2008 09:56 PM


All times are GMT -4. The time now is 08:17 PM.


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