Restart NT client every 5 seconds if not connected#467
Merged
mcm001 merged 4 commits intoPhotonVision:masterfrom Oct 19, 2022
Merged
Restart NT client every 5 seconds if not connected#467mcm001 merged 4 commits intoPhotonVision:masterfrom
mcm001 merged 4 commits intoPhotonVision:masterfrom
Conversation
Contributor
|
@mcm001 when you've got a chance, could you update the branch? My teams ran into this as well and this seems like an easy fix |
shueja
approved these changes
Oct 17, 2022
8 tasks
mcm001
added a commit
that referenced
this pull request
Mar 16, 2026
## Description Back in #467 (comment) and https://discord.com/channels/725836368059826228/725846784131203222/974498049609056266 we added code to poke our NT client every 5 seconds to "clicking the save button in the settings window makes Photon show up again over networktables". Total hack, but it seemed to work. We didn't at the time dig any deeper in Wireshark or debug-level NT logs. <img width="1373" height="679" alt="image" src="https://github.com/user-attachments/assets/8cb2102e-0bae-4bfd-b9ac-55d31f8421b6" /> Now, it's 2026. 4 years on from the OG bug. And this code seems linked to these issues - https://www.chiefdelphi.com/t/photonvision-coprocessor-not-sending-data-can-t-change-networking/516356/5 - https://www.chiefdelphi.com/t/photonvision-network-tables-known-issue/515966 Craig collected these log files as well: [craig-nt-never-connects.zip](https://github.com/user-attachments/files/26001809/craig-nt-never-connects.zip) The code path that handles TCP re-connection was also changed entirely since we first added this workaround. Regardless this hack was not removed as part of the NT3 to NT4 upgrade: - pre-NT4, reconnection was handled by `TCPConnector::connect_parallel` which delegates to `TCPConnector`. This uses raw socket APIs - post-NT4, reconnect is handled by `ParallelTcpConnector`. This uses libuv exclusively @crschardt did some really great debugging with a rio and radio in the loop with a luma p1. In this test setup, removing this code improves stability markedly. I'd still like to get this more on robot time, as well as try to understand from Peter why we might have needed this code in the first place. ## Changes - Remove periodic stop/restart of NetworkTables client every 5 seconds if `NetworkTablesInstance::isConnected` returns false. ## Meta Merge checklist: - [ ] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [ ] The description documents the _what_ and _why_, including events that led to this PR - [ ] If this PR changes behavior or adds a feature, user documentation is updated - [ ] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly - [ ] If this PR touches configuration, this is backwards compatible with all settings going back to the previous seasons's last release (seasons end after champs ends) - [ ] If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated - [ ] If this PR addresses a bug, a regression test for it is added - [ ] If this PR adds a dependency, the license has been checked for compatibility and steps taken to follow it --------- Co-authored-by: Craig Schardt <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.