Programatically "wake" From Standby Mode


chris_c

Member
Joined
Jun 25, 2010
Messages
393
Age
56
I want to know how to "wake" periodically from standby mode (or stay in standby till a specific time)

that’s probably not so much the issue as knowing how to come fully awake, programmatically.

What I'm intending to do is make some kind of scheduling daemon the idea would be that the Pandi in your pocket would *never* be switched off but rather spend most of its life in standby mode
(maybe some kind of low power warning too, so it will beep discretely once a minute or so till acknowledged when you only have n hours of standby time left...)

Ideally I'd like to end up with a "standard" Pandora scheduling daemon that anyone porting PIM software can add a few bits of code to, so that agenda alarms etc won't be missed
I'm probably thinking some kind of TCP server you would send a small fragment of XML or maybe binary data, to make, change or delete alarms, once an alarm is activated the daemon would wake
the Pandora to allow whatever running PIM software to make a fuss about it...

(I still don't know how long a full charge should last in standby mode - I'll have to do some experimentation!)
 
I think you need to think about how to actually implement a stand-by mode before worrying about waking up!
 
ok for anyone else who's interested I've found out the following

power "mode" is changed by a fairly simple script (/usr/pandora/scripts/op_power.sh)

I had thought the machine would be in some kind suspend mode, however its just running slowly with a bunch of stuff turned off lcd, wifi, bluetooth etc

despite this measuring every 1/2hr over 5hrs shows a steady graph that indicates that a full charge should give approximately 24hrs which is good enough but i bet can be improved!

I need to look round at existing alarm daemons and think about what I need/want from an alarm daemon...

Any ideas most welcome!
 
Pleng said:
I think you need to think about how to actually implement a stand-by mode before worrying about waking up!
I usually implement it by using my index finger to momentary slide the power switch to the right...
 
Last edited by a moderator:
We don't really have a standby mode yet, we have the low-power mode, but not a standby/suspend mode. I think this is what Pleng ment.
Last I heard a real standby mode (or rather a suspend mode) was being worked on, but there was some drivers that cause some problems by not having any suspend support.

Now over to your problem:
Since the machine is actually running in the current low power mode, you could (at the simplest level) have a script / write a small program that sleeps and wakes up every minute to check the current time against a a built in time or a time specified in an external file.
And when the time matches what you are looking for, you first call the wake-up script (im guessing it's the same script as the go-into-low-power), and then call whatever application you want to.

But if you want a future proof thing, (I'm only guessing here tough) you will probably want to read up on the omap3 documentation for sleep,interrupts,timers and possibly watchdogs
There may exists some sort of abstraction layer for this in linux, but I don't know it.
 
There's another problem with a "real" suspend too, if its to ram then in low memory situations it won't work and if its to nand then you loose precious nand space leaving the only other alternative suspending to sd card - which means you need to leave the sd card in all the time (fine if like me you boot from sd - I leave nand virgin to test pnd's I make)

I tend to completely inaccurately refer to low power mode as suspend as its similar in function and there probably not a great lot of hope of seeing a real suspend mode. (I'd rather see people working on wifi than suspend to be honest speeds of >100kb/s would make it usable!)

Given you get a good 24hrs in low power mode (assuming you're idle!) then staying in low power mode for alarms during the day is just about practical and if you switch off at evening/night then you might even get a short weekend out of a charge.

Some kind of subtle alarm just to warn of low power shutdown in an hours time is something I might hack together as it would be useful if using the pandora as a pim.

Ideally it would be nice if low power mode lasted a long weekend like my phone does on a battery 1/6th the size - alas its not that simple!

Mind you as I understand it some of the "smart" phones only just get over a days standby - which is as much use as a chocolate fire guard!!!
 
chris_c said:
Some kind of subtle alarm just to warn of low power shutdown in an hours time is something I might hack together as it would be useful if using the pandora as a pim.
Not sure if this is what you're talking about, but if you right-click (either with the nub or tap-hold) on the battery meter and choose "Properties" you can set two battery points and have it do whatever you want at those points.
 
Last edited by a moderator:
chris_c said:
I tend to completely inaccurately refer to low power mode as suspend as its similar in function and there probably not a great lot of hope of seeing a real suspend mode. (I'd rather see people working on wifi than suspend to be honest speeds of >100kb/s would make it usable!)

Given you get a good 24hrs in low power mode (assuming you're idle!) then staying in low power mode for alarms during the day is just about practical and if you switch off at evening/night then you might even get a short weekend out of a charge.

...but you don't need to force the unit to come out of 'low power mode' for PIMs to still be able to sound alarms. What does LPM do that would prevent PIMs working properly?
 
Last edited by a moderator:
Pleng said:
chris_c said:
I tend to completely inaccurately refer to low power mode as suspend as its similar in function and there probably not a great lot of hope of seeing a real suspend mode. (I'd rather see people working on wifi than suspend to be honest speeds of >100kb/s would make it usable!)

Given you get a good 24hrs in low power mode (assuming you're idle!) then staying in low power mode for alarms during the day is just about practical and if you switch off at evening/night then you might even get a short weekend out of a charge.

...but you don't need to force the unit to come out of 'low power mode' for PIMs to still be able to sound alarms. What does LPM do that would prevent PIMs working properly?
I'm glad to report nothing! :) but you will need to come out of LPM to read what the alarm is for ;) ... fortunately thats just a script to run, which if the PIM is flexible could be a default action along side an optional alarm and dialog.
 
Last edited by a moderator:
Back
Top