Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions DeploymentEngine/src/ccre/deployment/DepRoboRIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 19;

/**
* 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
Expand Down Expand Up @@ -320,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.2");
rio = byNameOrIP("172.22.11." + FALLBACK_HOST);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct, unless something's changed. This is a static address specified separately from the ethernet configuration that we do manually.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot code was failing to deploy entirely for Amber since she didn't have support for the mDNS address, and this was the exact change we needed to fix it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line about changing the 172.22.11.*? okay.

}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IP string is used multiple times; use a separate variable.

if (rio == null) {
rio = byNameOrIP("10." + (team_number / 100) + "." + (team_number % 100) + ".2");
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) + ".2 address.");
throw new UnknownHostException("Cannot reach roboRIO over mDNS, ethernet-over-USB, or via static " + fallbackIP + " address.");
}
return rio;
}
Expand Down