Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to roboRIO w/ GrappleHook #2

Open
Aieda1l opened this issue Jan 11, 2025 · 11 comments
Open

Unable to connect to roboRIO w/ GrappleHook #2

Aieda1l opened this issue Jan 11, 2025 · 11 comments

Comments

@Aieda1l
Copy link

Aieda1l commented Jan 11, 2025

We are unable to connect to our roboRIO 1 via USB w/ GrappleHook. We've received the following error messages:

  • A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (os error 10060)
  • No connection could be made because the target machine actively refused it. (os error 10061)
  • An established connection was aborted by the software in your host machine. (os error 10053)

In terms of troubleshooting we've tried:

  • Plugging/unplugging roboRIO and closing/reopening GrappleHook
  • Rebooting roboRIO
  • Do not have Phoenix Tuner running while trying to connect
  • Run ssh admin@172.22.11.2 -t 'frcKillRobot.sh -t'
  • When we attempt to run ssh admin@172.22.11.2 -t 'cat /tmp/grapple-hook-daemon.log', this is the output: -bash: cat /tmp/grapple-hook-daemon.log: No such file or directory

Any help would be appreciated!

@JaciBrunning
Copy link
Member

Interesting, usually those troubleshooting steps are sufficient. Let me see if I can reproduce on my side and we can go from there

@JaciBrunning JaciBrunning transferred this issue from GrappleRobotics/LaserCAN Jan 13, 2025
@JaciBrunning
Copy link
Member

Hey @Aieda1l , give this a try: https://github.com/GrappleRobotics/GrappleHook/releases/tag/v25.0.1

It'll require you to add a line of code to your robot code, but should be much more reliable

@tekdemo
Copy link

tekdemo commented Jan 15, 2025

Encountering the same problem on a couple Rios, flashed with both 2024 and 2025 firmwares.
Was able to inject the requested tcp bridge line into the robot code, but did not resolve the issue as the requested 25.0.2 libgrapplefrc version is not available via the vendordep ; That is still locked at 25.0.0 .

@JaciBrunning
Copy link
Member

Ah I see, give it a crack now - should be updated

@Lawncoder
Copy link

Issue persists. Running the following code receives the error "Could not instantiate robot au.grapplerobotics.CanBridge!". Updated to 2025.1 image.

// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot;

import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**

  • The methods in this class are called automatically corresponding to each mode, as described in
  • the TimedRobot documentation. If you change the name of this class or the package after creating
  • this project, you must also update the Main.java file in the project.
    */
    public class Robot extends TimedRobot {
    private static final String kDefaultAuto = "Default";
    private static final String kCustomAuto = "My Auto";
    private String m_autoSelected;
    private final SendableChooser m_chooser = new SendableChooser<>();

/**

  • This function is run when the robot is first started up and should be used for any
  • initialization code.
    */
    public Robot() {
    m_chooser.setDefaultOption("Default Auto", kDefaultAuto);
    m_chooser.addOption("My Auto", kCustomAuto);
    SmartDashboard.putData("Auto choices", m_chooser);
    au.grapplerobotics.CanBridge.runTCP();
    }

/**

  • This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
  • that you want ran during disabled, autonomous, teleoperated and test.
  • This runs after the mode specific periodic functions, but before LiveWindow and

  • SmartDashboard integrated updating.
    */
    @OverRide
    public void robotPeriodic() {}

/**

  • This autonomous (along with the chooser code above) shows how to select between different
  • autonomous modes using the dashboard. The sendable chooser code works with the Java
  • SmartDashboard. If you prefer the LabVIEW Dashboard, remove all of the chooser code and
  • uncomment the getString line to get the auto name from the text box below the Gyro
  • You can add additional auto modes by adding additional comparisons to the switch structure

  • below with additional strings. If using the SendableChooser make sure to add them to the
  • chooser code above as well.
    */
    @OverRide
    public void autonomousInit() {
    m_autoSelected = m_chooser.getSelected();
    // m_autoSelected = SmartDashboard.getString("Auto Selector", kDefaultAuto);
    System.out.println("Auto selected: " + m_autoSelected);
    }

/** This function is called periodically during autonomous. */
@OverRide
public void autonomousPeriodic() {
switch (m_autoSelected) {
case kCustomAuto:
// Put custom auto code here
break;
case kDefaultAuto:
default:
// Put default auto code here
break;
}
}

/** This function is called once when teleop is enabled. */
@OverRide
public void teleopInit() {}

/** This function is called periodically during operator control. */
@OverRide
public void teleopPeriodic() {}

/** This function is called once when the robot is disabled. */
@OverRide
public void disabledInit() {}

/** This function is called periodically when disabled. */
@OverRide
public void disabledPeriodic() {}

/** This function is called once when test mode is enabled. */
@OverRide
public void testInit() {}

/** This function is called periodically during test mode. */
@OverRide
public void testPeriodic() {}

/** This function is called once when the robot is first started up. */
@OverRide
public void simulationInit() {}

/** This function is called periodically whilst in simulation. */
@OverRide
public void simulationPeriodic() {}
}

@JaciBrunning
Copy link
Member

Thanks @Lawncoder , could you please provide the full stacktrace that you're getting? Also, is that a runtime error or compile-time?

@JaciBrunning
Copy link
Member

Nevermine, 2025.0.3 incoming

@JaciBrunning
Copy link
Member

Hey folks, give 2025.0.4 a try - seems to be working on my end assuming you have a CAN device connected

@tekdemo
Copy link

tekdemo commented Jan 17, 2025

2025.0.4 seems to have improved things. Code no longer crashes with the TCP bridge in the code, and I can connect via Grapplehook once per code push.

@JaciBrunning
Copy link
Member

Ok good to hear, I'll work on making that more stable so you can connect more than once per code push

@JaciBrunning
Copy link
Member

Hey all, this should be good to go now. I've tested on my side and everything seems to be working great, let us know if you have any troubles. Still requires a line of code in your robot code, but otherwise 25.0.2 should sort you out.

https://github.com/GrappleRobotics/GrappleHook/releases/tag/v25.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants