php-freak
Posts: 8
Joined: Wed Oct 17, 2012 8:56 am

Boot up raspberry pi from outside

Wed Feb 27, 2013 9:01 pm

Hello,
I have an idea for my Pi. I want to use it to figure as a backup server. The code works fine (I backup all my webspaces and servers via FTP). But the problem is, that I just want to start my Pi every night and shut it down when its ready. Therfore I had the idea to use a tiny Arduino microcontroller. I want to let him count the time and one time a day it will switch on the power. When its ready, I though about reboot it and the microcontroller measures the current. When it low it switch the power off and start counting again.

Know I want to ask you guys wheather my idea is possible or if there is even a greater solution to do that.

Thank you very much for your help!

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: Boot up raspberry pi from outside

Wed Feb 27, 2013 9:21 pm

If the Pi is running 24 hours a day, it is still not using much power. I just wouldn't bother.

HOWEVER... ( :mrgreen: )

For a cheap, nasty, kludgy, hacky, bonehead, easy, lazy, practical solution...

I would do this:

* Set up a script and/or cron job to shut your Pi down whenever you want it shut down.
* Buy one of these: http://tinyurl.com/i-am-lazy-with-my-pi

And program it to turn off about 5 minutes after your Pi shuts down, and to turn on at the time you want the Pi back on.

I have seen them for $3 or $4 at hardware stores. Plug it in, flip the switches, schedule the Pi to do a shutdown -h at the right time, and BAM - the dirt is gone.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Boot up raspberry pi from outside

Wed Feb 27, 2013 9:28 pm

This is definitely possible to do just how you go about it as another matter.
One solution would be to purchase a digital timer switch like this one http://www.amazon.co.uk/Green-Digital-E ... B007XSFVLA
Set the time and days you wish the Pi to switch on then provide a suitable duration for the Pi to perform it's backup and to safely shutdown i.e. 2 hours before the power is turned off.
If however you wish to kill the power exactly after the Pi shuts down then you'll need to build some kind of electronic circuit to interface the Pi with the timer switch.

Fortunately detecting the running state of the Pi is quite straightforward you only need to check the voltage output at GIO14 (TXD).
If the Pi is running this would output 3.3v when the Pi has shutdown, performing a reboot or just switching itself on (1 sec?) then the output is 0v.
Most digital timer switches have an on / off override button so basically you need to interface this button with an opto-coupler (to isolate the Pi from high voltages) and make contact when the Pi turns itself off.

Richard S.

php-freak
Posts: 8
Joined: Wed Oct 17, 2012 8:56 am

Re: Boot up raspberry pi from outside

Wed Feb 27, 2013 9:49 pm

Fist, thank you for the fast and detailed replys. I know that the power consumption of the Pi is low but I think its a great projekt and will increase the lifetime. Thank you for the hint with the GPIO14. Does anybody know any digital timer switch with an override/trigger function?

baker556
Posts: 44
Joined: Sun Feb 17, 2013 6:57 pm

Re: Boot up raspberry pi from outside

Fri Mar 01, 2013 11:03 pm

Could you not some how send the pi in to hibernate/suspend then just use packets to wake it up.

baker556
Posts: 44
Joined: Sun Feb 17, 2013 6:57 pm

Re: Boot up raspberry pi from outside

Fri Mar 01, 2013 11:06 pm

Although reading this..

http://www.raspberrypi.org/phpBB3/viewt ... 188#p81188

It uses more power if it was shut down than being on.

Probably would need a plug in timer switch if you wanted to save power/money.

If it was just for the fact you want it shutdown for security use some kind of sleep script then set it to wake up on lan by forwarding some packets.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Boot up raspberry pi from outside

Wed Mar 06, 2013 4:31 pm

Just letting you know I modified one of my digital timer switches today (Micromark MM9539) this device was quite easy to hack to override the relay, I wouldn't be surprised if other devices followed the same design.
Inside it has 2 parts the relay circuit and the timer circuit all connected together by 3 wires: Vss, Vgg, signal otherwise better known as +Vcc, Gnd, signal.
The clock part controls the relay by providing a voltage output at signal, ~1.20v to turn on the relay and 0v to turn it off.
I added an opto-coupler to signal via a 220k resistor and to +Vcc, now when I apply the require current to my opto-coupler LED side I can force the relay to turn on even though the timer circuit says off.
I haven't wired this to GPIO 14 yet but I don't see why it wouldn't work.

So basically you can now set an on time with your digital switch but ultimately the Pi will keep the switch active until it has fully shutdown. :)

Richard S.

Return to “Other projects”