CameraServer causes SmartDashboard Handshake error

I am trying to get a usb camera working using robotpy-cscore. I have everything installed, and even can get the camera to stream to chrome via http. However, whenever I run wpilib.CameraServer.launch(), the SmartDashboard loses all connectivity to the robot, sending the same error over and over again:

 18:02:52:110 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:52:115 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59725 (SmartDashboard) 
 18:02:52:411 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:52:412 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59726 (SmartDashboard) 
 18:02:52:810 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:52:811 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59727 (SmartDashboard) 
 18:02:53:210 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:53:211 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59729 (SmartDashboard) 
 18:02:53:609 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:53:614 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59730 (SmartDashboard) 
 18:02:54:017 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:54:021 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59731 (SmartDashboard) 
 18:02:54:410 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:54:411 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59733 (SmartDashboard) 
 18:02:54:809 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:54:811 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59734 (SmartDashboard) 
 18:02:55:208 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:55:212 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59736 (SmartDashboard) 
 18:02:55:607 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:55:612 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59737 (SmartDashboard) 
 18:02:56:048 WARNING : nt                  : read error in handshake: [Errno 104] Connection reset by peer 
 18:02:56:050 INFO    : nt                  : DISCONNECTED 169.254.9.3 port 59738 (SmartDashboard) 

I have tried everything from restarting the ds to updating all the software, and nothing seems to have fixed the issue.

Interesting. So you’re using python robot code? Sounds vaguely similar to https://github.com/robotpy/pynetworktables/issues/42, but you don’t get the same error.

What version of SmartDashboard are you using? The newest? Have you tried using OutlineViewer… you know, just to see if it works?

The other thing you can do is install this special version of pynetworktables… it will generate a file called ‘file.bin’ when the handshake error occurs. If you can get that to me, I can debug it.

I am using the newest version of the smartdashboard (fixed that a couple weeks ago with my last thread). I am using python for all robot code, haven’t checked the outline viewer, will have to try it today. I’ll give that version a try when I get to the robot in a couple hours

The other thing you might try… if you launch SmartDashboard from the command line (java -jar SmartDashboard.jar), it may show error messages that could be useful.

Yet another thing to try – see if you can connect to your robot using pynetworktables or pynetworktables2js. May or may not give an error message.

Alright, I just tried the command prompt smartdashboard, and it did give a slightly different error:

NT: unrecognized message type: 121
ConnectionIndicator DISCONNECTED

this error was repeated just as the other one was.

I’m not really sure how to do any of the other things you mentioned, including installing the different verision of pynetworktables (or even running pynetworktables standalone at all for that matter)

Hate to double-post, but just another update:

I’ve got that new version of pynetworktables almost installed, but can’t seem to figure out what you mean by “copy dist/pynetworktables*.gz to your system.”

I’m not the best with git, so I do apologize if it appears I am missing something completely obvious

Awesome, that’s a useful message. It means that almost certainly there’s a mismatch in how pynetworktables is sending/receiving NT traffic.

… and in fact, that insight led to me figuring out the bug (with some help from Peter and Thad). There’ll be a new release tonight. Look for a post in the morning.