RunCam serial driver - alpha testers wanted

I did. I will look again. No such thing is reported.

I changed hwdef to make pwm5 and RSSI pads uart4 on serial1. It compiled and flashed ok. I think I need to first test my new UART to see if it works properly.

Curiously I could not use pwm6 as uart4_tx.

If nothing is reported then that implies that the uart cannot be found or opened at all. There is a debug flag at the top of AP_RunCam.cpp that you can set to 1 to get extra output if you recompile.

Ok. I will look at that after I test the newly created UART. I will test that I can connect to a GCS through it.

One thought - make sure that HAL_MINIMIZE_FEATURES is not set to 1 for your FC - I can’t tell based on the information you have given, but it’s possible. If that is the case then define HAL_RUNCAM_ENABLED 1 in hwdef.dat

Oh, thanks. I will look at those now.

However, I have tested my newly created serial port and it is not working for sure. I have created defined UART4 as RSS and PWM5 on the OmnibusF4 Pro by editing the hwdef file. So I have a UART problem.

I described my issue here:

Not sure if you have any insights. Sorry it is taking longer than i would like to get this tested.

I think I have got the help I need to understand uart order properly now (on the RCGroups thread).

So the ordering I understand, but the pins are dictated by the physical hardware - not sure I understand how those can be re-assigned - maybe it’s just that the hwdef.dat is wrong. The best way to figure out the correct pin assignments is to look at the betaflight code. I have a omnibus 4 pro so can have a play if you can’t get this to work.

After Henry W explained that the hwdef file had an expected default uart order then I had the missing link of knowledge. Now i have a working and tested extra UART on my OmnibusF4 Pro.

Where do I find HAL_MINIMIZE_FEATURES and HAL_RUNCAM_ENABLED. Still no Runcam mavlink message on MP even though I have a tested serial2 at 115 and protocol 26. I suspect the feature was not included in my compile.

I am getting there – so much to learn before I could test this, sorry.

I was interesting that my Caddx Turtle v2 had flashing serial leds with mavlink 2 at 115. But registers nothing when serial2 was set to protocol 26.

The f4 pro does not have HAL_MINIMIZE_FEATURES enabled so you should be good there. I suggest switching on the debug flag and seeing what output you get. If HAL_MINIMIZE_FEATURES is not set then HAL_RUNCAM_ENABLED will be enabled by default so you should be good.

Where is the debug flag set?

At the top of AP_RunCam.cpp you will see:

#define RUNCAM_DEBUG 0

change that to 1

According to BF there is also a uart3 with these pins:

#define USE_UART3
#define UART3_RX_PIN PB11
#define UART3_TX_PIN PB10

we should fix the hwdef.dat to reflect this. Some pro’s also have uart4

I do not see AP_Runcam.cpp in Master anywhere. I assume it would be in the library folder.

Can you send me a github url?

Indeed. We will need an extra uart available for this.

:slight_smile: it’s not in master, you need to use my PR:

and the file is in libraries/AP_Camera

Ouch. Should have been paying attention! Ok, will compile from your fork tonight!

1 Like

You are sensibly anticipating the git noob questions before they are even asked. I just git cloned your fork and set up a new eclipse project. Inefficient I know…but it is compiling.

I have cloned your runcam branch in Eclipse, compiled, flashed, and am now getting Runcam initialized in my Mavlink messages from my Nano Talon. This would have taken a more practiced Git/Eclipse/Ardupilot person 20 minutes. Me not so much.

Anyhow will test tomorrow or Saturday when I get a chance.

1 Like

@andyp1per I have assigned channel 10 (RC10) to function 78 and channel 9 (RC9) to function 79. The switches do nothing mind you. I cannot enter the menu either. But when i do enter the menu it seems that the FC is out putting endlessly a left button selection, so it makes the control pad useless until I disconnect the Caddx serial port. So it is receiving serial commands.

I am puzzled by the mechanism whereby we are using the RC Yaw or Roll. This will not work when in flight will it? What am I missing there?

So to summarize I am getting the mavlink message affirming the that Runcam is present. Some sort of serial communication is happening but it is only a recursive left toggle of the 5 position switch which I have to disconnect the serial port to stop. Two RC channels assigned to a switch and RC function 78 and 79 seem to have no effect on this behavior.

Should we expect something like we see in the video here?

It is a start! I have a spare runcam split 2S. Sitting in a box! Send me your address and I will send it to you if you like. My donation to the cause of getting this working in Ardupilot.