Controlling Pixhawk 6c with Raspberry Pi 4B

Hi!
I’m using MAVSDK C++ to control Pixhawk 5 via telem2 from RPi 4B.

I get serial connection like this example.

ConnectionResult connection_result = mavsdk.add_any_connection(argv[1]);
In my connection argv[1] = std::string “serial:///dev/serial0:921600”

If port is fine but no autopilot you get message “No autopilot found.\n”. If port close or bad you get error and crush app, else “Discovered autopilot\n”.

Some users have problem " Connection only works after opening QGC", maybe you have it too? soo solution here.

I’ll be happy if I helped you.