RPI with MAVlink

Hi all, I am trying to configure my RPI 4 with my APM 2.8 via MAVLINK. However I am unable to connect RPI 4 and APM2.8 (telemetry port).
I keep getting the message MAV> Link 1 Down whenever I type in:
$ mavproxy.py --master=/dev/ttyS0

Here are the things I have done:

  • disabled bluebooth of my RPI 4.
  • I have check my connection via telemetry port.

Kindly help me figure out what the problem is. I would really appreciate it. I have been stuck for very long and I need help.

Thanks

Try /dev/ttyAMA0

And set your telemetry port on the FC at 921600

Corrado

I’ve also tried that, but however it is just waiting for heartbeat at Mav> , with no response.
FC have set at 921000 as well. - same response for both ttyAMA0 and ttyS0

Check tx rx connections. FC tx goes in RPI rx and FC rx in RPI tx.
Also check you have correct mavlink protocol set for the serial you are using.

mavproxy.py --master=/dev/ttyAMA0,921600

Just tried with both ttyS0 and ttyAMA0,921600… and same results. I have checked the connection as well.

Did you specify baudrate when launching pavproxy?

How did you remove bluetooth?

Did you enable serial with raspi-config?

Corrado

What do you mean by that specify baudrate when launching mavproxy?

Just turn off bluetooth on rpi?

I have enabled serial with raspi-config as followed instructions on https://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html

Need to go in /boot/config.txt

add the following line to disable bluetooth

dtoverlay=pi3-disable-bt

reboot raspberry and start mavproxy with the following line

mavproxy.py --master=/dev/ttyAMA0,921600

Done. But however now, I get this for ttyS0:
pi@raspberrypi:~ $ mavproxy.py --master=/dev/ttyS0 --baudrate 921600
Connect /dev/ttyS0 source_system=255
Failed to connect to /dev/ttyS0 : Could not configure port: (5, ‘Input/output error’)

and for ttyAMA0: I get Mav> Link 1 Down

Well i think we went over everything, you are probably overlooking something, recheck everything from the beginning.
Check you are using the correct pins on the raspberry.
Corrado

Alright… What did you mean by specifcy baudrate for when launching mavproxy?

Do not use mavproxy with higher baudrates than 115200. It may result in connection problems sometimes.
Also try to use /dev/serial0. The RPi should route the UART connected to the UART pins to that device.