Runcam Split 2S not work with MambaF405mk2 FC
Current Behavior
No Wifi, Power and Change mode button features enabled after FC and runcam power up. Uart5 used for connection, 115200 baud rate, runcam device enabled in Ports tab.
This issue happened when migrated from Betaflight to INAV. On Betaflight it worked well so far. When observing uart comm with scope and uart2usb converter I noticed initial get versionInfo command is sent 7x for V2 protocol version followed 7x V1 version. With INAV it always sends both requests 7x for each protocol version regardless response is sent back to FC at some point. Response format is correct and it takes about runcam 5-7 secs after powerup to sent it. Maybe reponse is sent just when 6 trials has expired and V1 processing doesnt recognize this response anymore. On betaflight however response is recognized and parsed correctly even V1 protocol request is already sending. This would explain why on Betaflight it works.
When extending trial period and made my build it helped but not for 100%. It seems there is some other bug or hw issue with Tx line. I noticed that RunCam Tx voltage level is not always 3.3V and its pullup is quite weak. Unfortunatelly I have not made picture for reference.
Steps to Reproduce
Power up both FC and runcam Send Wifi, Power, Mode commands and see runcam response
Expected behavior
Func above should work well.
Suggested solution(s)
I suggest couple changes in the code rcdevice.c
-
extend trial interval from 1 sec to 2-3 secs. #define RCDEVICE_INIT_DEVICE_ATTEMPT_INTERVAL 3000 It will not fillup runcam device with many requests if is known runcam needs >5 secs to startup. Event mentioned in the code, there is no 3 sec delay after powerup before first request is sent.
-
Preset runcam device with some basic config with enabled 3 features and do not rely on response. If response is received it will override this initial setup. If not runcam will be somehow functional for at least these commands. static void runcamDeviceGetDeviceInfo(runcamDevice_t *device) { // preset with rc split 2s device info which has issue to respond device->info.features = RCDEVICE_PROTOCOL_FEATURE_SIMULATE_POWER_BUTTON | RCDEVICE_PROTOCOL_FEATURE_SIMULATE_WIFI_BUTTON | RCDEVICE_PROTOCOL_FEATURE_CHANGE_MODE; device->info.protocolVersion = RCDEVICE_PROTOCOL_VERSION_1_0; device->isReady = true; runcamDeviceSendRequestAndWaitingResp(device, RCDEVICE_PROTOCOL_COMMAND_GET_DEVICE_INFO, NULL, 0, RCDEVICE_INIT_DEVICE_ATTEMPT_INTERVAL, RCDEVICE_INIT_DEVICE_ATTEMPTS, NULL, runcamDeviceParseV2DeviceInfo);
} I might create branch with these changes if you are interested. After this updates runcam is working well as with Betaflight fw.
I know this issue was already solving in the past (Inav 2.x versions) but probably not for all runcam split scenarios. This update will make INAV more robust against various runcam deviations.
version
INAV/MAMBAF405 7.0.0 Sep 28 2023 / 23:10:51 (497c01eb)
GCC-10.3.1 20210824 (release)
- FC Board name and vendor: MAMBAF405MK2
- RunCam Split 2S with latest fw 3.2
- INAV version string: 7.0.0
Hello @FLahner23 FLahner23, I am also having this trouble on 7.1.2. Can you tell me how to implement the fix you provided above? do I need source code access and a compiler? can I do this by the CLI in INAV Configurator?
Thank you,
Kyle
Hi Kyle, just port the suggested changes to the latest Inav software and build.You need toolchain with compiler provided to build it.
Filip