Mavproxy.py stuck on MAV

Hello,

I am trying to connect my APM 2.8 with my Raspberry Pi 3 using the mavproxy.py command line.

sudo -s
mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --aircraft MyCopter

But the terminal gets stuck on “MAV>”. After this “Waiting for heartbeat from /dev/ttyAMA0” should come but it doesn’t.
I thought the connections to the telemetry port of the APM were the fault because I had to solder a few wires together so I started from the very beginning.
I tried:

  • Connecting APM and my laptop directly through USB
  • Connecting APM with Pi directly thorugh USB (Port /dev/ttyACM0)
  • Using a TTL USB to UART TTL to connect APM and laptop
  • Using the same converter to connect APM and Pi.

and all these worked as expected.

But when I connect the APM with the GPIO UART pins of the Raspberry Pi, it just gets stuck on “MAV>”. If it showed garbage values then it would be a baudrate issue but it just shows nothing and reversing the UART pins also gives the same result, where it should just say cannot connect or something.

Kindly help me figure out what the problem is. I would really appreciate it.

Thanks

1 Like

It sounds like the /dev/ttyAMA0 is not configured properly.

Take a look at https://www.raspberrypi.org/documentation/configuration/uart.md, as you may need to disable the Bluetooth module to access that port.

1 Like

Thank you Stephen. Its works perfectly now. Thank you very much.

A bit off topic, can the APM 2.8 not be connected through 2 different ports at the same time?
I worked on a Pixhawk 2.1 before and used the Telem connection with a Raspberry Pi 3 (AMA0) for running the mavproxy.py script to show the status of the vehicle on my ground station and simultaneously used a USB connection (ACM0) to run a script on Pi which gave commands to the Pixhawk.

When I try to do the same with the APM, the Telem connections breaks, saying “no link, link 1 down” and reconnects as soon as I remove the USB.

Can I not use 2 connections with my APM or is there some work around for this?

Thank you.

I think the APM2 boards can only use one connection at a time. I vaguely recall those ports being shared between a single TELEM, as part of the hardware design.

Using the Pixhawk would be much easier :slight_smile:

Thank you very much Stephen. I have a Pixhawk 2.1 on order. I guess I’ll start this again once that arrives.

we have a similar problem, even I disable the bluetooth module it won’t access sad

root@raspberrypi:/home/pi# mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --aircraft MyCopter
Connect /dev/ttyAMA0 source_system=255
no script MyCopter/mavinit.scr
Log Directory: MyCopter/logs/2021-08-04/flight2
Telemetry log: MyCopter/logs/2021-08-04/flight2/flight.tlog
Waiting for heartbeat from /dev/ttyAMA0
MAV> link 1 down

Have you:

  • Checked the baud rate is correct?
  • Used the raspi-config software to a) enable the serial port and b) disable the login shell on serial
  • Tried using /dev/serial0 instead?

the baud rate that I’m using is 57600 I use the lowest one because it might work with my device to communicate each other.

ive done this method so many times i master it and still having errors.

ive tried this command but it work but it only show less it should be the information about my drone right it only show the flight mode that im having it was set to stabalize mode and it wont change it only stuck with stabalize mode.

Then you’ve got the correct command for MAVProxy.

What do you mean by " it only show less it should be the information about my drone"?

If it won’t change modes, that would be a flight controller configuration issue.

i mean it should be like this in the picture the output I’m looking forward to my device

but in the second picture my output is this whenever i type the command to execute

oh i see what should i do should i re-calibrate anything or is in the parameter list should i edit something to work properly.

can you check my param please what is my problem here so i would edit to be better hehe.
407parammm.param (18.1 KB)

It appears that MAVProxy is getting telemetry from the autopilot, but is unable to send commands - this can be seen by the lack of “received parameters” message (MAVProxy needs to ask the autopilot to send the parameter set).

Check the Pi’s UART TX line (which should go to the TELEM RX on the autopilot) - it might be disconnected.


got this output still not fixed even tho I follow the setup you said for the pi’s uart tx

this is also my baudrate setup.

and also my serial2


whenever i switch the connection and i got this do you think the firmware was the problem?
image

Your settings all look correct.

Not sure what the issue is. Most likely a cabling issue or a flight controller issue. Maybe try a different UART on the flight controller.

a guy from the Facebook community told me my problem was he said “the error says your port is out of range. Look at your port, it’s got an extra 0.” that what he said well where should I look into my ports I think he’s talking about the serial2_port I think but I already set mine to serial2 to bind the connection.

i also bought a USB to UART it might work some guy told me to do that method it might work.