Hi, im having an issue deploying code to my robot. I’ve looked into the issues many others have had, but i dont whats going on with this one:
Executing task: gradlew deploy -PteamNumber=7479 --offline -Dorg.gradle.java.home=“C:\Program Files\AdoptOpenJDK\jdk-11.0.5.10-hotspot” <
Task :discoverRoborio
Discovering Target roborio
admin @ 10.74.79.2: Resolved but not connected.
Reason: JSchException
socket is not established
admin @ 172.22.11.2: Resolved but not connected.
Reason: JSchException
socket is not established
admin @ roborio-7479-FRC.local: Failed resolution.
Reason: TimeoutException
Discovery timed out.
admin @ roborio-7479-FRC: Failed resolution.
Reason: TimeoutException
Discovery timed out.
admin @ roborio-7479-FRC.lan: Failed resolution.
Reason: TimeoutException
Discovery timed out.
admin @ roborio-7479-FRC.frc-field.local: Failed resolution.
Reason: TimeoutException
Discovery timed out.
1 other action(s) not started.
Run with --info for more details
Task :discoverRoborio FAILED
Missing Target!
=============================================
Are you connected to the robot, and is it on?
=============================================
GradleRIO detected this build failed due to not being able to find “roborio”!
Scroll up in this error log for more information.
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:discoverRoborio’.
A failure occurred while executing jaci.gradle.deploy.target.discovery.TargetDiscoveryWorker
Target roborio could not be found at any location! See above for more details.
BUILD FAILED in 4s
6 actionable tasks: 4 executed, 2 up-to-date
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
Ive formatted and updated the roborio, and everything but nothing will seem to work. If anyone has any input on how to fix this, please help, thank you!
Nothing really helped but I figured out what the problem was. The roboRIO was not formatted, but now its shows communications are established on the robot, but the code isn’t appearing. I’ve deployed numerous times, but nothings getting code to be established on the roboRIO
Go to driver station, click the cogwheel on the box on the right, and click view console, then show the stack trace here so we can help you more plz.
it comes up this and it keeps pulling up with this error
Error: Main method not found in class frc.robot.Main, please define the main method as:
public static void main(String[] args)
Can you show us your Main class? (Not Robot, the class entitled Main)
1 Like
package frc.robot;
/**
-
Do NOT add any static variables to this class, or any initialization at all.
-
Unless you know what you are doing, do not modify this file except to
-
change the parameter class to the startRobot call.
*/
public final class Main {
private Main() {
}
}
You appear to have deleted the main method from your class. Put this inside the class and try it again.
/**
* Main initialization function. Do not perform any initialization here.
*
* <p>If you change your main robot class, change the parameter type.
*/
public static void main(String... args) {
RobotBase.startRobot(Robot::new);
}
I’ve added that, now, build is successful and the driver station is reading the code. But when ever i enable it, it comes up with this error in the drivers station:
obot(RobotBase.java:293): The startCompetition() method (or methods called by it) should have handled the exception above.
CS: USB Camera 1: Connecting to USB camera on /dev/video1
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xacf5aed0, pid=5180, tid=5224
#
# JRE version: OpenJDK Runtime Environment (11.0.4.10) (build 11.0.4.10-frc+0-2020-11.0.4u10-2)
# Java VM: OpenJDK Client VM (11.0.4.10-frc+0-2020-11.0.4u10-2, mixed mode, concurrent mark sweep gc, linux-)
# Problematic frame:
# C [libwpiHal.so+0x44ed0] HAL_GetFPGATime+0x30
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid5180.log
********** Robot program starting **********
NT: server: client CONNECTED: 169.254.112.126 port 54587
CS: USB Camera 0: Connecting to USB camera on /dev/video0
CS: USB Camera 1: Connecting to USB camera on /dev/video1
CS: USB Camera 1: Connecting to USB camera on /dev/video1
CS: USB Camera 1: Connecting to USB camera on /dev/video1
Warning 44003 FRC: No robot code is currently running. Driver Station
CS: USB Camera 1: Connecting to USB camera on /dev/video1
Default disabledInit() method… Override me!
Default disabledPeriodic() method… Override me!
Watchdog not fed within 0.020000s
SmartDashboard.updateValues(): 0.000719s
Warning 1 Loop time of 0.02s overrun
edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:276)
Warning at edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:276): Loop time of 0.02s overrun
disabledInit(): 0.017296s
disablePeriodic(): 0.003251s
When ever I enable teleop, it comes up with this, errors out and disables automatically
Looks like your code is crashing. Can you post it to github (or similar) and share a link with us?
Is that repo private? I can’t access it
what did you show me? i cant view it for some reason
Your teleopPeriodic method calls itself. That recursive call will eventually overload the call-stack and crash your application. In short, don’t use recursion in your robot code, especially not in Robot.java
so would i just get rid of it? because i did and the console comes up with a motor safety error consistently, and its not getting updated often enough
I mean, you need to have something there… Looks like you’re trying to use the command-based pattern. I’m seeing a few issues with your project. At this point, instead of calling them out one by one with all this back-and-forth, my recommendation is that you create a new blank command-based project through the wpilib plugin in vscode, and migrate your code into it line by line. Don’t touch Robot.java until you absolutely need to, and don’t blindly copy entire files.
You also need to decide whether you want to use the OLD command-based or the NEW command-based. I highly recommend the new one, but both will certainly work and your current code is using the old style, so the decision is really up to you.
1 Like