Build succesful, but no robot code

This is our build console. Whenever we try to submit our code, it makes communication and the build is succesful, but the driver station still has a red light for the driver station. When I use an example program, it works. What could the problem be?

Buildfile: C:\Users\Matan\workspace\MEME-Powered\build.xml
Trying to override old definition of task classloader
clean:
[delete] Deleting directory C:\Users\Matan\workspace\MEME-Powered\build
[delete] Deleting directory C:\Users\Matan\workspace\MEME-Powered\dist
compile:
[mkdir] Created dir: C:\Users\Matan\workspace\MEME-Powered\build
[echo] [athena-compile] Compiling src with classpath=C:\Users\Matan\wpilib\java\current\lib\WPILib.jar;C:\Users\Matan\wpilib\java\current\lib\NetworkTables.jar;C:\Users\Matan\wpilib\java\current\lib\opencv.jar;C:\Users\Matan\wpilib\java\current\lib\cscore.jar to build
[javac] Compiling 11 source files to C:\Users\Matan\workspace\MEME-Powered\build
jar:
[echo] [athena-jar] Making jar dist/FRCUserProgram.jar.
[mkdir] Created dir: C:\Users\Matan\workspace\MEME-Powered\dist
[mkdir] Created dir: C:\Users\Matan\workspace\MEME-Powered\build\jars
[echo] [athena-jar] Copying jars to build/jars.
[copy] Copying 4 files to C:\Users\Matan\workspace\MEME-Powered\build\jars
[jar] Building jar: C:\Users\Matan\workspace\MEME-Powered\dist\FRCUserProgram.jar
get-target-ip:
[echo] Finding roboRIO, please ignore any [hostinfo] error messages
[echo] Trying DNS: roboRIO-4572-FRC.lan
[echo] Trying USB: 172.22.11.2
[echo] Trying mDNS: roboRIO-4572-FRC.local
[echo] Trying Static Ethernet: 10.45.72.2
[hostinfo] Error retrieving remote host information for host:roboRIO-4572-FRC.lan.
[echo] Resolved mDNS to 10.45.72.31
[echo] roboRIO found at 10.45.72.31
dependencies:
[echo] roboRIO image version validated
[echo] Checking for JRE. If this fails install the JRE using these instructions: https://wpilib.screenstepslive.com/s/4485/m/13503/l/288822-installing-java-8-on-the-roborio-using-the-frc-roborio-java-installer-java-only
[sshexec] Connecting to 10.45.72.31:22
[sshexec] cmd : test -d /usr/local/frc/JRE
deploy:
[delete] Deleting: C:\Users\Matan\wpilib\java\current\lib
ative\lib\WPI_Native_Libraries.properties
[scp] Connecting to 10.45.72.31:22
[scp] Receiving file: /usr/local/frc/lib/WPI_Native_Libraries.properties
[scp] Receiving: WPI_Native_Libraries.properties : 2598
[scp] File transfer time: 0.01 Average Rate: 519,600.0 B/s
[scp] done
[scp] Connecting to 10.45.72.31:22
[scp] Receiving file: /usr/local/frc/lib/User_Libraries.properties
[scp] Caught exception: scp: /usr/local/frc/lib/User_Libraries.properties: No such file or directory
[echo] [athena-deploy] Copying code over.
[scp] Connecting to 10.45.72.31:22
[scp] done.
[sshexec] Connecting to 10.45.72.31:22
[sshexec] cmd : ldconfig
[sshexec] Connecting to 10.45.72.31:22
[sshexec] cmd : killall -q netconsole-host || :
[delete] Deleting: C:\Users\Matan\wpilib\java\current\ant
etconsole-host.properties
[scp] Connecting to 10.45.72.31:22
[scp] Receiving file: /usr/local/frc/bin/netconsole-host.properties
[scp] Receiving: netconsole-host.properties : 134
[scp] File transfer time: 0.0 Average Rate: 33,500.0 B/s
[scp] done
[scp] Connecting to 10.45.72.31:22
[scp] done.
[echo] [athena-deploy] Starting program.
[sshexec] Connecting to 10.45.72.31:22
[sshexec] cmd : . /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r;
[sshexec] Connecting to 10.45.72.31:22
[sshexec] cmd : sync
BUILD SUCCESSFUL
Total time: 10 seconds

