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

Drop MSP_VTX_CONFIG messages with an invalid VTX id #231

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

geoffsim
Copy link
Contributor

EmuFlight reported an issue with the latest VTX code.
For the VTX to communicate with an FC, an MSP_VTX_CONFIG handshake is done to sync the two devices.
If the FC is not interested in controlling the VTX band/channel/power, it still needs to send a response to the VTX when requested. This is achieved by sending an MSP_VTX_CONFIG message with an invalid VTX ID (6 is MSP).
This change detects this invalid message Id and throws the message away.

@@ -1055,6 +1055,11 @@ void parse_vtx_params(uint8_t isMSP_V2) {
return;
}

// Check for unknown VTX device (probably from a device that is not interested in controlling the VTX directly)
if (msp_rx_buf[0] = 0xff) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assingment is intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Thanks, I’ll fix it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have consts on plece :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better now 👌

@geoffsim geoffsim marked this pull request as draft December 16, 2024 18:42
@nerdCopter
Copy link

nerdCopter commented Dec 17, 2024

i locally set the code to == and compiled/flashed it. i do receive camera/video signal now.
VTX Menu (via OSD) is unexpectedly slow. Unsure if this is from an unrelated merge or not. Or if it is a true issue as i'm still able to navigate. I did not revert to older firmware to compare as i have little time at the moment.

@nerdCopter
Copy link

nerdCopter commented Dec 17, 2024

VTX Menu Slow, but Cam feed works fro EmuFlight: https://youtu.be/FvsPrMdEjyk (note slow OSD update and cursor somewhat erratic)
second boot, same, but not as bad: https://youtu.be/PYBrwIm8k4U (near normal, just slow)

Ignore unknown and unsupported VTXs
@geoffsim
Copy link
Contributor Author

Tested on Whoop, Race V1, and Race V2. Also checked against iNav 8.0 and EmuFlight 0.4.3.

@geoffsim geoffsim marked this pull request as ready for review December 17, 2024 13:03
@nerdCopter
Copy link

nerdCopter commented Dec 17, 2024

275dbad tested as working on Freestyle v2 and Race v3. VTX Menu works as well. Thank you!

@ligenxxxx , please merge.

@ligenxxxx ligenxxxx merged commit 7f496a3 into hd-zero:main Dec 19, 2024
11 checks passed
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

Successfully merging this pull request may close these issues.

4 participants