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

Changing VTX settings from script causes issues with VTX Table #486

Open
AndreaPro opened this issue Sep 1, 2023 · 57 comments
Open

Changing VTX settings from script causes issues with VTX Table #486

AndreaPro opened this issue Sep 1, 2023 · 57 comments
Labels

Comments

@AndreaPro
Copy link

I am using Betaflight Lua Scripts 1.7.0 (I've even tried the nightly), Betaflight Configurator 10.9.0, Radiomaster TX16S with EdgeTX 2.8.5 and a BetaFPV Meteor 75 Pro updated to BF 4.4.2 and I am using ELRS 3.3.0 on BetaFPV Micro 1W TX and on the quad.
If I open the lua script and I adjust some settings in the VTX section and save them and I power off the quad and connect it to Betaflight configurator the VTX table is wiped completely and the settings are not stored. I've tried generating the lua script VTX table from the configurator and retrieving them from the quad but the result is the same. Pratically the VTX section of the script is unusable because after restart the VTX table is completely wiped.

@haslinghuis
Copy link
Member

Duplicate of #482

@haslinghuis haslinghuis marked this as a duplicate of #482 Sep 1, 2023
@AndreaPro
Copy link
Author

AndreaPro commented Sep 1, 2023

Duplicate of #482

In my opinion it's not a duplicate, it is a different issue. I have compiled the firmware with VTX and OSD already. If it can be of any help the VTX is a BetaFPV M03 with SmartAudio

@klutvott123
Copy link
Member

Does this happen when making the same changes in the betaflight configurator?

@AndreaPro
Copy link
Author

AndreaPro commented Sep 1, 2023 via email

@klutvott123
Copy link
Member

can you try downloading the vtx tables again? https://github.com/betaflight/betaflight-tx-lua-scripts#setting-up-vtx-tables

@AndreaPro
Copy link
Author

AndreaPro commented Sep 1, 2023 via email

@klutvott123
Copy link
Member

That's strange. I'll have to see if I can reproduce

@klutvott123 klutvott123 marked this as not a duplicate of #482 Sep 1, 2023
@AndreaPro
Copy link
Author

AndreaPro commented Sep 1, 2023 via email

@klutvott123
Copy link
Member

Is it the setting of a specific parameter that causes the issue? Could you try 4.4.1 and maybe 4.4.0?

@AndreaPro
Copy link
Author

AndreaPro commented Sep 1, 2023 via email

@AndreaPro
Copy link
Author

AndreaPro commented Sep 1, 2023 via email

@klutvott123
Copy link
Member

Seems like the lua scripts end up with the "empty" vtx table after downloading? We'll have to figure out why that happens then.
I just tested this with a betafpv meteor65 board with 4.4.2, and I'm not able to reproduce. Vtx table is correctly downloaded, and I can change all parameters.

@klutvott123
Copy link
Member

@AndreaPro Can you share a diff please?

@AndreaPro
Copy link
Author

AndreaPro commented Sep 3, 2023

@AndreaPro Can you share a diff please?

For sure! I have tried both with the stock CLI provided by BetaFPV and with my custom settings but I have the same issue.

Do you have stock settings for your VTX table? Because the CLI on the BetaFPV website for the Meteor 65 appears to have the same VTX table as mine

CLI.zip

@tomekste5
Copy link

Got the same issue if I download the vtx table or copy the lua script from betaflight to my controller, it overwrites my vtx table.

@AndreaPro
Copy link
Author

Got the same issue if I download the vtx table or copy the lua script from betaflight to my controller, it overwrites my vtx table.

Could you please share more infos about radio firmware version, Betaflight version, script version, drone model, etc...?

@tomekste5
Copy link

tomekste5 commented Sep 11, 2023

Oh ye sure sry,
Betaflight version: 4.3
Edge TX version: 2.8.0 (Radiomaster Boxer)
Betaflight lua script version: 1.7
Flight controller: Speedybee F405
VTX: TBS Unify Pro32 (https://www.team-blacksheep.com/vtx-table-for-betaflight.txt) (unlocked)

After I try to switch a setting, my VTX table on the flight controller gets overwritten to the same table u shared

@klutvott123
Copy link
Member

The only thing I can think of is that the payload somehow contains more bytes than it should, and this happens:
https://github.com/betaflight/betaflight/blob/99be07729963e4b5e5cb540555450bda28bd2781/src/main/msp/msp.c#L3380-L3407

It's strange because in the BF lua scripts we're only sending four bytes back to the FC

@klutvott123
Copy link
Member

@tomekste5 Which RX system are you using?

@tomekste5
Copy link

I am using Express LRS version 3.3 2.4GHz and as a Receiver I use the Radiomaster RP1

@AndreaPro
Copy link
Author

I am using Express LRS version 3.3 2.4GHz and as a Receiver I use the Radiomaster RP1

So we have in common ELRS 3.30 2.4GHz

@klutvott123
Copy link
Member

maybe try disabling vtx administrator in the elrs lua script.

@AndreaPro
Copy link
Author

maybe try disabling vtx administrator in the elrs lua script.

I have tried VTX administrator in elrs lua script because the Betaflight script was destroying the VTX table, but I have never used it before discovering this issue

@klutvott123
Copy link
Member

try disabling it by setting "band" to "off". did this happen with earlier versions of elrs? the payload sent back from the betaflight lua scripts is only 4 bytes, but if more bytes are sent the vtx tables could be reset. not sure where those bytes are coming from. needs more investigating.

@AndreaPro
Copy link
Author

try disabling it by setting "band" to "off". did this happen with earlier versions of elrs? the payload sent back from the betaflight lua scripts is only 4 bytes, but if more bytes are sent the vtx tables could be reset. not sure where those bytes are coming from. needs more investigating.

I have tried the Betaflight lua directly starting with ELRS 3.3.0. I will try disabling it but I am sure that the first time that I have noticed this issue I haven't enabled VTX admin yet

@tomekste5
Copy link

tomekste5 commented Sep 23, 2023

I have never enabled VTX administrator

maybe try disabling vtx administrator in the elrs lua script.

@klutvott123
Copy link
Member

If it's not too much hassle, could you guys please try ELRS 3.0? I'm not saying elrs is the issue, but we need to rule things out. As I said, the payload sent from the bf lua scripts is 4 bytes, but it could be that zero padding or something is added somewhere along the way to the FC.

@tomekste5
Copy link

tomekste5 commented Sep 28, 2023

There is no target for the internal module of the Boxer radio in ExpressLRS v3.0

@AndreaPro
Copy link
Author

AndreaPro commented Oct 21, 2023

@AndreaPro Thanks for testing! Maybe open an issue on the ELRS github, or ask on their discord. I'm sure they have an explanation for it.

Done! On ELRS Discord they suggested me to try the nightly of the luascripts, I've tried v20231020.10 but still the same issue with ELRS 3.3

@0crap
Copy link
Contributor

0crap commented Oct 22, 2023

Same here. Latest stable v1.7.0 or nightly v20231020.10 wipes VTX tables on save.
Even reading the VTX tables goes wrong.
Reading gives:
Band 4
Channel 4
Power LV2
Pit Mode OFF
Protocol SA
Frequency 5800

While in fact my diff contains this:

vtxtable

vtxtable bands 6
vtxtable channels 8
vtxtable band 1 BOSCAM_A A FACTORY 5865 5845 5825 5805 5785 5765 5745 5725
vtxtable band 2 BOSCAM_B B FACTORY 5733 5752 5771 5790 5809 5828 5847 5866
vtxtable band 3 BOSCAM_E E FACTORY 5705 5685 5665 5645 5885 5905 5925 5945
vtxtable band 4 FATSHARK F FACTORY 5740 5760 5780 5800 5820 5840 5860 5880
vtxtable band 5 RACEBAND R FACTORY 5658 5695 5732 5769 5806 5843 5880 5917
vtxtable band 6 LOWBAND L CUSTOM 5362 5399 5436 5473 5510 5547 5584 5621
vtxtable powerlevels 3
vtxtable powervalues 14 20 26
vtxtable powerlabels 25 100 400

set vtx_band = 5
set vtx_channel = 3
set vtx_power = 3
set vtx_low_power_disarm = UNTIL_FIRST_ARM
set vtx_freq = 5732

@0crap
Copy link
Contributor

0crap commented Oct 22, 2023

The mcu_id.lua on my SD card \SCRIPTS\BF\VTX_TABLES contains:

return {
frequencyTable = {
{ 0, 0, 0, 0, 0, 0, 0, 0, },
{ 0, 0, 0, 0, 0, 0, 0, 0, },
{ 0, 0, 0, 0, 0, 0, 0, 0, },
{ 0, 0, 0, 0, 0, 0, 0, 0, },
{ 0, 0, 0, 0, 0, 0, 0, 0, },
{ 0, 0, 0, 0, 0, 0, 0, 0, },
},
frequenciesPerBand = 8,
bandTable = { [0]="U", "1", "2", "3", "4", "5", "6", },
powerTable = { "LV0", "LV1", "LV2", },
}

@AndreaPro
Copy link
Author

Same here. Latest stable v1.7.0 or nightly v20231020.10 wipes VTX tables on save. Even reading the VTX tables goes wrong. Reading gives: Band 4 Channel 4 Power LV2 Pit Mode OFF Protocol SA Frequency 5800

While in fact my diff contains this:

vtxtable

vtxtable bands 6 vtxtable channels 8 vtxtable band 1 BOSCAM_A A FACTORY 5865 5845 5825 5805 5785 5765 5745 5725 vtxtable band 2 BOSCAM_B B FACTORY 5733 5752 5771 5790 5809 5828 5847 5866 vtxtable band 3 BOSCAM_E E FACTORY 5705 5685 5665 5645 5885 5905 5925 5945 vtxtable band 4 FATSHARK F FACTORY 5740 5760 5780 5800 5820 5840 5860 5880 vtxtable band 5 RACEBAND R FACTORY 5658 5695 5732 5769 5806 5843 5880 5917 vtxtable band 6 LOWBAND L CUSTOM 5362 5399 5436 5473 5510 5547 5584 5621 vtxtable powerlevels 3 vtxtable powervalues 14 20 26 vtxtable powerlabels 25 100 400

set vtx_band = 5 set vtx_channel = 3 set vtx_power = 3 set vtx_low_power_disarm = UNTIL_FIRST_ARM set vtx_freq = 5732

Which drone and which ELRS version on TX and RX?

@0crap
Copy link
Contributor

0crap commented Oct 22, 2023

@AndreaPro home made quad. ELRS 3.3.0 on both TX and RX.

@AndreaPro
Copy link
Author

@AndreaPro home made quad. ELRS 3.3.0 on both TX and RX.

Which FC?

@0crap
Copy link
Contributor

0crap commented Oct 22, 2023

Flycolor X-Tower

board_name OMNIBUSF4SD
manufacturer_id AIRB

version
Betaflight / STM32F405 (S405) 4.4.2 Jun 1 2023 / 02:07:34 (23d066d08) MSP API: 1.45

@klutvott123
Copy link
Member

it probably has something to do with the new MSP VTX code in ELRS 3.3.0

@klutvott123
Copy link
Member

updated to 3.3.0 now. All I have to do is start the bf lua and let it download vtx tables, and then they disappear from the FC

@0crap
Copy link
Contributor

0crap commented Oct 22, 2023

updated to 3.3.0 now. All I have to do is start the bf lua and let it download vtx tables, and then they disappear from the FC

That is not what happens here.
Only when I hit the "save page" button from the lua script my vtxtables is missing from the diff all.
Reading alone does not ruin my vtxtables.

iirc just saving a PIDs page with the lua script goes fine. (But i should re-test that when back at home.)

@klutvott123
Copy link
Member

I just built elrs 3.3.0 without msp vtx support, and now it works fine, so there's definitely something going on in the RX code. downloading vtx tables works, and saving the vtx page works. vtx tables still there.

@bloudman648
Copy link

bloudman648 commented Nov 11, 2023

this problem is still there on elrs 3.3.1...will there be a fix or should we build our own fw without msp support?
and does it only ereases the vtx table? i dont trust the lua script when changing on field pids or rates...

using edgetx 2.9.1 / tx16s mark ii
iflight blitz f7 stack & blitz 1.6w vtx (nazgul v3)

btw i am new to this fpv hobby :)
started 2 weeks ago

ahh...and i also tried to export the vtx table directly to the bf lua script vtx table folder but without any luck...
the bf lua script just ereases the saved lua vtx table and sets everything to zero.

@klutvott123
Copy link
Member

@bloudman648 It only affects vtx/vtx tables. Everything else should work.

There's not much we can do about this in the betaflight lua scripts. The script is working as it should and only sending the necessary bytes back when setting vtx parameters. The data is being tampered with somewhere else.

You could report this issue here too ExpressLRS/ExpressLRS#2452 (comment)

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within a week.

@jonathanoeijoeng
Copy link

jonathanoeijoeng commented Dec 20, 2023

I have exactly same issue with this.
I'm using Radiomaster boxer using elrs 3.3.0 dan rx radiomaster rp1 same elrs versionon FC Speedybee F405 v3
Everytime I download vtx table, all reset just like this case.
I did edit vtx-table.lua and copy the correct table and power but problem still remain even I have restart both tx and rx

https://github.com/betaflight/betaflight-tx-lua-scripts#setting-up-vtx-tables

@jonathanoeijoeng
Copy link

Any luck with RX 3.3.1?

If it's not too much hassle, could you guys please try ELRS 3.0? I'm not saying elrs is the issue, but we need to rule things out. As I said, the payload sent from the bf lua scripts is 4 bytes, but it could be that zero padding or something is added somewhere along the way to the FC.

I can try it and let you know

Hello, finally I have been able to do some tests. I couldn't downgrade to ELRS 3.0 because there was no Target available for BETA FPV AIO RX. I've tried the following:

TX3.1.1 and RX3.1.1 = OK TX3.2.1 and RX3.2.1 = OK TX3.3.0 and RX 3.3.0 = BAD TX 3.3.0 and RX 3.2.1 = OK

So the issue appears to happen with ELRS 3.3.0 on the RX side

@github-actions github-actions bot removed the Inactive label Dec 20, 2023
@AndreaPro
Copy link
Author

Any luck with RX 3.3.1?

If it's not too much hassle, could you guys please try ELRS 3.0? I'm not saying elrs is the issue, but we need to rule things out. As I said, the payload sent from the bf lua scripts is 4 bytes, but it could be that zero padding or something is added somewhere along the way to the FC.

I can try it and let you know

Hello, finally I have been able to do some tests. I couldn't downgrade to ELRS 3.0 because there was no Target available for BETA FPV AIO RX. I've tried the following:
TX3.1.1 and RX3.1.1 = OK TX3.2.1 and RX3.2.1 = OK TX3.3.0 and RX 3.3.0 = BAD TX 3.3.0 and RX 3.2.1 = OK
So the issue appears to happen with ELRS 3.3.0 on the RX side

I haven't tried it yet but if no one fixed it in the Betaflight or ELRS code repos I doubt that it will be fixed by itself

@jonathanoeijoeng
Copy link

ExpressLRS/ExpressLRS#2452 (comment)

you're right. I guess we stuck with 3.2.1 then

@LoakAudio
Copy link

Perhaps a solution on the horizon ? ExpressLRS/ExpressLRS#2525

Copy link

github-actions bot commented Feb 6, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within a week.

@haslinghuis
Copy link
Member

Please confirm this is solved with ExpressLRS/ExpressLRS#2525 included

@AndreaPro
Copy link
Author

Please confirm this is solved with ExpressLRS/ExpressLRS#2525 included

I haven't tested it yet because I was thinking that the merged commit will become available with the next ELRS update

@haslinghuis
Copy link
Member

Ah okay, just checked, we need version 3.4 to be released for testing.

@github-actions github-actions bot removed the Inactive label Feb 7, 2024
@LoakAudio
Copy link

Ah okay, just checked, we need version 3.4 to be released for testing.

Tested today with GIT Branch/Master of ELRS and the penultimate betaflight-tx-lua-scripts-nightlies, VTX tables are loading correctly. No more issue for me.

@haslinghuis haslinghuis added the bug label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants