rakusan2 / FRC-NT-Client

WPI NetworkTables Client for Node
https://www.npmjs.com/package/wpilib-nt-client
MIT License
21 stars 5 forks source link

Issues with 2019-2020 robots #8

Open Repulser opened 4 years ago

Repulser commented 4 years ago

Hey, great work on the library! It seems that this has a lot of issues when used on bots that are 2019-2020 Is there any fix?

rakusan2 commented 4 years ago

I have not touched this project in 2 years and I currently do not have access to any FRC team or their bots so all testing I am doing is on a simulator. With that simulator, I have confirmed that there is a connection issue but that might take me some time to fix. Luckily the NetworkTables spec has not changed since 2015 so this fix should not take too long.

rakusan2 commented 4 years ago

Sorry I had misinterpreted NT: server: client CONNECTED: 127.0.0.1 port 4519 as meaning that the server is on 4519. The server is actually still on 1735 and I can not find any issues when testing it with the simulator. Are you connecting to the default port 1735? What issues are you having?

CrispyBacon1999 commented 4 years ago

The issues actually come from connecting to the robot. Using either roborio-xxxx-frc.local or the direct ip to it, it's extremely inconsistent on whether it will actually connect.

virtuald commented 4 years ago

I wonder if you should call 'client.destroy' on unsuccessful connections? Right now you're just creating a new client object -- not sure when node will decide to destroy it.

rakusan2 commented 4 years ago

I am currently rewriting this library to change how the socket is handled internally and to stop it from being recreated on every .start() I should have version 2.0 finished either tomorrow or the day after.

This version will also be much easier to read and work on so feel free to have a look at the source code once it is done.

Also, all current function calls will remain the same so an upgrade will be easy.

virtuald commented 4 years ago

It might be useful for you to implement a driver station client too? The driver station provides information about where the robot is when it connects to it.

The python implementation is here: https://github.com/robotpy/pynetworktables/blob/master/_pynetworktables/_impl/ds_client.py

ThomasCrund commented 3 years ago

@rakusan2 Did you end up finishing version 2?

I am wishing to use this In my team's electron dashboard but need to ensure that we won't be having issues with the client