What is the light in dashboard is red ?

Maybe that mean is a error in the code. Does the console in dashboard send error ?

I’ve seen this happen sometimes when there is an error in your RobotInit() - maybe check there for anything out of the ordinary, like a NullPointer or something.

Yes, I had this happen recently, and in the drive station there was a NullPointer indicating where the code was crashing - you’ll have to change the code on that line.

I looked through the cconsole in the driver station, and noticed a couple of errors. Does anyone know what they mean?

********** Robot program starting **********
ERROR 1 ERROR Unhandled exception: java.lang.RuntimeException: Code: -1029. HAL: Resource already allocated at [edu.wpi.first.wpilibj.hal.PWMJNI.initializePWMPort(Native Method), edu.wpi.first.wpilibj.PWM.<init>(PWM.java:61), edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java:24), edu.wpi.first.wpilibj.PWMSpeedController.<init>(PWMSpeedController.java:23), edu.wpi.first.wpilibj.Spark.<init>(Spark.java:49), org.usfirst.frc.team4572.robot.subsystems.DriveSubsystem.<init>(DriveSubsystem.java:15), org.usfirst.frc.team4572.robot.Robot.robotInit(Robot.java:46), edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:64), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:247)] edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:249)
Error at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:249): ERROR Unhandled exception: java.lang.RuntimeException: Code: -1029. HAL: Resource already allocated at [edu.wpi.first.wpilibj.hal.PWMJNI.initializePWMPort(Native Method), edu.wpi.first.wpilibj.PWM.<init>(PWM.java:61), edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java:24), edu.wpi.first.wpilibj.PWMSpeedController.<init>(PWMSpeedController.java:23), edu.wpi.first.wpilibj.Spark.<init>(Spark.java:49), org.usfirst.frc.team4572.robot.subsystems.DriveSubsystem.<init>(DriveSubsystem.java:15), org.usfirst.frc.team4572.robot.Robot.robotInit(Robot.java:46), edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:64), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:247)]
WARNING: Robots don’t quit!
—> The startCompetition() method (or methods called by it) should have handled the exception above.
âž” Launching «’/usr/local/frc/JRE/bin/java’ ‘-Djava.library.path=/usr/local/frc/lib/’ ‘-jar’ '/home/lvuser/FRCUserProgram.jar’»

I believe the part that says “Resource already allocated at edu.wpi.first.wpilibj.hal.PWMJNI.initializePWMPort” indicates that the PWM port you are trying to use has already been used to initialize another device. Make sure all of your motor controllers have a unique port number passed to them. Or post your RobotInit code here if that doesn’t help.

Here’s the robotInit code:

public void robotInit() {
chooser = new SendableChooser<Object>();
driveSubsystem = new DriveSubsystem();
gyroSystem = new GyroSystem();
ballHopperSystem = new BallHopperSystem();
ropeClimberSystem = new RopeClimberSystem();
CameraServer.getInstance().startAutomaticCapture();
SmartDashboard.putData(“Auto mode”, chooser);
robotDrive = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR_PORT, RobotMap.BACK_LEFT_MOTOR_PORT, RobotMap.FRONT_RIGHT_MOTOR_PORT, RobotMap.BACK_RIGHT_MOTOR_PORT);
robotDrive.setInvertedMotor(MotorType.kFrontLeft, true);
robotDrive.setInvertedMotor(MotorType.kFrontRight, true);
robotDrive.setExpiration(0.1);
}

UPDATE: We moved a couple things around in our doe, and we are no longer getting the same error. Now we’re getting:

ERROR: Could not instantiate robot org.usfirst.frc.team4572.robot.Robot!

Look at the code in each of your subsystems and note which port number your using for each motor. My suspicion is that you’ll find the same port number being used in more than one place - which will cause a runtime error during initialization.

That means you renamed or moved your robot class and now the roborio can’t find it.