RunCam serial driver - alpha testers wanted

So, can it be controlled directly by the PWM width from the radio? Only to connect it to the servo output, set RCPassThru, set the 3-pos. switch and it should work, am I right?

I think it just wants GPIO. So attach the pin to a motor output, select that motor function as GPIO and then select a RELAYx_PIN to point to that pin (look in hwdef for the GPIO pin number). You can then use the RELAY RC option to switch it. Thatā€™s the basic approach, but you will need to do some digging to see whether you can get it to work ā€¦

OK, thank you very much, I got it. I set a switch on radio ch.7, then I set RC7_OPTION=34 (relay2 on/off), the camera remote control pin was connected to SERVO13 (function set to -1) and RELAY_PIN2=62 (S13 for H743). It is possible by the switch (0.3-1s pulses) to take pictures or turn on/off the video, but I did not succeed to flip between photo and video mode.

I just found this protocol for the remote control of Runcam 2 4K camera:
One 85 ms pulse switches the camera from Video recording mode to Photo mode.
Two 85 ms pulses with a gap of 85ms start / stop a video recording or take a picture in photo mode.
So, I guess such protocol is currently not available in AP. The only option is to do it with a separate microcontroller or with a discrete scheme. I checked the protocol by a signal generator and it seems it is working like described.
There is a cable for such function produced by Runcam, but currently it is not available anywhere.

I tried to setup this relay switch on a different servo output (S12), and it did not work. Finally I found out (by a uC switcher connected between S7, PWM and camera input), that this camera needs an inverted signal and an open collector (normally 3.3V from turned-on camera and 0V for triggering, 0.3-1s set in the radio. So, in my previous input described protocol from somebody, with normally 0V has a mistake. It needs to be inverted.
I still donā€™t understand, how it can work on the LED output S13 and what is different there, because the signals were exactly the same.
But in any case the camera needs for driving only an open collector, because normally there is 3.3V on the remote control pin. So for the right functioning (take pictures or turn on/off video) it is in AP enough to setup the relay output and add one Mosfet between pin S and camera input.
Runcam still did not reply on my e-mail question about this signal protocol, so ā€œhelp yourself as you canā€.

Runcam answered, but a bit odd. They sent me a video, where someone is shorting the wires at Runcam5. If am I right and the remote cable is there shorted to minus pole, then the function is in opposite with my findings: One pulse should take pictures or turn on/off the video and two pulses should switch between photo and video mode.
I created a simple lua scripts in AP for each switch position on the radio and finally it works somehow.

Hi Giorgo
I am very interested in your procedure. I just bough a RunCam2, waiting for it, may you share your Lua script, and give me more details in order to reproduce it?

Thank you in advance

juan pablo

Would love to see you LUA script as I want to control Runcam 2 4K in the same way. Are you using a Mosfet on the relay pin?

Hi @andyp1per ,

I am trying to force HAL_RUNCAM_ENABLED to get this feature into an Omnibus F4 Nano V6. Can you point me to which file I need to change. I cannot use the custom compiler as I also need to do some resource remapping.

Is it reasonable to just remove the condition here:

#ifndef HAL_RUNCAM_ENABLED
#define HAL_RUNCAM_ENABLED 1
#endif

and just have:

#define HAL_RUNCAM_ENABLED 1

1 Like

Just do it in the hwdef

define HAL_RUNCAM_ENABLED 1

1 Like

Oh i can do that in hwdef? Great.

I suppose I could also add: AP_AIRSPEED_MS4525_ENABLED= 1
(also need to get airspeed drivers enabled).

Should I not see a change in flash size after adding runcam and airspeed 4525 drivers to the hwdef.dat file? I did and it compiled but there has been no change in flash size.

I actually donā€™t know why its not already included - is your hwdef including something in include that defines this to be 0?

1 Like

According to the wiki this feature is supposedly not in boards with a minimal feature set. The hwdef.dat file sets features to minimal for this board. And runcam control is only in 2mb targets. Its all good. It flashed so I will see what happens and ask up the food chain if I have issues.

It would be great if Ardupilot had a cloud builder that allowed you to compile stable branches and also allowed you submit your own hwdef.dat file. I wish we could crowd fund this. I notice that Betaflight now has a cloud builder with a feature picker and you have always been able to allocate resources via CLI.