wake up ppc to start Alarm

Discussion in 'Questions (Windows Mobile)' started by CetinTek, Jul 24, 2008.

  1. CetinTek

    CetinTek Member Licensed User


    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.

  2. Erel

    Erel Administrator Staff Member Licensed User

    How are you waking the device? With RunAppAtTime?
  3. CetinTek

    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 ??
  4. Erel

    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.
  5. CetinTek

    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.

  6. Erel

    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.
  7. CetinTek

    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.

  8. Erel

    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.
  9. cactus

    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.


  10. Cableguy

    Cableguy Expert Licensed User

    Is it not possible to simulate a "standby" key press???
  11. sahoopes

    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:
    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:
    phone calls?

    And even Sprite Backup faithfully starts on schedule while the device is asleep.
    Last edited: Nov 24, 2008
  12. sahoopes

    sahoopes Member Licensed User

  13. Erel

    Erel Administrator Staff Member Licensed User

    As written in msdn:
  14. agraham

    agraham Expert 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.
  15. sahoopes

    sahoopes Member Licensed User

    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:
  16. agraham

    agraham Expert Licensed User

    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.
  17. Mr_Gee

    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: Nov 26, 2008
  18. chanppc

    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 :)
  19. ashrafidkaidek

    ashrafidkaidek Member Licensed User

    RunAppAtTime Issue


    can you please post a code example, to show how your code overcome this issue.

    Thank you
  20. Discorez

    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)
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice