Hello,
I’m trying to connect an onboard computer(Raspberry Pi 4B) via GPIO to use MavSDK to control a Pixhawk 6c via telem 2. I can’t get a response from the Pixhawk.
The problem appears to be with the configuration on the Pi side. I say this because I also have the Holybro Vision drone. If I plug the connector from telem2 from that drone into telem2 on the new Pixhawk 6c. When I do “minicom -D /dev/ttyUSB0”. text starts to scroll across the screen. Doing the same thing when the Raspberry Pi is connecting then “minicom -D /dev/ttyAMA0” and nothing scrolls on the screen.
I’ve gone through “sudo raspi-config” → interface options → Serial Port → No → Yes
If I connect the GPIO pins together directly and do 'minicom -D /dev/ttyAMA0". the characters I type appear on the screen. So that leads me to believe the pins are ok and working.
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”.
Perhaps a little late now but I just wanted to check that you connected TX to RX and RX to TX between the RPi and Pixhawk? Looks like you’ve also connected up a common ground which is good.
I’d also look into baud rates on both the RPi and Pixhawk, just make sure they are the same else you won’t see and data being transmitted.
Final thing is to reiterate @Artem_Borisov’s point. On an earlier release of MAVSDK, you’d need to send a message to the Pixhawk before it would transmit data. Under the hood, launching QGC first does this step. Look at this thread for more details.