Problem connecting to APM 2.8 from mavlink lib

Hi all,

I’m trying to setup APM2.8 with companion computer RPi model A.

I made it work using the mavproxy. The additional parameter was needed to specify the old protocol:

mavproxy working.gif

Next step is I’m trying to run the mavlink example program https://github.com/mavlink/c_uart_interface_example. Unfortunately the example is not working. Looks like that the initial steps work, but the current position cannot be read and the program stuck:

example not working.gif

I tried couple of different things like building the example code from older commit with the older version of the mavlink c lib for 1.0. Also I tried to replace the

#include <common/mavlink.h>

with:

#include <ardupilotmega/mavlink.h>

Unfortunately non of this works.

The behavior is very similar to mavproxy without the --mav10 switch:

mavproxy not working.gif

My question is how to make the mavlink lib work against the APM? What is the equivalent of --mav10 in mavproxy against the c API? I would expect that just including ardupilotmega/mavlink.h should be enough, but seems not.

Thanks in advance,

Ivan Stoyanov