Control RunCam Split 4 video recording from a radio transmitter

Here is a f765 wing debug build:

In order to see the debug you will need to use mavproxy:

https://ardupilot.org/mavproxy/docs/getting_started/quickstart.html#over-usb

Please start the flight controller, wait until you get the “features” message and then try the video start/stop - please then send me the output

Here is a f405 wing debug build:

In order to see the debug you will need to use mavproxy:

https://ardupilot.org/mavproxy/docs/getting_started/quickstart.html#over-usb

Please start the flight controller, wait until you get the “features” message and then try the video start/stop - please then send me the output

Hi, thank you for support.

I ran it twice, the “features” did not appear.
I switched the “Record” switch from top to bottom and back. If I repeat this, I get exactly the same result.
Didn’t use sticks as the menu works fine.

f765 MAVProxy log:

APM: RunCamControl MIDDLE
RunCam[READY]: osd option
RunCam[READY]: update_state_machine_disarmed(NONE)
APM: RunCamControl HIGH
RunCam[READY]: start recording(2)
RunCam[READY]: update_state_machine_disarmed(START_RECORDING)
RunCam[READY]: press button 3, timeout=800ms
RunCam[VIDEO_RECORDING]: update_state_machine_disarmed(NONE)
APM: RunCamControl MIDDLE
RunCam[VIDEO_RECORDING]: osd option
RunCam[VIDEO_RECORDING]: update_state_machine_disarmed(NONE)
APM: RunCamControl LOW
RunCam[VIDEO_RECORDING]: stop recording(3)
RunCam[VIDEO_RECORDING]: update_state_machine_disarmed(STOP_RECORDING)
RunCam[VIDEO_RECORDING]: press button 4, timeout=800ms

Here’s some output from F405-WING with RunCam Hybrid:

Note: This line doesn’t always appear:

APM: RunCam initialized, features 0x007F, 5-key OSD

But the results afterwards are the same no matter if it does:

