locked
Win 10 IoT and Raspberry Pi: GPIO Power-on Capability? RRS feed

  • Question

  • Hi, I am getting started with trying Windows 10 IoT Core with a Raspberry Pi as a prototype medical device system to capture and trend various patient data.

    This seems like a silly question, but how what kind of functionality does Win 10 IoT have for powering on the Raspberry Pi once it has safely shut down? With Raspbian, there are one-line Python scripts that will monitor GPIO pins for a change in state used to power the Pi on and Off. However, I couldn't find anything in the Win10 IoT Core documentation that addresses this kind of functionality.

    Thanks


    • Edited by Elite83 Thursday, March 7, 2019 5:02 PM
    Thursday, March 7, 2019 5:02 PM

All replies

  • Hello Elite83,

    >>>With Raspbian, there are one-line Python scripts that will monitor GPIO pins for a change in state used to power the Pi on and Off.

    After the Raspberry Pi has been shut down how does the GPIO pin change state?

    Do you mean wake up Raspberry Pi from sleep/hibernate mode periodically?

    If I understand right, there are two possible ways to wake up the device:

    1. Wake when a user touches the touchscreen. This need user interaction.
    2. There is a RUN pin (two holes) and shot two holes can restart the Raspberry Pi.

    If I misunderstand, can you provide a link of "one-line Python scripts ... power the Pi on and Off" in order to show exactly things you want to do?

    Please let me know if it helps.

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, March 8, 2019 2:16 AM
  • To make sure we are on the same page: 

    When I say "power on" I am referring to the state in which the Rpi is after clicking "Shutdown" from the Win 10 IoT menu. However, if it is more correct to refer to this state as "hibernate" than sure--wake from hibernate. 

    I am asking if the Windows 10 IoT has software functionality baked into the kernel that permits a "safe" shutdown and boot for a full power-cycle via hardware interface akin to a pushbutton on a regular desktop PC.

    Interacting directly with the "RUN" pins is not an option because they force a "hard" shutdown/reboot potentially corrupting the SD card. 

    For those using Raspbian such options exist: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=206921#p1280779



    • Edited by Elite83 Sunday, March 10, 2019 4:39 PM
    Sunday, March 10, 2019 4:38 PM
  • Hello Elite83,

    There is no such "Power button" (like PC has) supported of out box on Windows IoT Core. You can submit a feedback.

    There maybe a workaround:

    For safe shutdown you can use UWP api ShutdownManager.BeginShutdown. You can add a background application that monitor one GPIO state and shutdown the device via call this api.

        public sealed class StartupTask : IBackgroundTask
        {
            public void Run(IBackgroundTaskInstance taskInstance)
            {
                var deferral = taskInstance.GetDeferral();
                GpioPin powerPin = GpioController.GetDefault().OpenPin(5);
                powerPin.SetDriveMode(GpioPinDriveMode.Input);
                while (true)
                {
                    if (powerPin.Read() == GpioPinValue.High)
                    {
                        ShutdownManager.BeginShutdown(ShutdownKind.Shutdown, TimeSpan.FromMilliseconds(0));
                    }
                }
            }
        }

    For boot, you may need a additional hardware logic to send power supply to the device when you push a button.

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.




    Monday, March 11, 2019 5:54 AM
  • I also had this qustion. I also placed a feedback, still nothing.

    Here is link to the post with my findings. If I understand correctly is the same thing you want to achieve.

    https://social.msdn.microsoft.com/Forums/en-US/deec2cc3-e36d-40b0-9105-cc6737402666/raspberry-pi-wake-up-from-shutdown-state?forum=WindowsIoT#deec2cc3-e36d-40b0-9105-cc6737402666 


    • Edited by Alex Iordan Thursday, March 14, 2019 8:55 AM
    Thursday, March 14, 2019 8:55 AM