Page 1 of 1

On/off via UI

Posted: Fri Dec 21, 2018 11:31 am
by informed
Hi,

I will be using the Raspbian Lite OS.

I want my Users to be able to switch the device on/off.

I am using a battery source for the main application.

I was thinking of providing kiosk browser UI (which I found some sample code for) to allow the user to click on my virtual button to shut the device down when not in use.

But, 'durrh' just occurred how can i get my user to switch the device back on? Or should I be looking at some 'sleep' functionality rather than looking to completely power off?

Re: On/off via UI

Posted: Sat Dec 22, 2018 1:02 am
by klricks
informed wrote:
Fri Dec 21, 2018 11:31 am
Hi,

I will be using the Raspbian Lite OS.

I want my Users to be able to switch the device on/off.

I am using a battery source for the main application.

I was thinking of providing kiosk browser UI (which I found some sample code for) to allow the user to click on my virtual button to shut the device down when not in use.

But, 'durrh' just occurred how can i get my user to switch the device back on? Or should I be looking at some 'sleep' functionality rather than looking to completely power off?
A RPi does not have a 'sleep' mode.
When a proper shutdown command is issued the RPi enters a halt state which will still use some power.
An additional physical hardware switch is required to completely power off the RPi board. The simplest way to remove power is to use a multi outlet power strip to switch off AC mains to the power supply.
When power is restored the RPi will automatically boot.

Re: On/off via UI

Posted: Sat Dec 22, 2018 8:27 am
by DougieLawson
If you want software based power control, spend £15.
http://www.uugear.com/product/wittypi2/

Re: On/off via UI

Posted: Sat Dec 22, 2018 9:36 am
by PhatFil
fwiw i use a sonoff basic wifi relay switch flashed with tasmota firmware between the mains and my pi psu for a remote hard reset/startup options. https://github.com/arendst/Sonoff-Tasmota/wiki

the sonoff devices have a mobile phone app/gui out of the box which may satisfy your needs (ewelink available via apple/google stores - free)
If however you find it lacking in function you can flash the device with the tasmota project firmware which provides a web gui hosted by the device itself.