This is my first post here and I’m new to the hobby so please excuse and noobness.
I have a Mateksys 405 FC with a VTX with a Smartaudio input. The VTX I have is a pain to change the power / band / channel and I want to be able to do this outside of pressing the tiny button on the VTX and trying to understand the LED’s!
At the moment I’d be happy just to be able to control the power with a 3 point switch on the controller.
From what I can understand I have a few options as this is not supported by Ardupilot out of the box;
Upgrade my FC so I can run LUA scripts and writing something that could control it. (would need to buy a F765)
Build a custom firmware using the smartaudio branch on GitHub. (pain with new releases)
Upgrade my RC receiver so it includes a smart audio link so I can change the settings via my Taranis qx7 (expensive?)
Any I missing something? Does anyone else have any other suggestions.
I have not done writing myself, but it look like its one byte at a time. So you could do: port:write(0x05) port:write(0x01) port:write(0x00) port:write(0x6B)
You could write yourself a little helper to take a table and do that for each entry. That would make for a nice example.
If you have a telem connection, you can assign it to scripting rather than mavlink and then use a terminal program, such as the Arduino one, to see what your sending. I think it should also be possible to do that over the USB connection, but I have not tried, (this also means you can’t turn it off unless you have a second MAVLink connection). The H7 boards with dual USB endpoints would be great for this.
What radio equipment are you using (QX7 with 2.4 receiver or crossfire on the QX7)?
You can bypass the FC and just run the smart audio pin from the vtx to the receiver if its crossfire and control all the vtx settings via the opentx built in lua scripts.
I am running a ZOHD Nano Talon with an Matek F405, TBS micro receiver and a vtx with smart audio. By wiring the vtx straight to the smart audio pin on the micro receiver I am able to control everything through the lua script on the QX7.
I decided to go down the LUA Script route and have developed the first version (which is working with Smartaudio v2.0. The instructions for anyone who is interested is below;
These are the instructions to get SmartAudio working on a Mateksys 765 and an Eachine TX805. This build has only been tested on the previously mentioned hardware. It may well work on other flight controllers and VTX’s that support Smartaudio 2.0
This LUA script allows the pilot to change the power settings of the VTX on the fly (manual mode) or it can be set to auto mode where the distance away from the home is used to increase/decrease the VTX power. At the moment this requires to be set in the code but can set via an RC channel also (available in the next build)
There are few things that need to be setup first in order to get the LUA script to run successfully;
see my comments on Discord docs… and I think the auto one should be a separate script…I envision adding stand alone scripts in a separate AP_Scripting dir with a wiki page for LUA applets with complete setup and use instructions…maybe make the default rc higher up so they do not have to change…like ch7 (ch5 is mode in copter/rover)…want them to only copy and go…maybe we should add an RC option for scripting input switch?
fyi, after some discussion of this idea, Peter Hall volunteered to add the binding to find an option channel and return its value…so now the script wont have to hard code a channel, it can be assigned by the user as input…it will be continuous PWM so that it can be shaped by the RC min/max/trim and used as an analog variable also…