Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   Shutting Down a Robot-Mounted Pi (http://www.chiefdelphi.com/forums/showthread.php?t=143690)

dc74089 12-02-2016 11:09

Shutting Down a Robot-Mounted Pi
 
Hi all,

We're planning on using a Raspberry Pi on the robot this year, but we're having trouble wrapping our heads around how to properly shut it down when the robot shuts off. Linux systems HATE having their power just pulled, so we've been trying to find a way to prevent corruption every time we shut off the robot.

We've been trying to get the Pi to mount its filesystem as read-only, but when we do that, networking disappears (and we need Ethernet working). Neither Stack Exchange nor the rest of the internet seems to have any remedy that has worked for us.

Teams that have used a robot-mounted Pi, how have you made sure that the Pi doesn't get corrupted when the robot power is turned off?

RyanN 12-02-2016 11:17

Re: Shutting Down a Robot-Mounted Pi
 
Quote:

Originally Posted by dc74089 (Post 1539105)
Hi all,

We're planning on using a Raspberry Pi on the robot this year, but we're having trouble wrapping our heads around how to properly shut it down when the robot shuts off. Linux systems HATE having their power just pulled, so we've been trying to find a way to prevent corruption every time we shut off the robot.

We've been trying to get the Pi to mount its filesystem as read-only, but when we do that, networking disappears (and we need Ethernet working). Neither Stack Exchange nor the rest of the internet seems to have any remedy that has worked for us.

Teams that have used a robot-mounted Pi, how have you made sure that the Pi doesn't get corrupted when the robot power is turned off?

Honestly I have never had a problem. The RPi shouldn't be doing any critical system tasks when processing vision stuff. I've shut it down most of the time by pulling the power.

Sure, there are risks involved... but think about it this way. What does the RoboRIO run? What about your home router? (Answer is Linux).

Most of the time we just pull the power on those and expect them to come back up. I expect no different from the RPi.

techhelpbb 12-02-2016 11:18

Re: Shutting Down a Robot-Mounted Pi
 
Here's one way

JohnFogarty 12-02-2016 11:20

Re: Shutting Down a Robot-Mounted Pi
 
Our team is using a Pi on our robot this year and found that issues with corruption don't exist, as long as the Pi isn't reading/writing important files when the power is pulled.

Your statement about Linux systems "Hating" having their power pulled is generally false. Think of all the devices in your life that run Linux that have their power pulled and never skip a beat...wireless routers, car computers, the RoboRIO, phones, Smart TV's.

dc74089 12-02-2016 11:24

Re: Shutting Down a Robot-Mounted Pi
 
I know for certain the RoboRIO OS is hardened to be able to accept a sudden shutdown, and I'd assume any decent home router was designed with the thought that they shouldn't expect a graceful shutdown.

Raspbian has corrupted SDs on me in the past, but if teams haven't had issues with FRC-related tasks, I guess it's worth a try. Thanks!

anthonyttu 12-02-2016 11:28

Re: Shutting Down a Robot-Mounted Pi
 
Is there a specific reason you want the Pi to be powered off when the robot is turned off?
I read the rules as you would be allowed to have an additional battery on the robot to power the Pi alone.


According the R31
"Additionally, batteries integral to and part of a COTS computing device or self-contained camera are also permitted (e.g. laptop batteries, GoPro style camera, etc.), provided they’re only used to power the COTS computing device and any peripheral COTS USB input devices connected to the COTS computing device and they are securely fastened to the ROBOT."

techhelpbb 12-02-2016 11:31

Re: Shutting Down a Robot-Mounted Pi
 
Quote:

Originally Posted by anthonyttu (Post 1539120)
Is there a specific reason you want the Pi to be powered off when the robot is turned off?
I read the rules as you would be allowed to have an additional battery on the robot to power the Pi alone.


According the R31
"Additionally, batteries integral to and part of a COTS computing device or self-contained camera are also permitted (e.g. laptop batteries, GoPro style camera, etc.), provided they’re only used to power the COTS computing device and any peripheral COTS USB input devices connected to the COTS computing device and they are securely fastened to the ROBOT."

Can you show me where you bought a Raspberry PI with an integral battery?
Integral means like the battery that comes with your laptop.

This topic has been done extensively elsewhere on the forum.
Adding a battery to the Raspberry PI violates the rules unless you can buy a package from somewhere that has the PI and the battery packaged together. That source (store) needs to be able to sell to the general public.

GeeTwo 12-02-2016 11:37

Re: Shutting Down a Robot-Mounted Pi
 
Quote:

Originally Posted by anthonyttu (Post 1539120)
Is there a specific reason you want the Pi to be powered off when the robot is turned off?
I read the rules as you would be allowed to have an additional battery on the robot to power the Pi alone.


According the R31
"Additionally, batteries integral to and part of a COTS computing device or self-contained camera are also permitted (e.g. laptop batteries, GoPro style camera, etc.), provided they’re only used to power the COTS computing device and any peripheral COTS USB input devices connected to the COTS computing device and they are securely fastened to the ROBOT."

This only applies when the battery is "integral to and part of a COTS computing device". Most (perhaps all?) COTS raspberry pis accept a power plug, and do not have an integrated battery. If you could somehow make the case that a USB power pack was a computing device (or camera), you could use it to power the pi over USB.

techhelpbb 12-02-2016 11:37

Re: Shutting Down a Robot-Mounted Pi
 
Quote:

Originally Posted by JohnFogarty (Post 1539114)
Our team is using a Pi on our robot this year and found that issues with corruption don't exist, as long as the Pi isn't reading/writing important files when the power is pulled.

Your statement about Linux systems "Hating" having their power pulled is generally false. Think of all the devices in your life that run Linux that have their power pulled and never skip a beat...wireless routers, car computers, the RoboRIO, phones, Smart TV's.

Did you consider the swap file when you wrote this?

http://raspberrypimaker.com/adding-s...e-raspberrypi/

Jared 12-02-2016 11:39

Re: Shutting Down a Robot-Mounted Pi
 
The file system on the SD card does have a chance of being corrupted if there is a power loss during a write operation. Just because "we did it one time and it worked" doesn't mean it's a good solution. Also, *nix powered things like phones, routers, and others have features to protect from this type of corruption that the Pi doesn't have, so it's not a good comparison.

engunneer 12-02-2016 11:39

Re: Shutting Down a Robot-Mounted Pi
 
The issue is not with linux but the SD card. R-Pis have a tendency to bork the SD file system if shut down at the wrong time. I recommend to my students to have a complete clone of the working system SD card, which NEVER goes in a Pi. If the one in the Pi gets corrupted, reclone the master copy on to it, and everything is exactly as it was.

the master is made by taking the latest working pi card and shutting down properly before cloning to master. when doing software updates, have two masters. one is the last working rev, and the other is the current working rev.

Also, faster and more expensive SD cards tend to corrupt less (anecdotally)

Lastly, to answer the OP, I'd send a signal from the roboRio to the Pi at end of match to request a clean shutdown, then it will be powered down by the time you get to your robot during field reset. Most other cases can be covered by the onboard power switch linked to above. You still will have cases of unexpected power loss, but the less often it happens, the better.

knowing how long your electronics take to boot and shutdown nicely is really important.

dc74089 12-02-2016 12:31

Re: Shutting Down a Robot-Mounted Pi
 
Quote:

Originally Posted by techhelpbb (Post 1539128)
Did you consider the swap file when you wrote this?

http://raspberrypimaker.com/adding-s...e-raspberrypi/

Yes, most of the guides I followed on how to make the file system read only said to disable swap in the boot config.

anthonyttu 12-02-2016 12:34

Re: Shutting Down a Robot-Mounted Pi
 
Quote:

Originally Posted by techhelpbb (Post 1539122)
Can you show me where you bought a Raspberry PI with an integral battery?
Integral means like the battery that comes with your laptop.

This topic has been done extensively elsewhere on the forum.
Adding a battery to the Raspberry PI violates the rules unless you can buy a package from somewhere that has the PI and the battery packaged together. That source (store) needs to be able to sell to the general public.


All of these teams have 3D printers and are not interested in a revenue source entrepreneurs award.

If nobody wants to jumps on this I'll start a company tomorrow to sell you one.

techhelpbb 12-02-2016 12:50

Re: Shutting Down a Robot-Mounted Pi
 
Quote:

Originally Posted by anthonyttu (Post 1539174)
All of these teams have 3D printers and are not interested in a revenue source entrepreneurs award.

If nobody wants to jumps on this I'll start a company tomorrow to sell you one.

Need a website and other stuff to prove you have a proper business for the general public. It's not actually that hard: I just am too busy with other things to sell an assembled Raspberry PI in the case with the battery to someone.

Worse there's nothing stopping someone then from placing a really big order which means unless you have a large pile of the Raspberry PI handy...

JohnFogarty 12-02-2016 13:45

Re: Shutting Down a Robot-Mounted Pi
 
Quote:

Originally Posted by techhelpbb (Post 1539122)
Can you show me where you bought a Raspberry PI with an integral battery?
Integral means like the battery that comes with your laptop.

This topic has been done extensively elsewhere on the forum.
Adding a battery to the Raspberry PI violates the rules unless you can buy a package from somewhere that has the PI and the battery packaged together. That source (store) needs to be able to sell to the general public.

I searched, where is this discussion? Where's the QA question?


All times are GMT -5. The time now is 19:43.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi