So after connecting up the PI I realized that it doesn’t connecting to roborio-teamnumber-frc.lan, I got the idea of just giving it a static ip address and always connecting to that, problem is, after connecting to the static ip it tries to connect again which cuts the connection and connects again… any idea on what could be using this? should I stick to DHCP?
If you use setClientTeam, NetworkTables attempts to connect on several addresses in parallel, including the static 10.TE.AM.2 address, mDNS roborio-TEAM-frc.local, DNS roborio-TEAM-frc.lan, and the roborio USB address 172.22.11.2. It will keep retrying them until one connects (you’ll see a CONNECTED message when this occurs), and will report errors for the other addresses. It’s safe to ignore the errors as long as you see the CONNECTED message.
If at some point the TCP connection is lost to the server (typically the Rio), the client will give a DISCONNECTED message and then start retrying on all addresses again.
Generally FRC networking is more reliable with static IPs. DHCP/mDNS is great for convenience/ease of use, but setting static addresses (if configured properly) is in general more reliable / faster to come up, as no discovery process is needed for the devices to determine what IP to use.
Thank you for the info! Is there anyway to get it to connect through DNS/mDNS as it sometimes doesn’t attempt to connect with the static IP(or does but is too slow?) I don’t get an erorr nor a CONNECTED message, on an other note, how’d you set up the static IPs(I followed the screensteps but am not entirely sure as connecting is really unreliable and requires me to reboot everything)
It always attempts all addresses (DNS, mDNS, and static). The radio DHCP server is designed to provide the RoboRio with a 10.TE.AM.2 address, which is the same as the static address; if it does both DNS and mDNS should resolve to the same address as the static address.
Which device are you trying to set static?
- RoboRio: set to static 10.TE.AM.2, netmask 255.0.0.0, gateway 10.TE.AM.1; this can be done by connecting the roboRio via USB and opening a browser to 172.22.11.2, then going to the networking tab.
- Set the Pi to static 10.TE.AM.11, netmask 255.0.0.0, gateway 10.TE.AM.1; if you’re using the FRCVision image, this can be done by opening the frcvision.local webpage and going to the network settings tab (note you need to make the Pi writable with the “write” button, and click save when you’re done).
I forgot to ask–is this with the FRCVision image and the default multi camera server program, or are you doing something custom?
Thanks alot! I’ll make sure everything is set up right next time I get my hands on the robot!
I’m using the FRC image with the default program