APM: RunCamControl MIDDLE
RunCam[ENTERING_MENU]: osd option
RunCam[ENTERING_MENU]: update_state_machine_disarmed(NONE)
RunCam[ENTERING_MENU]: ENTER_MENU,M:-1,B:0,O:3
RunCam[ENTERING_MENU]: OSD cable simulation event IN_MENU_ENTER
RunCam[ENTERING_MENU]: sending command: 2, op: 1
RunCam[ENTERING_MENU]: retrying[2] command 0x2, op 0x1
RunCam[ENTERING_MENU]: retrying[1] command 0x2, op 0x1
RunCam[ENTERING_MENU]: timeout command 0x2, op 0x1
RunCam[ENTERING_MENU]: response for command 2 result: 4
APM: RunCamControl HIGH
RunCam[ENTERING_MENU]: start recording(4)
Mode RTL
RunCam[ENTERING_MENU]: update_state_machine_disarmed(START_RECORDING)
RunCam[ENTERING_MENU]: ENTER_MENU,M:-1,B:0,O:4
RunCam[ENTERING_MENU]: OSD cable simulation event IN_MENU_ENTER
RunCam[ENTERING_MENU]: sending command: 2, op: 1
RunCam[ENTERING_MENU]: retrying[2] command 0x2, op 0x1
RunCam[ENTERING_MENU]: retrying[1] command 0x2, op 0x1
RunCam[ENTERING_MENU]: timeout command 0x2, op 0x1
RunCam[ENTERING_MENU]: response for command 2 result: 4
APM: RunCamControl MIDDLE
RunCam[ENTERING_MENU]: osd option
RunCam[ENTERING_MENU]: update_state_machine_disarmed(NONE)
RunCam[ENTERING_MENU]: ENTER_MENU,M:-1,B:0,O:3
RunCam[ENTERING_MENU]: OSD cable simulation event IN_MENU_ENTER
RunCam[ENTERING_MENU]: sending command: 2, op: 1
Mode FBWA
RunCam[ENTERING_MENU]: retrying[2] command 0x2, op 0x1
RunCam[ENTERING_MENU]: retrying[1] command 0x2, op 0x1
RunCam[ENTERING_MENU]: timeout command 0x2, op 0x1
RunCam[ENTERING_MENU]: response for command 2 result: 4
APM: RunCamControl LOW
RunCam[ENTERING_MENU]: stop recording(4)
RunCam[ENTERING_MENU]: update_state_machine_disarmed(STOP_RECORDING)
RunCam[ENTERING_MENU]: ENTER_MENU,M:-1,B:0,O:4
RunCam[ENTERING_MENU]: OSD cable simulation event IN_MENU_ENTER
RunCam[ENTERING_MENU]: sending command: 2, op: 1
RunCam[ENTERING_MENU]: retrying[2] command 0x2, op 0x1
RunCam[ENTERING_MENU]: retrying[1] command 0x2, op 0x1
RunCam[ENTERING_MENU]: timeout command 0x2, op 0x1
RunCam[ENTERING_MENU]: response for command 2 result: 4
RunCam[ENTERING_MENU]: update_state_machine_disarmed(IN_MENU_EXIT)
RunCam[ENTERING_MENU]: ENTER_MENU,M:-1,B:0,O:4
RunCam[ENTERING_MENU]: OSD cable simulation event IN_MENU_ENTER
RunCam[ENTERING_MENU]: sending command: 2, op: 1
RunCam[ENTERING_MENU]: retrying[2] command 0x2, op 0x1
RunCam[ENTERING_MENU]: retrying[1] command 0x2, op 0x1
RunCam[ENTERING_MENU]: timeout command 0x2, op 0x1
RunCam[ENTERING_MENU]: response for command 2 result: 4
RunCam[ENTERING_MENU]: update_state_machine_disarmed(IN_MENU_RIGHT)
RunCam[ENTERING_MENU]: ENTER_MENU,M:-1,B:0,O:4
RunCam[ENTERING_MENU]: OSD cable simulation event IN_MENU_ENTER
RunCam[ENTERING_MENU]: sending command: 2, op: 1
RunCam[ENTERING_MENU]: retrying[2] command 0x2, op 0x1
RunCam[ENTERING_MENU]: retrying[1] command 0x2, op 0x1
RunCam[ENTERING_MENU]: timeout command 0x2, op 0x1
RunCam[ENTERING_MENU]: response for command 2 result: 4
RunCam[ENTERING_MENU]: update_state_machine_disarmed(IN_MENU_DOWN)
RunCam[ENTERING_MENU]: ENTER_MENU,M:-1,B:0,O:4
RunCam[ENTERING_MENU]: OSD cable simulation event IN_MENU_ENTER
RunCam[ENTERING_MENU]: sending command: 2, op: 1
RunCam[ENTERING_MENU]: retrying[2] command 0x2, op 0x1
RunCam[ENTERING_MENU]: retrying[1] command 0x2, op 0x1
RunCam[ENTERING_MENU]: timeout command 0x2, op 0x1
RunCam[ENTERING_MENU]: response for command 2 result: 4
RunCam[ENTERING_MENU]: update_state_machine_disarmed(IN_MENU_UP)
RunCam[ENTERING_MENU]: ENTER_MENU,M:-1,B:0,O:4
RunCam[ENTERING_MENU]: OSD cable simulation event IN_MENU_ENTER
RunCam[ENTERING_MENU]: sending command: 2, op: 1
RunCam[ENTERING_MENU]: retrying[2] command 0x2, op 0x1
RunCam[ENTERING_MENU]: retrying[1] command 0x2, op 0x1
RunCam[ENTERING_MENU]: timeout command 0x2, op 0x1
RunCam[ENTERING_MENU]: response for command 2 result: 4

What I did:

  • Moved assigned 3-position switch up an down (I used my RTL switch for testing)
  • Moved aileron, then elevator

