ERROR 1 CTRE CAN Receive Timeout
I’m getting this error.
ERROR 1 CTRE CAN Receive Timeout
I’m getting this error.
This is nowhere near enough information to figure out what’s wrong. Please provide more context with what you tried to do, what code you ran, and a more complete console log of what happened instead.
You’ve likely instantiated a CAN object (Talon, etc) that has an invalid ID. But, could just be a wiring issue. Need a lot more info.
I’m working with the pneumatic. Here’s the code.
`/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc.robot;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Joystick;
/**
* The VM is configured to automatically run this class, and to call the
* functions 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 build.gradle file in the
* project.
*/
public class Robot extends TimedRobot {
/**
* This function is run when the robot is first started up and should be used
* for any initialization code.
*/
//***Controllers***
private Joystick driver_Controller;
//Compressor
private Compressor airCompressor = new Compressor(1);
//***Solenoids***
private DoubleSolenoid transmission;
@Override
public void robotInit() {
//***Joystics Port Assigned***
driver_Controller = new Joystick(0);
//***AirCompressor Start***
airCompressor.start();
//***Solenoid Id Assigned***
transmission = new DoubleSolenoid(0, 1);
}
@Override
public void autonomousInit() {
}
@Override
public void autonomousPeriodic() {
}
@Override
public void teleopInit() {
}
@Override
public void teleopPeriodic() {
if(driver_Controller.getRawButtonPressed(1)){
transmission.set(DoubleSolenoid.Value.kForward);
}
else if(driver_Controller.getRawButtonPressed(2)){
transmission.set(DoubleSolenoid.Value.kReverse);
}
}
@Override
public void testInit() {
}
@Override
public void testPeriodic() {
}
}
`
Take a look at these threads where similar issues were reported. Perhaps one of their solutions will work for you:
Also, take a look here. Your really do not need the Compressor object and for the one you do have, the CAN id is likely wrong. Finally, you probably should not be using the start method.
Also, check your wiring (I think that is discussed in one of the threads) and make sure your CAN bus is terminated at the PDB.
I hope this helps,
Steve
Thanks a lot, is that my mentor told my to use that id. Also this year we organized the code a little different. We assignated values at roboinit instead of directly when declared. We use iterative.
That means PDP or PCM is not present on your CAN bus despite being referenced in your software.
You passed a ‘1’ into your Compressor constructor. So it expects a PCM with ID ‘1’.
Constructor doc here
You passed a ‘0’ into your DoubleSolenoid constructor. So it expects a PCM with ID ‘0’.
Constructor doc here
Unless you have two PCMs on your CAN bus, this is wrong.
Before you do this, read and follow the instructions…
https://wpilib.screenstepslive.com/s/currentCS/m/java/l/599707-operating-a-compressor-for-pneumatics
… and verify your PCM’s general health and ID…
https://phoenix-documentation.readthedocs.io/en/latest/ch09_BringUpPCM.html
… you should do this anyway to learn how to self-test the PCM (for diagnostic purposes).
Yes, is that we where using an old PCM and PDP so I needed to change the ids to 0.