betaflight / betaflight-tx-lua-scripts

Collection of scripts to configure Betaflight from your TX (currently only supported in OpenTx)
GNU General Public License v3.0
590 stars 142 forks source link

Skip vtx tables download if not available #475

Closed klutvott123 closed 1 year ago

klutvott123 commented 1 year ago

Use msp error bit to determine if message is available in firmware or not. Pass msp error to the layer above so that we can take action if there's an error. The FC will still respond if for example MSP_VTX_CONFIG isn't available, but the msp over telemetry error bit will be set and the payload is an error code. We can use this to detect if the firmware has been compiled with VTX support, and skip vtx tables download if not.

Fixes https://github.com/betaflight/betaflight-tx-lua-scripts/issues/474

betaflight-tx-lua-scripts_1.7.0.zip

klutvott123 commented 1 year ago

Added the message "N/A" that will replace the content of the page if it can't be loaded. Updated first post with new zip file if anyone wants to try it.

TheIsotopes commented 1 year ago

@klutvott123 for the osd elements page there should also be a query as to whether the firmware was compiled with osd. lua scripts must be ended with long RTN because an error message appears.

klutvott123 commented 1 year ago

Where exactly does this error message appear? And what does it say?

MSP_OSD_CONFIG isn't wrapped in "#IF defined(USE_OSD) like it should have been, so it will return something even if the firmware is compiled without OSD. This means we can't detect it in the same way as for vtx and gps rescue for example. The way it's done in the firmware is very inconsistent between messages. it's annoying and we should look into it

TheIsotopes commented 1 year ago

here the sreenshot from error:

screen-2023-03-12-230014

klutvott123 commented 1 year ago

@TheIsotopes And this is without OSD, OSD_SD and OSD_HD?

TheIsotopes commented 1 year ago

yes, here the build log: https://build.betaflight.com/api/builds/4d670535f2542931175af51bc9078de1/log

klutvott123 commented 1 year ago

Thanks! will look into it.

TomAlperin commented 1 year ago

Tested and working properly although I did notice that for analog, the second load is a little bit faster. Tested with my previous work around of creating the files manually and that prevents the VTX table check making the load time a bit faster for digital video systems.

klutvott123 commented 1 year ago

@TomAlperin Thanks for testing. I made it so that it creates a empty vtx table if not available. This will make it skip future download attempts betaflight-tx-lua-scripts_1.7.0.zip

klutvott123 commented 1 year ago

@TheIsotopes Can you try this? https://github.com/betaflight/betaflight/pull/12513