This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
5v UPS
#18
(2017-11-18, 03:09 PM)abarrow Wrote: Yes, I did misunderstand your setup for shutdown. The reason I was thinking that a microcontroller might be good is when I was thinking through the logic of when a clean shutdown might be required. For example, I might want my pi to ride through a momentary power loss of a few seconds, and then if the power loss persists, send a shutdown signal via GPIO. Also, it might be useful in extreme cases to have a power switch that would allow me to initiate a clean shutdown with a single momentary press, and a forced power off when the button is held for 10 seconds, like on a PC.

Sent from my P027 using Tapatalk

You can implement all of this logic in the pi.
Connect your main power to a gpio pin (keep in mind the max. voltage of the gpio and besides that use a pull down resistor). Set up an interrupt handler for the pin. If pin is low (means main power is out) start an timer. After your selected time is up start the shutdown.
A shutdown button can be arranged aside of that pretty easily. But there is no forced shutdown possibility like in your desktop PC. This forced shutdown is executed by the mainboard and there is no similar function for the pi. All you can do is cut off the power.
If you got a ups that tries to shutdown the pi, waits for a minute and kills the power afterwards, you won't need to worry about the shutdown. 
Just get a switch for the main power. If its switched the pi tries the clean shutdown. In case off a system crash the power gets cut by the ups anyway.
Reply


Messages In This Thread
5v UPS - by PaddyB - 2017-11-12, 08:46 PM
RE: 5v UPS - by shipahoy - 2017-11-13, 08:55 AM
RE: 5v UPS - by PaddyB - 2017-11-13, 10:44 AM
RE: 5v UPS - by shark24 - 2017-11-13, 02:06 PM
RE: 5v UPS - by abarrow - 2017-11-14, 03:31 PM
RE: 5v UPS - by shipahoy - 2017-11-13, 08:35 PM
RE: 5v UPS - by shark24 - 2017-11-13, 09:16 PM
RE: 5v UPS - by abarrow - 2017-11-13, 10:17 PM
RE: 5v UPS - by shark24 - 2017-11-13, 11:03 PM
RE: 5v UPS - by JD1 - 2017-11-13, 11:16 PM
RE: 5v UPS - by shark24 - 2017-11-13, 11:33 PM
RE: 5v UPS - by abarrow - 2017-11-14, 12:31 AM
RE: 5v UPS - by shark24 - 2017-11-14, 03:40 PM
5v UPS - by tocan - 2017-11-14, 05:37 PM
RE: 5v UPS - by shark24 - 2017-11-15, 09:40 AM
RE: 5v UPS - by tocan - 2017-11-16, 02:19 AM
RE: 5v UPS - by abarrow - 2017-11-18, 03:09 PM
RE: 5v UPS - by shark24 - 2017-11-18, 08:19 PM
RE: 5v UPS - by Sailoog - 2017-11-19, 01:30 PM
RE: 5v UPS - by shipahoy - 2017-11-19, 03:43 PM
RE: 5v UPS - by JD1 - 2017-11-19, 04:36 PM
RE: 5v UPS - by shipahoy - 2017-11-19, 07:52 PM
RE: 5v UPS - by tocan - 2017-11-19, 11:13 PM
RE: 5v UPS - by shipahoy - 2017-11-20, 03:46 PM
RE: 5v UPS - by shark24 - 2017-11-20, 04:23 PM
RE: 5v UPS - by shipahoy - 2017-11-20, 04:39 PM
RE: 5v UPS - by tocan - 2017-11-20, 08:31 PM
RE: 5v UPS - by marko_st - 2018-01-28, 06:27 AM
RE: 5v UPS - by SkipperEarly - 2018-02-02, 05:45 AM
VNC on iPad. - by marko_st - 2018-02-02, 04:58 PM
RE: 5v UPS - by Sailoog - 2018-02-05, 09:21 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)