When using Phoenix tuner with a Phoenix 6 CANivore bus and a Phoenix 5 Rio bus what determines which bus Tuner will show devices for. Often time we don’t see our devices for our Rio bus. The compressor is working correctly so we know the PCM is on the bus. Tuner just doesn’t show it.
Can you take a screenshot of the Tuner page? How are you connected to the roboRIO? Can you connect to the robot in Driver Station?
I’m not at shop right now. We just realized this is a bigger problem. When tuner doesn’t see the devices our code errors trying to access them too. We restart robot code and it generally brings them back. It works more often than it doesn’t but it is by no means reliable.
We are connecting over wifi to team number.
Python w/ Phoenix 5 and 6
Can you share your code?
It’s possible you have duplicate devices that are causing issues. I’d run a completely empty project with just one device declared and see if it reproduces.
Then either slowly readd your code, or remove code from your project until things break/work
I can add you to our github private github repo but we’ve found this is enough to reproduce the problem.
Creating a single device on the CANivore bus and applying a config is enough to reproduce the problem. We typically have to restart robot code 5 or more times to cause it to happen. If we add additional devices then it can generally happen after 1 or 2 restarts of robot code.
When it works we see all 21 devices when it doesn’t work we only see 18 and the rio devices are greyed out.
lvuser@roboRIO-2481-FRC:~$ pip3 freeze
phoenix6==24.2.0
pyntcore==2024.2.1.2
robotpy==2024.2.1.2
robotpy-cli==2024.0.0
robotpy-commands-v2==2024.2.2
robotpy-ctre==2024.1.2
robotpy-hal==2024.2.1.2
robotpy-pathplannerlib==2024.2.2
robotpy-wpilib-utilities==2024.0.0
robotpy-wpimath==2024.2.1.2
robotpy-wpinet==2024.2.1.2
robotpy-wpiutil==2024.2.1.2
setuptools==69.1.0
typing_extensions==4.9.0
wpilib==2024.2.1.2
#!/usr/bin/env python3
import typing
import wpilib
import commands2
from robotcontainer import RobotContainer
from phoenix6.hardware import TalonFX
from phoenix6.configs import TalonFXConfiguration
class MyRobot(commands2.TimedCommandRobot):
def robotInit(self) -> None:
"""
This function is run when the robot is first started up and should be used for any
initialization code.
"""
self.armMotor = TalonFX(1, "2481")
self.armMotor.configurator.apply(TalonFXConfiguration())
self.autonomousCommand = None
def disabledInit(self) -> None:
"""This function is called once each time the robot enters Disabled mode."""
def disabledPeriodic(self) -> None:
"""This function is called periodically when disabled"""
def autonomousInit(self) -> None:
"""This autonomous runs the autonomous command selected by your RobotContainer class."""
self.autonomousCommand = self.container.getAutonomousCommand()
if self.autonomousCommand:
self.autonomousCommand.schedule()
def autonomousPeriodic(self) -> None:
"""This function is called periodically during autonomous"""
def teleopInit(self) -> None:
# This makes sure that the autonomous stops running when
# teleop starts running. If you want the autonomous to
# continue until interrupted by another command, remove
# this line or comment it out.
if self.autonomousCommand:
self.autonomousCommand.cancel()
def teleopPeriodic(self) -> None:
"""This function is called periodically during operator control"""
After direct communication with CTRE’s @ozrien and @virtuald we believe this is the issue we are running into.
We will test and verify this evening. I’ll reply back with any additional learning in case someone else stumbles across this thread experiencing similar issues.
Lol this has been an issue with robotpy + ctre since the 2023 releases.
Our workaround has been to restart robot code on every deploy until can errors stop happening in the ds console. Usually only takes 1 restart.
Good thing is that it doesn’t happen on first boot so it doesn’t affect competition matches.
The fix mentioned above (which was originally developed for Java) should be happening if you have robotpy >= 2024.3.1.0
installed. If you’re still needing to reboot then something more will be needed.
Alternatively, make sure that robotpy-installer >= 2024.2.0
is installed locally.
I doesn’t appear updating to the latest Phoenix and Robotpy has solved this problem. With limited testing it appears on boot it works and it is only an issue around restarting robot code.
Can anyone comment if this situation can occur on a crash and auto restart of the the robot code or is it only an issue around deploying or a manual restart of robot code?
Can you create a C++ program that only instantiates the same motors that you’re creating (and configures them the same way in case it’s something to do with that) and see if a similar issue with seeing devices with tuner occurs?
… I don’t really understand the root cause of this issue, but I don’t see how python has anything to do with it, it’s just a normal userspace program.
Given where we are in the season now and how far behind we are I don’t know when / if I’ll get around to trying it with C++. I’ll let you know if we have some time and are able.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.