informed
Posts: 128
Joined: Mon Oct 26, 2015 6:24 pm

On/off via UI

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?

klricks
Posts: 6627
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: On/off via UI

Sat Dec 22, 2018 1:02 am

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.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

User avatar
DougieLawson
Posts: 36578
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: On/off via UI

Sat Dec 22, 2018 8:27 am

If you want software based power control, spend £15.
http://www.uugear.com/product/wittypi2/
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

PhatFil
Posts: 1440
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: On/off via UI

Sat Dec 22, 2018 9:36 am

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.

Return to “Other programming languages”