Connecting the Microsoft webcam to the FRC PC dashboard

Hi everyone, I am part of a rookie team and we are experiencing difficulties with connecting our webcam to the FRC PC dashboard. Even though we are able to successfully connect to the RoboRio and deploy code, and our webcam is physically connected to the RoboRio, we aren’t getting any camera feed. Also, the bottom left corner of the PC Dashboard has a dropdown menu that says ‘No Camera Selection’, and there aren’t any other options to select. It keeps saying it’s ‘waiting for Network Table Connection to Robot’, even after restarting both the PC dashboard and the Driver Station multiple times.

Plus a few threads on chiefdelphi say there isn’t anything to code for the webcam display, but WPILib says otherwise: docs.wpilib.org/en/latest/docs/software/vision-processing/introduction/using-the-cameraserver-on-the-roborio.html .

We are using Java with the latest VSCode, if that helps.

Could anyone please help? We are really confused about this. Thank you :slight_smile:

Looking in your Driver Station config tab (the one with the gear), what is your Dashboard Type?
If you’re using Default I’m not sure off the top of my head what extra steps may be required to have the camera show (maybe there are none, I can’t get the DS to connect to the simulated robot, that may include the Default dashboard).

I’m 99% sure that you need the code for the camera server regardless of Dashboard type, so you should be right with CameraServer.getInstance().startAutomaticCapture(); somewhere.
Keeping in mind it only needs to be run once, so a constructor is a good place for this.

If you switch the Dashboard Type to ShuffleBoard, or launch ShuffleBoard separately, you should be able to see your camera feed there by dragging and dropping it on the canvas.

When you say your webcam is physically connected to the RoboRio, is it connected via USB?

Let us know if you can or cannot see the camera in ShuffleBoard, or if there is some other problem.

I think this line is key. The dashboard is not connected to the robot via network tables. This can be confirmed by looking at the “Basic” tab and checking whether the NT Connected light is illuminated or not (bright green vs dark green). If not, then you need to troubleshoot that. If the light IS illuminated, then it would appear the robot isn’t setting the correct values into networktables.

Let us know which branch to follow and we can help provide further troubleshooting steps.

1 Like

Hi, thanks for your response! The dashboard type is default. I tried switching to Shuffleboard, but it said there is ‘no data available’ under the CameraServer. The webcam is connected to the RoboRio via USB.

Hi, thanks for your reply! We don’t see any NT Connected light in the ‘Basic’ tab. But there is this in the Drive tab:

I do see this in the Shuffleboard, though:

Ah, my mistake. Yes, it’s on the Drive tab, not Basic.

Do you have your team number set correctly in the driverstation?

1 Like

Ah, okay :slight_smile: Yes, we do have the correct team number.

Given that you can see data in ShuffleBoard, but not the Default Dashboard, and the Driver Station connects to the robot, it sounds like a firewall issue.

On the camera note, since ShuffleBoard hasn’t picked it up, it doesn’t sound like it’s running. Where are you starting the camera server in your code, and have you confirmed that it is executing?

If you think it is executing, and somehow isn’t being added to the Network Tables (which is how the Dashboard and ShuffleBoard find out about it), you can try to navigate to http://roborio-TEAM-frc.local:1181/ (where TEAM is your team number). If the camera server is running, that page should load.

Hi, I checked- all the firewalls on the driver station laptop are disabled.

As for the code, I think that is our issue: we hadn’t written in any code for the camera yet. We’re working on that today, I’ll let you know if it works.

Thanks! :smile:

1 Like

As I mentioned earlier, it should just be as simple as dropping this in somewhere to be run once.

CameraServer.getInstance().startAutomaticCapture();

Regarding the Default Dashboard not connecting, could you verify whether or not the keys in the Variables tab have black diamonds next to them? (If they have them as shown, it could indicate the Dashboard is not connected to the NetworkTables, as also indicated by the NT Connection light in the Drive tab)
image

Just a side note for yall, last year during competition, the orange hat guy said the default dashboard sometime can be finicky and suggested that we use smartdashboard for looking at camera. Idk if everyone have the problem but our team definitely had problems with default dashboard before.

Hi, we tested it out today and it worked! :smile: Turns out it was just that missing bit of code that was the problem. Thanks so much for your help and advice, bsimmons and Fletch1373!

1 Like

Thanks, we’ll keep that in mind!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.