Go to Post what is integration if not a compromise? - Kris Verdeyen [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 12-02-2016, 13:48
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,622
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

Quote:
Originally Posted by JohnFogarty View Post
I searched, where is this discussion? Where's the QA question?
http://www.chiefdelphi.com/forums/sh...hlight=battery

Also this from me in that topic:
http://www.chiefdelphi.com/forums/sh...1&postcount=45

See later pages there are others on the forum about this.
I don't have my fingers on the old official QA you'd have to dig that up and look but I meant this forum when I wrote this:
"This topic has been done extensively elsewhere on the forum."

If I really need to I am sure I can dig up that old e-mail from FIRST headquarters.

Last edited by techhelpbb : 12-02-2016 at 13:55.
  #17   Spotlight this post!  
Unread 12-02-2016, 13:51
JohnFogarty's Avatar
JohnFogarty JohnFogarty is offline
Trapped under a pile of MECANUMS :P
AKA: @doctorfogarty
FTC #11444 (Garnet Squadron) & FRC#1102 (M'Aiken Magic)
Team Role: Mentor
 
Join Date: Aug 2009
Rookie Year: 2006
Location: SC
Posts: 1,577
JohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

Quote:
Originally Posted by techhelpbb View Post
http://www.chiefdelphi.com/forums/sh...hlight=battery

See later pages there are others on the forum about this.
I don't have my fingers on the old official QA you'd have to dig that up and look but I meant this forum when I wrote this:
"This topic has been done extensively elsewhere on the forum."
I literally typed the title of that thread and it didn't come up. Wow, thanks.
__________________
John Fogarty
2010 FTC World Championship Winner & 2013-2014 FRC Orlando Regional Winner
Mentor FRC Team 1102 M'Aiken Magic
"Head Bot Coach" FTC Team 11444 Garnet Squadron
Former Student & Mentor FLL 1102, FTC 1102 & FTC 3864, FRC 1772, FRC 5632
2013 FTC World Championship Guest Speaker
  #18   Spotlight this post!  
Unread 12-02-2016, 13:59
anthonyttu anthonyttu is offline
Texas Instruments Engineer
AKA: Master Chief
FRC #5417 (Eagle Robotics)
Team Role: Mentor
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Dallas
Posts: 62
anthonyttu has a spectacular aura aboutanthonyttu has a spectacular aura about
Re: Shutting Down a Robot-Mounted Pi

Quote:
Originally Posted by techhelpbb View Post
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...

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
  #19   Spotlight this post!  
Unread 12-02-2016, 14:22
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,685
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

I don't know the RoboRIO ecosystem, but I do know Linux and Java.

Code:
ssh user:password@rpihost 'sudo shutdown -h now'
You're possibly better off putting the shutdown command into a shell script so you can attempt to kill the processes 'nicely' first, then issue the shutdown - all within the script. The script would live on the raspberry pi, so your RoboRIO code doesn't have to care how the R-PI stuff shuts down, ever.

Add this when you detect end of match presuming you go the script route:
Code:
java.lang.ProcessBuilder processBuilder = new java.lang.ProcessBuilder("ssh", "user:password@rpihost","/path/to/script.bash");
java.lang.Process p = pb.start();
p.waitFor(); // WARNING - will block this thread.  Also, will only block this thread.
System.out.println("R-PI shutdown executed");
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
  #20   Spotlight this post!  
Unread 12-02-2016, 14:26
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,622
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

Quote:
Originally Posted by anthonyttu View Post
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
What are you waiting for
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.
  #21   Spotlight this post!  
Unread 12-02-2016, 14:37
Hjelstrom's Avatar
Hjelstrom Hjelstrom is offline
Mentor
FRC #0987 (High Rollers)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2005
Location: Las Vegas
Posts: 147
Hjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond repute
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.
  #22   Spotlight this post!  
Unread 12-02-2016, 16:49
JohnFogarty's Avatar
JohnFogarty JohnFogarty is offline
Trapped under a pile of MECANUMS :P
AKA: @doctorfogarty
FTC #11444 (Garnet Squadron) & FRC#1102 (M'Aiken Magic)
Team Role: Mentor
 
Join Date: Aug 2009
Rookie Year: 2006
Location: SC
Posts: 1,577
JohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

Has anyone looked into the legality of this?

http://www.modmypi.com/raspberry-pi/...dules/ups-pico

I'm going to ask on the Q&A myself tonight.
__________________
John Fogarty
2010 FTC World Championship Winner & 2013-2014 FRC Orlando Regional Winner
Mentor FRC Team 1102 M'Aiken Magic
"Head Bot Coach" FTC Team 11444 Garnet Squadron
Former Student & Mentor FLL 1102, FTC 1102 & FTC 3864, FRC 1772, FRC 5632
2013 FTC World Championship Guest Speaker
  #23   Spotlight this post!  
Unread 12-02-2016, 17:03
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,622
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

Quote:
Originally Posted by JohnFogarty View Post
Has anyone looked into the legality of this?

http://www.modmypi.com/raspberry-pi/...dules/ups-pico

I'm going to ask on the Q&A myself tonight.
What worries me about that is the battery does not appear to have a fuse between it and the rest of the system. So that's the sort of battery I wouldn't want to overload and there are exposed pins that could overload that battery all over the place.
  #24   Spotlight this post!  
Unread 13-02-2016, 00:09
engunneer's Avatar
engunneer engunneer is offline
Alumni turned Mentor
AKA: Branden Gunn
FRC #4761
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1996
Location: Reading, MA
Posts: 862
engunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

I await the Q&A response, but I expect this would not be legal, as it's not integral to the cots computing device. It's an add-on, but I suspect it is just outside the line. Could be an interesting option if they rule it legal.
__________________
Student FRC23 (1996-1999), Mentor FRC246 (2000), Mentor FRC1318 (2007-2009), Mentor FRC93 (2011), Mentor FRC2151 (2012), Mentor FRC23 (2013), Mentor FRC4761 (2014-2017)
1998 - National Chairman's Award and Woodie Flowers Award (FRC23, Mike Bastoni ) | 2007 - PNW SF (488, 1595) | 2008 - Oregon RCA - Seattle #2 Seed, SF (488, 1696) | 2009 - Oregon #1 Seed, Winners (1983, 2635) - Seattle SF (945, 2865) - Galileo #2 Seed, SF (973, 25) | 2012 Midwest F (111, 71) | 2014 RIDE Winners (78, 125), Inspector - NEU #24, QF (3479, 3958) - NECMP #35 | 2015 Reading #11, SF (1058, 190), Inspector - RIDE #17, QF(4055, 5494), Inspector - NECMP #57 | 2016 Reading #4, SF (133, 4474), DCA, Inspector - Ride #22, SF (1735, 2067), Creativity, Inspector - NECMP #48, RCA - Archimedes
  #25   Spotlight this post!  
Unread 13-02-2016, 00:30
viggy96 viggy96 is offline
Registered User
FRC #3331
Team Role: College Student
 
Join Date: Jan 2015
Rookie Year: 2010
Location: Charlotte
Posts: 54
viggy96 is infamous around these partsviggy96 is infamous around these parts
Re: Shutting Down a Robot-Mounted Pi

Quote:
Originally Posted by dc74089 View Post
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?
That statement regarding Linux systems is fasee. If anything, Windows cares about having its power pulled. Linux couldn't care less. I have dealt with a variety of Linux distributions, and have unplugged, forced shutdown many of them. Linux doesn't care, it just works. Linux FTW.
  #26   Spotlight this post!  
Unread 13-02-2016, 01:10
Foster Foster is offline
Engineering Program Management
VRC #8081 (STEMRobotics)
Team Role: Mentor
 
Join Date: Jul 2007
Rookie Year: 2005
Location: Delaware
Posts: 1,393
Foster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

/sigh. No computer system that I've used from mainframes to Raspberry Pi, from MCP to Unix, including Windows and Linux deals well with hard power off when there are IOs in process. You've been lucky.

Lots of people have borked the SD card in a Raspberry Pi. The OP asked a good question, and people are trying to help. Your "whistling in the dark" isn't productive and I predict that someday you will either spend the night hand sewing inodes to restore a file system, or spend most of the day hoping your backup system really works while you boss yells at you about lost orders.
__________________
Foster - VEX Delaware - 17 teams -- Chief Roboteer STEMRobotics.org
2010 - Mentor of the Year - VEX Clean Sweep World Championship
2006-2016, a decade of doing VEX, time really flies while having fun
Downingtown Area Robotics Web site and VEXMen Team Site come see what we can do for you.
  #27   Spotlight this post!  
Unread 13-02-2016, 01:56
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

Quote:
Originally Posted by viggy96 View Post
That statement regarding Linux systems is fasee. If anything, Windows cares about having its power pulled. Linux couldn't care less. I have dealt with a variety of Linux distributions, and have unplugged, forced shutdown many of them. Linux doesn't care, it just works. Linux FTW.
Please don't give out misleading information on the internet based off of personal experience. The raspberry pi has documented issues that occur when power is cut, and it runs Linux.

The issues is more about hardware than software. The FTL (flash transition layer) will remap storage on the fly as part of its wear leveling feature. If you kill power during a remapping, you pretty much lose the whole disk. This is different from flash storage on something like a roboRIO or a wireless router, which doesn't have that additional layer of abstraction.

Linux does care when its file system is no longer usable.
  #28   Spotlight this post!  
Unread 18-02-2016, 07:35
viggy96 viggy96 is offline
Registered User
FRC #3331
Team Role: College Student
 
Join Date: Jan 2015
Rookie Year: 2010
Location: Charlotte
Posts: 54
viggy96 is infamous around these partsviggy96 is infamous around these parts
Quote:
Originally Posted by Jared View Post
Please don't give out misleading information on the internet based off of personal experience. The raspberry pi has documented issues that occur when power is cut, and it runs Linux.

The issues is more about hardware than software. The FTL (flash transition layer) will remap storage on the fly as part of its wear leveling feature. If you kill power during a remapping, you pretty much lose the whole disk. This is different from flash storage on something like a roboRIO or a wireless router, which doesn't have that additional layer of abstraction.

Linux does care when its file system is no longer usable.
Quote:
Originally Posted by Foster View Post
/sigh. No computer system that I've used from mainframes to Raspberry Pi, from MCP to Unix, including Windows and Linux deals well with hard power off when there are IOs in process. You've been lucky.

Lots of people have borked the SD card in a Raspberry Pi. The OP asked a good question, and people are trying to help. Your "whistling in the dark" isn't productive and I predict that someday you will either spend the night hand sewing inodes to restore a file system, or spend most of the day hoping your backup system really works while you boss yells at you about lost orders.
Hmmmm... Let's see, first, was referring purely to the software when I made those statements, not the hardware, and yes you can run into issues dealing with the SD card if the power is suddenly cut, IN SOME CASES. If you have set it up, correctly, and are using it as a vision co-processor, all you are doing is cutting the power while a programme is running. I have done exactly this hundreds, actually thousands, of times, with a Pi B+. I have used it for vision, and just unplugged it to turn it off. Every time, it booted correctly the next time I needed it. Of course, during setup, I made sure to never to that.

So please folks, don't question my intelligence.
  #29   Spotlight this post!  
Unread 18-02-2016, 10:10
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,685
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

Quote:
Originally Posted by JesseK View Post
Code:
ssh user:password@rpihost 'sudo shutdown -h now'
Sorry to quote myself, but this thread has devolved a bit and I really do wonder if a software solution is plausible. This 'ssh' works well for a few things at work, but I don't know if the RoboRIO/R-PI setup allows for it (firewall/sudo permissions/etc).

We're toying with a few auto-shutdown features in our own code, but detecting the end of match (rather than disabling of robot) is proving a little tricky.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
  #30   Spotlight this post!  
Unread 18-02-2016, 10:24
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,622
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Shutting Down a Robot-Mounted Pi

Quote:
Originally Posted by viggy96 View Post
Hmmmm... Let's see, first, was referring purely to the software when I made those statements, not the hardware, and yes you can run into issues dealing with the SD card if the power is suddenly cut, IN SOME CASES. If you have set it up, correctly, and are using it as a vision co-processor, all you are doing is cutting the power while a programme is running. I have done exactly this hundreds, actually thousands, of times, with a Pi B+. I have used it for vision, and just unplugged it to turn it off. Every time, it booted correctly the next time I needed it. Of course, during setup, I made sure to never to that.

So please folks, don't question my intelligence.
It is possible if you are running Arch Linux with the swap file OFF that your systems will only be writing to storage when and if your application writes to storage. Raspbain quite often has swap enabled and written to the SD card. Depending on how swappiness (yes that's not made up it's a real thing) is setup your kernel may or may not use that swap if the memory space of your application starts to use up too much of the system's actual RAM.

This is not to question to you, or anyone's intelligence, just a point that currently I have 50,000+ copies of Linux online and running in various public and private clouds and datacenters. The smart thing to do is do a proper shutdown unless you know for a fact you've controlled the risk or have no better option.

For example I used to take Dell OptiPlex systems I had as leftovers from upgrades and put Ubuntu on them. Mess with the disk settings to spin down the hard drives and spin them up only on demand or every 6 hours (which ever was first and then spin them back down in 5 minutes). I would increase the write cache large enough that casual writes would come back from memory. I would remove the swap so that would not qualify to spin up the hard drive. Most of the drives lasted beyond 8 years and those that did not were already questionable (had de-allocated bad sectors that weren't mapped at the factory). These systems were used for print server farms like a giant version of the HP JetDirect driving down the cost of the printers because we could print to CUPS raw queues from Windows happily.

So again - there's plenty of simple ways shown here to accomplish this task from using a button and a script or SSH.
Why run any risk you don't need to?
Unlike other applications out there you really might take the chance you have an issue in the next match that hurts your competitive edge.

Last edited by techhelpbb : 18-02-2016 at 10:28.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:07.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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