From 0616cb02347e4a264f24f8cc949e0f411209025f Mon Sep 17 00:00:00 2001 From: Alexander Mackworth Date: Fri, 23 Sep 2016 17:07:27 -0700 Subject: [PATCH 1/3] Fixed static IP deploy to roboRIO. --- DeploymentEngine/src/ccre/deployment/DepRoboRIO.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java b/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java index b3bb49f6..c1e82962 100644 --- a/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java +++ b/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java @@ -217,7 +217,8 @@ public void downloadAndStart(Artifact result) throws IOException { private static final String DEFAULT_PASSWORD = ""; private static final String DEFAULT_ADMIN_USERNAME = "admin"; private static final String DEFAULT_ADMIN_PASSWORD = ""; - + private static final int FALLBACK_HOST = 2; + /** * Finds the path to the roboRIO compiled Jar file, either the thick or thin * version depending on whether {@link #LIBS_THICK} or {@link #LIBS_THIN} is @@ -322,17 +323,17 @@ public static RIOShell discoverAndVerify(int team_number) throws IOException { public static DepRoboRIO discover(int team_number) throws UnknownHostException { DepRoboRIO rio = byNameOrIP("roboRIO-" + team_number + "-FRC.local"); if (rio == null) { - rio = byNameOrIP("172.22.11.2"); + rio = byNameOrIP("172.22.11." + FALLBACK_HOST); } if (rio == null) { - rio = byNameOrIP("10." + (team_number / 100) + "." + (team_number % 100) + ".2"); + rio = byNameOrIP("10." + (team_number / 100) + "." + (team_number % 100) + "." + FALLBACK_HOST); } if (rio == null) { // 2015 mDNS name format rio = byNameOrIP("roboRIO-" + team_number + ".local"); } if (rio == null) { - throw new UnknownHostException("Cannot reach roboRIO over mDNS, ethernet-over-USB, or via static 10." + (team_number / 100) + "." + (team_number % 100) + ".2 address."); + throw new UnknownHostException("Cannot reach roboRIO over mDNS, ethernet-over-USB, or via static 10." + (team_number / 100) + "." + (team_number % 100) + "." + FALLBACK_HOST + " address."); } return rio; } From 66330b352a62265b977b57090823da005bce9123 Mon Sep 17 00:00:00 2001 From: Alexander Mackworth Date: Fri, 23 Sep 2016 17:09:22 -0700 Subject: [PATCH 2/3] Updated fallback host IP. --- DeploymentEngine/src/ccre/deployment/DepRoboRIO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java b/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java index c1e82962..36968795 100644 --- a/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java +++ b/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java @@ -217,7 +217,7 @@ public void downloadAndStart(Artifact result) throws IOException { private static final String DEFAULT_PASSWORD = ""; private static final String DEFAULT_ADMIN_USERNAME = "admin"; private static final String DEFAULT_ADMIN_PASSWORD = ""; - private static final int FALLBACK_HOST = 2; + private static final int FALLBACK_HOST = 19; /** * Finds the path to the roboRIO compiled Jar file, either the thick or thin From eae5e1561e34583466599e33f13838cef2fd76aa Mon Sep 17 00:00:00 2001 From: Alexander Mackworth Date: Fri, 23 Sep 2016 17:12:56 -0700 Subject: [PATCH 3/3] Extracted fallback IP to local variable. --- DeploymentEngine/src/ccre/deployment/DepRoboRIO.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java b/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java index 36968795..be9606c1 100644 --- a/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java +++ b/DeploymentEngine/src/ccre/deployment/DepRoboRIO.java @@ -321,19 +321,20 @@ public static RIOShell discoverAndVerify(int team_number) throws IOException { * @throws UnknownHostException if a roboRIO cannot be found. */ public static DepRoboRIO discover(int team_number) throws UnknownHostException { + String fallbackIP = "10." + (team_number / 100) + "." + (team_number % 100) + "." + FALLBACK_HOST; DepRoboRIO rio = byNameOrIP("roboRIO-" + team_number + "-FRC.local"); if (rio == null) { rio = byNameOrIP("172.22.11." + FALLBACK_HOST); } if (rio == null) { - rio = byNameOrIP("10." + (team_number / 100) + "." + (team_number % 100) + "." + FALLBACK_HOST); + rio = byNameOrIP(fallbackIP); } if (rio == null) { // 2015 mDNS name format rio = byNameOrIP("roboRIO-" + team_number + ".local"); } if (rio == null) { - throw new UnknownHostException("Cannot reach roboRIO over mDNS, ethernet-over-USB, or via static 10." + (team_number / 100) + "." + (team_number % 100) + "." + FALLBACK_HOST + " address."); + throw new UnknownHostException("Cannot reach roboRIO over mDNS, ethernet-over-USB, or via static " + fallbackIP + " address."); } return rio; }