wibo
Posts: 1
Joined: Wed Sep 13, 2017 7:49 am

On/Off switch

Wed Sep 13, 2017 8:09 am

Hi there

I have created an windows UWP app to install it on a rp 3 running windows IoT.
That worked out ok. When I boot, the app starts/works like it should. Cool.

This app, will be used for real to show information on a TFT display (no real input, just getting data and displaying it).

Now I need a way to power on/power off the system since it should not run over night. Power consumption is no problem, but we don't want to risk any power device to cause a fire when no one is there.

The idea is the system is turned on in the morning, and turned off in the evening. This should be a manual operation since start/end ours are very flexible.

Off course, I can put a power supply with a power switch included in front of both screen and raspberry power adapters.
But, that is not what I want. Cutting the power like that will potentially screw up the SD card (i think!)

What I want to do, is include a "push" button in the by manually adding it to my RP plastic box.
When hit, it should boot or shut down, depending on it's state (running or not running).

I have read some topics, and it seems like powering on/off needs to by done by a script.
I don't get that idea, since turning off might work, but in the other direction: how can you run a script (to power up) when the OS is not running?

Also, if powering on/off should be done via script, how do I include this in my windows iot install?
I read some topics about a python script, but how can I use python scripts combined with the windows IoT boot files?
The only files now on the SD card (that is inserted in the RP 3) is pushed via the windows 10 IoT Core dashboard (install app, browse for app package). I have no idea where I should put those scripts ...

Can anyone help this lost soul to launch this crazy stuff for real?

Thanks!

User avatar
fruitoftheloom
Posts: 15065
Joined: Tue Mar 25, 2014 12:40 pm
Location: Bognor Regis UK

Re: On/Off switch

Fri Sep 15, 2017 9:21 pm

wibo wrote: Hi there

I have created an windows UWP app to install it on a rp 3 running windows IoT.
That worked out ok. When I boot, the app starts/works like it should. Cool.

This app, will be used for real to show information on a TFT display (no real input, just getting data and displaying it).

Now I need a way to power on/power off the system since it should not run over night. Power consumption is no problem, but we don't want to risk any power device to cause a fire when no one is there.

The idea is the system is turned on in the morning, and turned off in the evening. This should be a manual operation since start/end ours are very flexible.

Off course, I can put a power supply with a power switch included in front of both screen and raspberry power adapters.
But, that is not what I want. Cutting the power like that will potentially screw up the SD card (i think!)

What I want to do, is include a "push" button in the by manually adding it to my RP plastic box.
When hit, it should boot or shut down, depending on it's state (running or not running).

I have read some topics, and it seems like powering on/off needs to by done by a script.
I don't get that idea, since turning off might work, but in the other direction: how can you run a script (to power up) when the OS is not running?

Also, if powering on/off should be done via script, how do I include this in my windows iot install?
I read some topics about a python script, but how can I use python scripts combined with the windows IoT boot files?
The only files now on the SD card (that is inserted in the RP 3) is pushed via the windows 10 IoT Core dashboard (install app, browse for app package). I have no idea where I should put those scripts ...

Can anyone help this lost soul to launch this crazy stuff for real?

Thanks!
wibo wrote:
Wed Sep 13, 2017 8:09 am
Hi there

I have created an windows UWP app to install it on a rp 3 running windows IoT.
That worked out ok. When I boot, the app starts/works like it should. Cool.

This app, will be used for real to show information on a TFT display (no real input, just getting data and displaying it).

Now I need a way to power on/power off the system since it should not run over night. Power consumption is no problem, but we don't want to risk any power device to cause a fire when no one is there.

The idea is the system is turned on in the morning, and turned off in the evening. This should be a manual operation since start/end ours are very flexible.

Off course, I can put a power supply with a power switch included in front of both screen and raspberry power adapters.
But, that is not what I want. Cutting the power like that will potentially screw up the SD card (i think!)

What I want to do, is include a "push" button in the by manually adding it to my RP plastic box.
When hit, it should boot or shut down, depending on it's state (running or not running).

I have read some topics, and it seems like powering on/off needs to by done by a script.
I don't get that idea, since turning off might work, but in the other direction: how can you run a script (to power up) when the OS is not running?

Also, if powering on/off should be done via script, how do I include this in my windows iot install?
I read some topics about a python script, but how can I use python scripts combined with the windows IoT boot files?
The only files now on the SD card (that is inserted in the RP 3) is pushed via the windows 10 IoT Core dashboard (install app, browse for app package). I have no idea where I should put those scripts ...

Can anyone help this lost soul to launch this crazy stuff for real?

Thanks!
As you appear to have found on/off solutions are geared towards Linux:

http://www.uugear.com/product/wittypi2/
My only "PC" is an Asus ChromeBit running ChromeOS, cloudcentric at its best !
Rockchip Quad-Core RK3288C SoC as used in ASUS Chromebook C201 & Chromebook Flip C100PA as well as the Tinker SBC.
3 Mobile Huawei E5330 Mobile Mi-Fi

User avatar
Douglas6
Posts: 4136
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: On/Off switch

Fri Sep 15, 2017 11:46 pm

Pimoroni also have an inexpensive solution: https://shop.pimoroni.com/collections/r ... onoff-shim

User avatar
Clanzer
Posts: 27
Joined: Wed Jun 13, 2012 1:42 pm
Location: UK
Contact: Website

Re: On/Off switch

Mon Sep 18, 2017 2:36 pm

You can use the Windows.System.ShutdownManager class from within your code.

https://marcominerva.wordpress.com/2016 ... a-uwp-app/

So either monitor a button attached to one of the GPIO pins or put a software button on screen that is hidden or has password protection on it.

Cheers

Sean
******************************
http://www.pthat.com
******************************

Return to “Windows 10 for IoT”

Who is online

Users browsing this forum: No registered users and 9 guests