How to wake up Windows 8.1 from connected standby programmatically
Asked Answered
E

1

7

Is there a way to wake up Windows 8.1 from connected standby programmatically? For my requirement, it's acceptable by using either a store app background task, or a session 0 service.

My scenario is that I have a store app background task to be periodically invoked (or be triggered by push notification). When the background task is invoked, it checks to see if a certain condition is met. If so, it shall perform an operation to wake up the device from connected standby. The reason I need to exit CS is that I need to launch a process when the condition is met. This process will serve a TCP connection to run a extended period of time. It's kind of like a remote desktop server which automatically wakes up upon a connection request, but normally in connected standby to save power (the device is on battery).

The first approach I think of is using scheduled task with the "wake the computer to run" option. But according to this post, it doesn't wake the machine when in connected standby mode.

Now if there is a way to do this programmatically, it would be logical to do this as a store app background task, or a session 0 service, both of which get a short chance to run during connected standby. But the question is - what operation to perform to exit connected standby?

According to Connected standby wake sources, various peripheral hardware can wake the device. For example, power button press wakes up the device through GPIO interrupt. So the question boils down to is there a way to "simulate" a power button press by generating such GPIO interrupt? I don't know much about windows kernel/driver programming. Any advice will be appreciated. I think this is a feasible approach as this WDTF method can put the system into CS and wake up after a given interval.

Another seemingly possible approach would be to generate a toast notification as a "VoIP" app. As mentioned in Introduction to Connected Standby, a background task scheduled by a lock screen app can send toast notification, which ONLY generates a short sound with the display turned off. Only after the user pressing the power button will the toast be shown. So I assume generating toast in such a way won't wake up the device. However, the document does mention "VoIP" apps can generate toast notification with longer, customize ringtone, AND with display turned ON. I assume the device might be waked up in this case. But the document doesn't provide any reference to how such "VoIP" apps are written.

Elutriate answered 2/8, 2014 at 19:40 Comment(0)
C
0

You could use a microcontroller (e.g. Arduino) or something similar (e.g. Raspberry Pi) to simulate a valid USB event (like mouse click or key press) over an USB cable to wake up Windows 8.1 every X minutes.
Assuming that your app turns Windows 8.1 back into standby mode.

Carroll answered 11/8, 2014 at 15:19 Comment(1)
That's not desirable. The point of the requirement is to conserve battery. And now I need to spent additional battery to power an Always-On device, RPy being worse than Arduino. In addition, my windows device has to wake periodically frequently. If there were a way to wake the device by code, it would be able to be optimal in power consumption, as the code can be invoked by push notification, when we know for sure it is necessary to wake up.Elutriate

© 2022 - 2024 — McMap. All rights reserved.