There is no RunCam menu appearing on screen, and recording on/off is entirely unaffected by my input, no matter if auto record is on or off.

Thanks for your efforts!

Can you try setting features to 0x4077 and see if you get a different result? This should force 2-key mode.

No can do. The value always reverts back to 127 after reboot.

Should I also try setting features to 0x4077? I have menu works fine, looks like mode correct.
But RunCam doesn’t start recording.
Who sending message RunCam[VIDEO_RECORDING] ?

Please can you send the output you get from mavproxy - I would like to see if your situation is the same

1 Like

Please could you try the updated build I have put in the same location - I have made 2-key OSD take preference over 5-key, let’s see if that makes any difference

With that version I was able to enter different modes (start/stop/QR) with the right stick, no matter what position the switch was set to (low/middle/high). But I couldn’t figure out the logic behind it. Sometimes even the AP OSD disappeared, very strange.

There were no debug messages via mavproxy this time, so I have nothing else to offer - maybe the version was for F765? I use the F405-WING.

By the way, sandre also posted a log a few days ago.

This is the correct behaviour and as far as I can tell its doing the right thing. Ergo this may be an issue in the RunCam firmware - could you possibly raise a ticket with RunCam and explain that the runcam device protocol is not working for start and stop recording?

Sorry may have missed the debug flag. So just so I am clear - what was working and what was not working?

I’ve updated the build with debug

Here is some more output with the latest debug build:

RunCam[INITIALIZING]: sending command: 0, op: 0
Mode MANUAL
RunCam[INITIALIZING]: received response for command 0
APM: RunCam initialized, features 0x007F, 2-key OSD
RunCam[INITIALIZED]: RunCam: initialized state: video: 0, osd: 4, cam: 10
APM: RunCamControl HIGH
RunCam[INITIALIZED]: start recording(1)
APM: VTX: Freq: 5809MHz, Power: 25mw, Band: 2, Chan: 5
Mode RTL
APM: GPS 1: detected as u-blox at 230400 baud
APM: EKF3 waiting for GPS config data
RunCam[INITIALIZED]: update_state_machine_disarmed(START_RECORDING)
RunCam[INITIALIZED]: press button 3, timeout=1600ms
RunCam[VIDEO_RECORDING]: device fully booted after 10684ms
RunCam[VIDEO_RECORDING]: update_state_machine_disarmed(NONE)
APM: EKF3 IMU0 buffs IMU=11 OBS=4 OF=10 EN:10 dt=0.0200
APM: RunCamControl LOW
RunCam[VIDEO_RECORDING]: stop recording(3)
RunCam[VIDEO_RECORDING]: update_state_machine_disarmed(STOP_RECORDING)
RunCam[VIDEO_RECORDING]: press button 4, timeout=800ms
Mode FBWA
RunCam[READY]: update_state_machine_disarmed(NONE)
APM: RunCamControl MIDDLE
RunCam[READY]: osd option
RunCam[READY]: update_state_machine_disarmed(NONE)
APM: GPS: u-blox 1 saving config
APM: RunCamControl HIGH
RunCam[READY]: start recording(2)
Mode RTL
RunCam[READY]: update_state_machine_disarmed(START_RECORDING)
RunCam[READY]: press button 3, timeout=800ms
APM: u-blox 1 HW: 00080000 SW: ROM CORE 3.01 (107888)
RunCam[VIDEO_RECORDING]: update_state_machine_disarmed(NONE)
APM: RunCamControl LOW
RunCam[VIDEO_RECORDING]: stop recording(3)
RunCam[VIDEO_RECORDING]: update_state_machine_disarmed(STOP_RECORDING)
RunCam[VIDEO_RECORDING]: press button 4, timeout=800ms
Mode FBWA
RunCam[READY]: update_state_machine_disarmed(NONE)
RunCam[READY]: update_state_machine_disarmed(IN_MENU_EXIT)
RunCam[READY]: update_state_machine_disarmed(NONE)
RunCam[READY]: update_state_machine_disarmed(IN_MENU_ENTER)
RunCam[ENTERING_MENU]: update_state_machine_disarmed(NONE)
RunCam[ENTERING_MENU]: ENTER_MENU,M:-1,V:0,O:4
RunCam[ENTERING_MENU]: press button 2, timeout=800ms
RunCam[ENTERING_MENU]: update_state_machine_disarmed(NONE)
RunCam[ENTERING_MENU]: ENTER_MENU,M:0,V:0,O:4
RunCam[ENTERING_MENU]: press button 2, timeout=800ms
RunCam[IN_MENU]: update_state_machine_disarmed(NONE)
RunCam[IN_MENU]: NONE,M:1,V:0,O:4
RunCam[IN_MENU]: update_state_machine_disarmed(IN_MENU_DOWN)
RunCam[IN_MENU]: IN_MENU_DOWN,M:1,V:0,O:4
RunCam[IN_MENU]: press button 1, timeout=300ms
RunCam[IN_MENU]: update_state_machine_disarmed(IN_MENU_DOWN)
RunCam[IN_MENU]: IN_MENU_DOWN,M:1,V:0,O:4
RunCam[IN_MENU]: press button 1, timeout=300ms
RunCam[IN_MENU]: update_state_machine_disarmed(IN_MENU_EXIT)
RunCam[IN_MENU]: IN_MENU_EXIT,M:1,V:0,O:4
RunCam[IN_MENU]: press button 2, timeout=800ms
RunCam[EXITING_MENU]: update_state_machine_disarmed(NONE)
RunCam[EXITING_MENU]: EXIT_MENU,M:-1,V:0,O:4
RunCam[READY]: update_state_machine_disarmed(NONE)
RunCam[READY]: update_state_machine_disarmed(IN_MENU_ENTER)
RunCam[ENTERING_MENU]: update_state_machine_disarmed(IN_MENU_ENTER)
RunCam[ENTERING_MENU]: ENTER_MENU,M:-1,V:0,O:4
RunCam[ENTERING_MENU]: press button 2, timeout=800ms
RunCam[ENTERING_MENU]: update_state_machine_disarmed(NONE)
RunCam[ENTERING_MENU]: ENTER_MENU,M:0,V:0,O:4
RunCam[ENTERING_MENU]: press button 2, timeout=800ms
RunCam[IN_MENU]: update_state_machine_disarmed(NONE)
RunCam[IN_MENU]: NONE,M:1,V:0,O:4

