wake up ppc to start Alarm

CetinTek

Member
Licensed User
Hello,

I have developed a Alarm-Application its work fine. But now I have a big Problem. When the ppc is in Sleep-Mode, the Alarm do not work. The Application start, but the Display is Off and no sound hear. How can I wake up the ppc from Sleep-Mode before my Alarm-Application starts??
Thank you very much.

MfG
Cetin
 

CetinTek

Member
Licensed User
yes, I make it with the With RunAppAtTime-Methode. With the ScreenOn-Command it works not, because my Device don't support this function.
With the BackLightOn-Command, the Display go on and after any seconds the Display go off. What can I do ??
 

Erel

Administrator
Staff member
Licensed User
This is a known problem with many devices which doesn't fully support this method.
You can try to repeatedly call BackLightOn (with a timer).
Also try to call KeepAlive.
 

CetinTek

Member
Licensed User
Hello Erel,

with "BackLightOn" and "KeepAlive" it doesn't work. The display switch on and after 3 second, the display switch off again. I doesn't understand, why i found no solution for this problem in this forum. This function is not needed? My Alarm-Clock is Garbage, when this function not work. Have you got an idea ?

Thank you, for your helping.

Cetin
 

Erel

Administrator
Staff member
Licensed User
This is a known problem and it is not specific to Basic4ppc.
You can also try to show a msgbox when the device wakes up.
 

CetinTek

Member
Licensed User
hi Erel,

msgbox doesn't work too. It's the same problem. After 3 seconds the ppc swich off. Do you can write a little "dll" to solute this problem? This is an important function for your B4ppc.

Cetin
 

Erel

Administrator
Staff member
Licensed User
I don't know yet about a solution to this problem.
If a solution will be found it will be added to the Hardware library.
 

cactus

Member
Licensed User
I use MortScript's ToggleDisplay(1) to turn on the screen on my Kaiser since ScreenOn doesn't work. Please look in to this Erel, now I still need to use MortScript :)
I was hoping to leave mortscript behind me since I found Basic4PPC.

Thanks,

Cheers,
Cactus
 

sahoopes

Member
Licensed User
Anything on this yet?

I have just run some tests. My device is one of those that does not support Hardware.ScreenOn. I tried to wake up device with BackLightOn and KeepAlive. These actually seem to work once the device is "awake."

However, in another related thread, Erel said:
You can't run any code while the device is suspended (OS design).
Herein lies my problem from this thread, and probably the same problem with the alarm clock app in this thread. Once the device is suspended no code will run. That is, you can trigger your app through RunAppAtEvent and RunAppAtTime events but the app will not actually run. It is waiting to run.

Placing any of the "wake up" functions even at the very beginning of your app will not help since the app will not even load until after the device wakes up. This also means CableGuy's suggestion of simulating a keypress wouldn't work either.

If applications cannot load and no code will run while the device is suspended, then how does my device wake up for:
alarms?
appointments?
phone calls?

And even Sprite Backup faithfully starts on schedule while the device is asleep.
 
Last edited:

Erel

Administrator
Staff member
Licensed User
No.
As written in msdn:
System power states define maximum device power levels for all power-manageable devices in the system. If a device is already at or below the maximum power level mandated by the new system power state, the device power state will not be updated.
 

agraham

Expert
Licensed User
then how does my device wake up for
I believe it is done by the Real Time Clock hardware on the device that runs to keep the correct(!) time even when the device is "off". It has a register within it that is set to the required wakeup time and when the time matches the register contents the hardware switches the device on.
 

sahoopes

Member
Licensed User
I believe it is done by the Real Time Clock hardware on the device that runs to keep the correct(!) time even when the device is "off". It has a register within it that is set to the required wakeup time and when the time matches the register contents the hardware switches the device on.
How would an application, that cannot run while device is suspended, tell the RTC to wake up the device?

I'm betting the answer is it can't.:sign0148:
 

agraham

Expert
Licensed User
How would an application, that cannot run while device is suspended, tell the RTC to wake up the device?
By setting the register in the RTC that holds the wakeup time before turning the device off. This is how your alarms, appointments and backups start on time. A phone call also wakes the device by hardware. In this case the phone hardware turns the device on when a phone call comes in.

I have looked but haven't so far been able to find the low-level API that the apps use to set a wake-up time. Something must be available as alarms etc. appear to work on your device while you say RunAppAtTime doesn't.
 

Mr_Gee

Active Member
Licensed User
When using g-alarm the application on first use states that my PPC has some bug,
because of this the alarm might not work correctly.
next you have the option of fixing it.

I think this has to do with the issue described above, but apparently there is a workaround/fix.

I'll send him a PM, maybe he's willing to help

-= edit=-
he replied with this:
AGEye.de: Home of G-Alarm, G-Watch, G-Light, G-Invaders and Caver
But I'm not sure if this would/could solve the issue...
 
Last edited:

chanppc

Member
Licensed User
I came across this article, at System Power States section, it mention that when system state is "Resuming", the following happen:

When a device wakes up from sleeping, it is in this mode. The backlight and the screen are still off (this is where we can call the Hardware1.BackLightOn to turn on the screen), and programs have a 15 second window to switch the device to another power state before the device automatically goes back to the suspended state.

During testing, after my device wake up from CeRunApAtTime, it goes back to suspended state exactly after 15 second, to overcome this issue, I call the .net "PowerPolicyNotify" to "unattended power mode" & it work! (togather with Hardware1.BackLightOn & hardware1.KeepAlive)

I hope this will help the rest :)
 

Discorez

Member
Licensed User
How to do display backlight on, if HardWare.ScreenON not supported on my device? With PowerNotify library (PowerNotify.BacklightOn) too does not work...
Other ways of solution exist?

My device - Samsung i8000 (Omnia II)
 
Top