|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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? |
|
#2
|
||||
|
||||
|
Re: Shutting Down a Robot-Mounted Pi
Quote:
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. |
|
#3
|
||||
|
||||
|
Re: Shutting Down a Robot-Mounted Pi
|
|
#4
|
||||
|
||||
|
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! |
|
#5
|
|||||
|
|||||
|
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. |
|
#6
|
||||
|
||||
|
Re: Shutting Down a Robot-Mounted Pi
Quote:
http://raspberrypimaker.com/adding-s...e-raspberrypi/ |
|
#7
|
||||
|
||||
|
Re: Shutting Down a Robot-Mounted Pi
Quote:
|
|
#8
|
|||
|
|||
|
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." |
|
#9
|
||||
|
||||
|
Re: Shutting Down a Robot-Mounted Pi
Quote:
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. |
|
#10
|
||||
|
||||
|
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. |
|
#11
|
|||
|
|||
|
Re: Shutting Down a Robot-Mounted Pi
Quote:
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. |
|
#12
|
||||
|
||||
|
Re: Shutting Down a Robot-Mounted Pi
Quote:
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... |
|
#13
|
|||
|
|||
|
Re: Shutting Down a Robot-Mounted Pi
Quote:
So you say I'm almost guaranteed to sell a few hundred to prove I can keep up with demand? I'm not hearing the problem. Adafruit will sell me 85 per order |
|
#14
|
||||
|
||||
|
Re: Shutting Down a Robot-Mounted Pi
Quote:
![]() Are you done yet? (quoting an old college professor 10 minutes into every test) Can we buy one? Remember you need a way to charge that integrated battery as well. If you sell this under COTS there's no minimum sale requirement - just that people in general can buy them. If you take this product into FIRST approval that's a more complex and lengthy process you will not complete this season. Last edited by techhelpbb : 12-02-2016 at 14:33. |
|
#15
|
||||
|
||||
|
Re: Shutting Down a Robot-Mounted Pi
In 2012 we used a linux single-board computer on our robot and had to solve the shutdown problem. There are some details in this document:
http://www.chiefdelphi.com/forums/sh...ght=Kinect+987 Our final solution assumes that you've written a program on your vision processing computer that can respond to packets it recieves from the RoboRio or other computers. Our robot computer (crio at the time) sent a packet to the vision co-processor which caused it to run the shutdown script. We triggered all of this with a button on one of the joysticks at the drive station. For what it is, it was a lot of work to get right but we didn't want that 1 in a million chance of our vision computer corrupting its file system at the wrong time. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|