Go to Post If something on your robot isn't working, then why don't you take the responsibility to fix it? Isn't that what being a TEAM is all about? - dlavery [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #24   Spotlight this post!  
Unread 12-02-2016, 14:22
JesseK's Avatar
JesseK JesseK is online now
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,640
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
 


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 19:43.

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