Although it says START_RECORDING and STOP_RECORDING in the log when the 3-position switch is being moved, recording is not actually started or stopped. After moving the switch, I moved the right stick. This somehow makes the cam enter 3 different states (rec/stop/qr) but I can’t replicate which movement causes that. There is no OSD from the cam appearing on screen. The position of the switch (low/mid/high) doesn’t appear to be influencing the results of the stick movements in any way.

I’m beginning to think the implementation of this protocol might be a bit quirky and RunCam just hoped nobody would ever look at it too closely. :wink:

As far as I can tell from the debug the right commands are being sent. The runcam protocol is a very thin layer on the physical device, so its usually instructive to see what physical actions are required to produce certain behaviour - although unfortunately I have not been successful in debugging this way without the physical device in my hands.

Can you tell me exactly what the two buttons do after startup? Also timing is important - how long does it take the camera to boot before it will accept button commands? When you press a button how long does it take the command to activate?

I think to properly document that I’d have to do a video of the stick movements, synced to the log. It’s possible but at the moment I don’t have the time, sorry.

But generally I’d simply like the switch to start/stop recording - without using any sticks (= emulated buttons) or menus at all, just as sandre requested a while ago.

In fact the stick input (= menu navigation, although I see no menu) makes both (including Ardupilot’s) OSDs disappear at the moment, as I mentioned a few days ago. That means when I test the control surfaces with RunCam control activated, I sometimes lose the AP OSD until I randomly wiggle around and it comes back.

