I’m trying to setup change channel, band and power via RC with ERLS RX. It works fine if i enable VTX_ENABLE and set those parameters in settings directly, but changing it with RC doesn’t work without any log messages. RC Tramp configuration is fine if it works with FC settings.
Is it supported with latest firmware and how i can setup this method if yes?
Any idea how the ELRS VTX admin tool works? With TBS this would be either/or - either control the VTX from the FC or control it from the TX. There is no specific support currently.
It looks like handler should be added for MSP_SET_VTX_CONFIG message. ERLS firmware in rx_main.cpp just forward this message to FC without any modification.
As reference you can check "case MSP_SET_VTX_CONFIG: " section in betaflight firmware file: src/main/msp/msp.c. It’s also good idea to check file devMSPVTX.cpp from ERLS repository, there is some reference to documentation
In CRSF we have 2 types of header. Common header and extended one (+2 byes).
In betaflight MAX CRSF frame size is different from AP (enum { CRSF_FRAME_SIZE_MAX = 64 }; // 62 bytes frame plus 2 bytes frame header()
).
In AP we have define CRSF_HEADER_TYPE_LEN (CRSF_HEADER_LEN + 1) where CRSF_HEADER_LEN is 2, but it should have 2 option common and extended.
With ERLS MSP message they used extended header (you can check CRSF::SetExtendedHeaderAndCrc function).
In AP we have only common header support because of following definition:
struct Frame _frame;
uint8_t _frame_bytes = (uint8_t)&_frame;
where Frame is strict common format without extended header capability
Is it possible to add support both headers to work with MSP messages? Ping me in PM if you need more info or some assist with this
uint8_t vtxIdx = (config.GetVtxBand()-1) * 8 + config.GetVtxChannel();
packet.addByte(vtxIdx); // band/channel or frequency low byte
packet.addByte(0); // frequency high byte, if frequency mode
if (config.GetVtxPower())
{
packet.addByte(config.GetVtxPower());
packet.addByte(pitmodeAuxState);
}
I implemented code to parse such message but i have some issue when i try to update it. It changed for few seconds after receiving MSP over CRSF packet and switch it back to MissionPlanner configured settings. Could you please suggest correct way to change it permanently from code standpoint in runtime?
According to ERLS documentation it should send such message after RC connection established. So configured setting should not be applied at all or use as default settings till we receive VTX configuration from RC. After receiving such packet it should use as current VTX setting.
There is AP_VideoTX::set_provider_enabled() that you can use to stop other mechanisms updating the VTX. You would probably need to add an MSP type and set it in the right place.
But best to put up a branch/PR - easier to discuss that way