Unit Off/On?

Raspberry Pi related support

Unit Off/On?

Postby vulpespersona » 31 Dec 2015, 17:14

This seems like a silly question, please forgive me if it's very obvious but how do I turn the unit back on once I shut it down from the menu?

I'm running a headless pi 2 through a wifi dongle with a usb drive that stores my music files. I see the reboot command in the menu, but other than unplugging the unit and having it reboot itself (which I gather tends to potentially damage the SD card or unit?) I'm not sure how to turn it back on 'correctly'.

In general do most people keep their units on all the time? Maybe reboot once a week or so as needed? Or is it best to turn it off at night and back on in the morning? Using this as a music server I assume it will be on most of the time plugged into my usb drive which will also be on (plugged in). It seems after a few days running the system I built that while the unit is on and ready to go, the web based interface typically benefits from a refresh (sometimes a reboot) to work best.

In general what is the best practice to retain the SD card and avoid possible power supply issues?

Thanks

Ben
vulpespersona
 
Posts: 14
Joined: 31 Dec 2015, 00:43

Re: Unit Off/On?

Postby den_hr » 01 Jan 2016, 14:00

I can provide my experience, perhaps it might help:

I'm using several RasPi + RuneAudio combinations, all in separate enclosures - and every enclosure/case has a power on/off switch.
I don't leave the server (RasPi) turned on all the time - which seems to be what you are asking....

In short, I turn off the server via UI (shutdown command) or using my IR remote. Once the system has shut down completely, I turn off the power on the power switch.
I've implemented a simple indicator which tells me when the unit (server) is ready to use after power on, and the same indicator (LED) is used to tell me when the shutdown has completed, and it is safe to turn of the power completely using the power switch. I've implemented it by tying a LED to GPIO14 (TxD pin), which I control and monitor using a simple bash script.
When the shutdown process is complete, GPIO14 (TxD pin) turns off, and with it my LED - so I know it's safe to turn off the power switch...

In general, you could leave the unit (RasPi) plugged in all the time (i.e. connected to 5V power), but to turn it on again, as you noticed, you'll need to reset it. Instead of unplugging it and pluggin it in again, you could implement a simple reset switch - instructions here: http://raspi.tv/2012/making-a-reset-switch-for-your-rev-2-raspberry-pi

So, you can turn it off using web UI, and to turn it on again, just press the reset switch....

As for the longevity of SD card, make sure you do not unplug RasPi before the system has shut down completely. Also, if your house power is prone to brownouts/blackouts, you might need some kind of UPS/battery backup to avoid SD card damage due to forcible "unplugging" the power (which happens when you have a blackout) - same as any other computer... Although the RasPi SD card seems to be a bit more prone to damage in such cases.
In short, do not unplug it from power source before it has shut down completely.... It might survive two or three such forcible power cutoffs, but you're generally asking for trouble....

Mind you, there are some RasPi distros which can be safely turned off by simply cutting off the power (unplugging), without needing a "proper" shutdown first - PiCoreplayer is one of them: https://sites.google.com/site/picoreplayer/home - that's because they run completely from RAM, nothing is being written to the SD card at all...
den_hr
 
Posts: 52
Joined: 06 Feb 2015, 17:10
Location: Croatia

Re: Unit Off/On?

Postby vulpespersona » 02 Jan 2016, 01:05

This is extremely helpful information, i appreciate your reply. I will look into installing a switch on my unit.
vulpespersona
 
Posts: 14
Joined: 31 Dec 2015, 00:43

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 5 guests