If the log says START_RECORDING and STOP_RECORDING by using the assigned switch, maybe the whole stick input/menu thing is not needed and the focus should be on why there are log entries for start/stop, but the cam seems to ignore those commands.

On a side not, I wonder how it is technically even possible for the RunCam Hybrid to make the AP OSD disappear…

By the way, as far as I know, the 2 physical buttons on this cam cannot bring up any kind of menu. The functions are simply: Button 1 = start/stop - Button 2 (only has a long press function) = QR mode. So button 1 on a switch is all that is needed. To get into the a menu, you have to connect a joystick/pad - or use RunCam control, but a menu is not needed for start/stop and probably doesn’t even contain an entry for it.

Ok this helps thanks. I’m not sure I’m going to be able to address this without the physical device, but understanding how it works might help. My updated build is the wrong approach - the original is closer, but clearly something is stopping it work properly.

BTW if you want to test control surfaces you should move the OSD control to a switch - you don’t have to use the stick commands. CAM_RC_CONTROL allows you to select which.

Ok, now I’m not sure I ever really set CAM_RC_CONTROL and CAM_RC_FEATURES. I think I tried some values 2 months ago when I gave up in the end, but now I noticed those are in fact bitmaks. And I’m not familiar with those, usually in MP there is a nice easy popup with checkboxes but not here. Currently CAM_RC_CONTROL is set to 10, CAM_RC_FEATURES is 0 - that’s probably all wrong… :face_with_raised_eyebrow:

So if I don’t want to use/enter/navigate any menus, I only set “4 = Autorecording enabled”?

It’s a pity there are not 20 people here in this thread waiting for this feature, so everyone could donate 5 bucks and get you a RunCam Hybrid. :wink: It’s a nice cam worth having! Some say they don’t last long but the 2 I have work so far, just the record indicator LED failed on one. FPV quality is by far superior to the Split cams, due to seperate lenses.

CAM_RC_CONTROL should not normally need to be set from the default (0x10) unless you want different behaviour. 10 is 0b1010 i.e. roll right or two-pos switch for entering the menu. If you only want 2-pos switch then set it to 0b1000 = 8, there are other options which you can see in the docs.

For a switch to do anything it has to be assigned to you would need to set an RCx_OPTION to 79

Recording is controlled by setting an RCx_OPTION to 78

CAM_RC_FEATURES should be set at startup automatically - if its showing as 0 then the camera hasn’t booted properly or you have the UART connected wrongly. It’s possible that increasing CAM_RC_BT_DELAY may help if the camera takes an unusually long time to boot.

So I see a problem in the code for your device when exiting the menu and you are trying to record, but this shouldn’t affect starting and stopping the video if you never enter the OSD menu in the first place. Are you able to try that? Configure correctly, wait for the camera to boot and the features message and then see if you can start video from the switch.

I have to admit I’m getting more and more confused but I’m not giving up. :wink:

Am I correct to assume the following:

  • CAM_RC_CONTROL only configures methods to enter the menu, so if I don’t want to enter the menu (and instead just emulate pressing the 2 physical buttons), I could practically ignore it completely?
  • Likewise, RCx_OPTION = 79 only refers to the menu, so I don’t need it either?
  • RCx_OPTION = 78 is the one to assign a channel/switch on the transmitter to pressing the 2 physical start/stop and mode switch buttons?
  • CAM_RC_TYPE has the following options: “RunCam Split Micro/RunCam with UART” and “RunCam Split” - but without a UART, there is no cam control possible?

While menu navigation would be nice to have as a bonus, the by far most important thing to me and the thread op is simply a switch on the transmitter that starts and stops recording at high/low position. So recording could be started manually at launch, without opening the hatch again to press a tiny button on the RunCam Hybrid/Split. Sometimes it takes a few minutes from connecting the battery/closing the hatch to the actual launch, and the 4k video recorded during these minutes is just wasted sd card/disk space.