Start PhotonVision after network.target is reached#114
Merged
crschardt merged 1 commit intoPhotonVision:mainfrom Dec 18, 2025
Merged
Start PhotonVision after network.target is reached#114crschardt merged 1 commit intoPhotonVision:mainfrom
crschardt merged 1 commit intoPhotonVision:mainfrom
Conversation
7 tasks
Gold856
approved these changes
Dec 18, 2025
crschardt
added a commit
to PhotonVision/photonvision
that referenced
this pull request
Dec 20, 2025
## Description On the RubikPi3, PhotonVision starts before NetworkManager has fully initialized. This causes it to fail to identify the network interfaces available on the board, which leads to problems with configuring and controling networking from the UI. The failure can be detected by the call to `nmcli` returning an [exit status of 8](https://networkmanager.dev/docs/api/latest/nmcli.html#exit_status), which means "NetworkManager is not running." This PR retries the call to nmcli every 0.5 seconds until the exit status does not equal 8, or a maximum of 10 attempts have been made. The retry only occurs the first time `getAllInterfaces()` is called. Subsequent calls to this method will only make one attempt to avoid locking up the program if networking isn't responding as expected. In my testing on the RubikPi3, the code has to retry for less than 2 seconds in order to get a valid response from NetworkManager. The need for this is greatly reduced by PhotonVision/photon-image-modifier#114, but this code adds an additional layer of robustness against slow network startup. Closes #2212 ## Meta Merge checklist: - [x] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [x] The description documents the _what_ and _why_ - [ ] 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 settings back to v2025.3.2 - [ ] 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 --------- Co-authored-by: samfreund <samf.236@proton.me>
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.
PV tries to access networking information fairly early in the startup process and, when NetworkManager isn't ready, PV cannot get the information it needs about the network hardware.
This PR configures the photonvision service to start after NetworkManager is running. The change is only made when PV is configured to manage networking.
This should reduce the need for PhotonVision/photonvision#2240, but it's safer to have both.