From 05687b1b530d63b1b4fb2edbe40302c51e1e66f0 Mon Sep 17 00:00:00 2001 From: moo Date: Thu, 25 Sep 2025 16:18:28 -0700 Subject: [PATCH] button work works, but need to ssh in to rio and chmod 777 the sshpass bin first, will need to fix --- .../commands/vision/ShutdownOrangePi.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/commands/vision/ShutdownOrangePi.java b/src/main/java/frc/robot/commands/vision/ShutdownOrangePi.java index 97b2c67..83a351b 100644 --- a/src/main/java/frc/robot/commands/vision/ShutdownOrangePi.java +++ b/src/main/java/frc/robot/commands/vision/ShutdownOrangePi.java @@ -42,11 +42,20 @@ public class ShutdownOrangePi extends Command { } try { - String[] commandString = new String[] { "ssh", - "-o", "UserKnownHostsFile /dev/null", - "-o", "StrictHostKeyChecking no", - VisionConstants.ORANGEPI_USERNAME + "@" + hostname, - "sudo", "shutdown", "now" }; + // String[] commandString = new String[] { "ssh", + // "-o", "UserKnownHostsFile /dev/null", + // "-o", "StrictHostKeyChecking no", + // VisionConstants.ORANGEPI_USERNAME + "@" + hostname, + // "sudo", "shutdown", "now" }; + + String[] commandString = new String[] { + "/home/lvuser/deploy/sshpass", + "-p", "raspberry", + "ssh", "-o", "StrictHostKeyChecking=no", + VisionConstants.ORANGEPI_USERNAME + "@" + hostname, + "sudo", "shutdown", "now" + }; + this.process = Runtime.getRuntime().exec(commandString); } catch (Exception e) { String message = e.getMessage() == null ? "unknown" : e.getMessage(); -- 2.39.5