My team might need these in the future so just wondering which one you guys use and how you implement it both electrically and in the code. Any advice would be appreciated thanks!
No code needed! Electrically, just make sure that whatever power output for the switch you buy is something that can be supplied by the vrm.
Switches come in all different kinds. The ones you are looking for are small and light 10/100 or 10/100/1000 non poe and unmanaged. An unmanaged switch (dumb switch) requires no configuration.
One of the best practices when changing the networking configuration on your robot is to assign static IPs to each device so be sure to do that.
Oh thanks thanks. Then how do we select what streams we want to show? Just select from shuffleboard menu?
You plug in whatever cameras you want to your switch. You plug your switch into your radio and then shuffleboard should automatically detect any cameras whether they are dynamic or static. But making everything static IP is good practice. You can go the “camera streams” tab on the right side of shuffleboard to select your camera.
We used this switch as well as its 3-port version this year and were happy with it. We just used the USB power from the RoboRIO which is probably not best practice compared to the VRM but didn’t have any problems, and I think you can probably hack up a power cord for mini or micro USB from the VRM though I don’t know the specifics of that. The only real problem is both times I bought some they went out of stock on amazon! The size and profile of it is SO TINY though, we loved it. So if you can find some somewhere else, it is a great switch to use.
EDIT: I also HIGHLY suggest buying a bunch of assorted lengths of ethernet cable from a site like Monoprice - they are very cheap and will make your wiring look and feel much better to have appropriately sized ethernet cables than a bunch of coiled and ziptied 5 footers laying in your robot.
We’re using these this year, suggested by someone else on CD a while back. Happy with them.
We’ve had pretty good luck with this D-Link switch on our robot. It’s lightweight and reliable and (after cutting and stripping the cable on the included power adapter) wires into one of the ports on the VRM (I don’t remember which, but you can check the power adapter for the necessary voltage). While it would have been nice to use PoE for the switch like we do on our Radio, we find it works adequately as-is (we’ve never lost connection during a match). It should also be noted that your RIO should ALWAYS connect directly to your radio, not through the switch, that way if you do have issues with the switch, you can at least still drive your robot.
As for viewing the feeds, since we’re using ethernet cameras (Limelights), we simply open a web browser to the cameras stream IP and watch it that way, no need to go through the driver station code (it also runs a LOT better than through the DS in our experience). Now that said, if your intent is to have multiple feeds but only view one at a time, you might need to do something with the DS, or use a free program like OBS to switch between the different camera views (using hotkey mapping). We found that with Limelights it’s possible to run 2 video streams (including connecting USB cameras to them for a total of 4 video feeds) in tandem without hitting bandwidth limits.
This is the same switch we use. It is fantastic, durable, and small. And it takes 5v from the vrm. Highly recommend this switch as well.
Make sure to bring spares (as with any other robot part), and make sure they look (and are) sturdy. At the last event I was at, a robot died on the field, and it turned out that the plastic casing for their switch had broken after an impact.
@cbale2000 beat me to it. That’s the one we use as well. We have also used its slightly slower 10/100 (but even smaller) cousin, the D-Link GO-SW-5E:
As with the Gigabit version, power it with 5V from the VRM.
In our first robot, we used that switch, a Raspberry Pi, and the OpenMesh radio. The best way we found to package the whole thing was to pile them up vertically: Raspberry Pi sat on the control board surface, followed by the tiny D-Link switch, and finally the radio on top. We zip-tied the whole thing together and called it: The Network Stack.
Also see this thread: Small networking switch needed for eboard?