fpv-wtf / msp-osd

MSP DisplayPort OSD
GNU General Public License v3.0
226 stars 32 forks source link

[WIP] VTX-MSP support #136

Open jesuslg123 opened 1 year ago

jesuslg123 commented 1 year ago

Support for VTX MSP

Implement VTX MSP protocol support so the video channel can be changed from Betaflight, ELRS Lua Script or any other system that supports VTX MPS protocol.

The plan is be able to change algo power and bandwidth in the future.

Setup

  1. Update the MSP-OSD package in both ends, Caddx vista/air unit and goggles V1/V2.
  2. Load a VTX table data on Betaflight (this will happen automatically when develop is completed)
  3. The feature is disabled by default, in order to enable it open the MSP-OSD package settings on the WTF OS configurator.

The flow

image

  1. VTX startup up
  2. VTX setup the Betaflight VTX table and mark it as READY
  3. VTX request every 200ms the VTX-MSP data
  4. VTX read the channel from the MSP message
  5. VTX send the data to the goggles via UDP protocol.
  6. Goggles get the message
  7. Goggles update the channel sent from the VTX

Technical details

The VTX-MSP data, including the channel is being pulled every 200ms in a loop. The channel data is added to a data frame sent to the goggles pretty frequently.

Once the data is on the goggles we check if the channel is different to the one from the previous message.

The FC will only send VTX message when the VTX has been marked as READY.

What does it mean ready?

TODO

  1. Sync channel changes from googles to BF. This probably is better to be handled on the VTX side. There is no other system doing this now. Probably it won't be done now.
  2. Automatically set a valid VTX table data on BF.
  3. Enable power change (need to find a method)
  4. Enable bitrate mode change (need to find a method)

Known issues

  1. If channel is changed from the goggles, the sync with the MSP-VTX is lost. Right now this channel change is not being controlled.
  2. You can setup any channel, even if is not supported, it will simply not do the channel change. This happen for index channels bigger than 8 in 25mbits or 3 in 50mbits.