Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Networktables connection stuck #87

Open
Repulser opened this issue Feb 23, 2020 · 26 comments
Open

Networktables connection stuck #87

Repulser opened this issue Feb 23, 2020 · 26 comments

Comments

@Repulser
Copy link

Repulser commented Feb 23, 2020

Hey, we're experiencing an issue where once we hit connect it gets stuck on "Trying to connect" in the console and the callback never gets called.
Already tried using direct ip, mDNS, etc. Anyone have any idea what's going on?

Love the project btw!

@Repulser
Copy link
Author

Repulser commented Feb 23, 2020

It seems to work sometimes and sometimes it hangs.
#78 Seems to be similar

@ErikBoesen
Copy link
Member

@AndrewLester @rakusan2

@AndrewLester
Copy link
Member

We are having some issues with the NT Client calling our robot connection listener with a disconnect notification despite our cameras being loaded and NT being enabled. It may be related to this, so we're going to do some debugging today.

@AndrewLester
Copy link
Member

@Repulser one question, are you running your dashboard on windows or MacOS. Most of our problems occur on windows.

@ErikBoesen
Copy link
Member

Would assume Windows, unless the driverstation has been ported to MacOS since I graduated.

@cjdenio
Copy link
Contributor

cjdenio commented Feb 25, 2020

Sadly, the Driver Station is still Windows-only.

@ErikBoesen
Copy link
Member

😢

@Repulser
Copy link
Author

The dashboard does seem to also run won MacOS, and it happens on both platforms.

@AndrewLester
Copy link
Member

Do you know if your network tables server on the robot is running on the default port?

@Repulser
Copy link
Author

@AndrewLester it is

@rakusan2
Copy link
Contributor

Try starting the debugger with wpilib_NT.startDebug('NT', 2)
This will console log status (0), message types (1), and messages (2) under the name NT
Other than that sorry but I currently can only test my code on a simulator which does not show any problems.

@AndrewLester
Copy link
Member

AndrewLester commented Feb 26, 2020

@Repulser try removing the client.start() call which tries to connect to localhost. (in main.js with the comment above it saying "attempts to connect to localhost"). That fixed our windows connection problem.

@AndrewLester
Copy link
Member

Note that deleting that line will prevent you from connecting to the simulator.

@CrispyBacon1999
Copy link

My team's getting the same error. We tried removing the client.start() but it didn't change anything.

@CrispyBacon1999
Copy link

Can't connect on both windows and Linux.

@CrispyBacon1999
Copy link

After a bunch of testing, attempting to connect anywhere from 3-10 times makes it work, not really sure what that is, but it does actually attempt a connection and succeeds after several attempts.

@AndrewLester
Copy link
Member

AndrewLester commented Feb 28, 2020

@Repulser @CrispyBacon1999 Try checking our main.js file for this season. It connects to the robot on the first try with macos and windows. We've made a few changes from the main.js file in FRCDashboard, so I'll probably do a git diff and find out what we may have fixed unintentionally at some point. It also doesn't use the connect.js file to initiate the connection.

The only real changes seem to be the restriction of the sim to Mac, connecting to the robot in main.js, and this line, which I forget why I added in all honesty.

@Repulser
Copy link
Author

Since our competition was yesterday I quickly ported things over to the pynetworktables2js framework which was rather a breeze. But I will definitely look into this for the next competition and let you know. Thanks!

@ErikBoesen
Copy link
Member

FRCDashboard used to use pynetworktables2js for connection, frankly I've never been a fan of the Node-based connection system so I'd be supportive of migrating back to that platform and simplifying the connection logic a whole lot. Up to you guys though.

@Repulser
Copy link
Author

That explains why porting it over was so simple, the API seems to have stayed between the two versions, pynetworktables2js has proven very stable for us in a competition environment, I support moving back to it. This means it'll be much easier to maintain over the years and can focus more on Dashboard functionality.

@ErikBoesen
Copy link
Member

@AndrewLester can you work with @Repulser to migrate back to pynetworktables2js?

@JubiusII
Copy link

JubiusII commented Mar 1, 2020

I've been having the same problem for the past 2 days, so I gave in and started from scratch (I didn't do much so I'm not too cut up about it). I found out that this problem always happens when I delete the example value from index.html. I decided to keep and just hide it behind some stuff. works fine now.

@ErikBoesen
Copy link
Member

@AndrewLester ^

@CrispyBacon1999
Copy link

What's the process look like to switch back to pynetworktables? My team's debating between that or trying to get a fix going with the nodejs version.

@AndrewLester
Copy link
Member

AndrewLester commented Mar 12, 2020

How about a new branch is made for the pynetworktables2js version, but the main build still uses wpilib-nt-client. I feel like the NodeJS implementation just fits in nicely with the electron app code, should it work properly. Since it does work on occasion (e.x. for us), I don't think we should just remove it.

@ErikBoesen
Copy link
Member

Up to you on the implementation, just get it done soon if you can. Although I don't know how much it will actually matter given the status of certain competitions...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants