Waiting for heartbeat from /dev/ttyAMA0 msg when connecting rsp and pixhawk

I am following the steps to connect pickhawk to raspberry pi 3
as described here:
http://dev.ardupilot.com/wiki/raspberry-pi-via-mavlink/

However, when I do 
pi@raspberrypi:~ $ sudo chown -R pi /home/pi
pi@raspberrypi:~ $ sudo su
mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --aircraft MyCopter
Connect /dev/ttyAMA0 source_system=255
no script MyCopter/mavinit.scr
Log Directory: MyCopter/logs/2016-03-20/flight2
Telemetry log: MyCopter/logs/2016-03-20/flight2/flight.tlog
Waiting for heartbeat from /dev/ttyAMA0

Sometimes I also get nothing, like this


sudo chown -R pi /home/pi
root@raspberrypi:/home/pi# sudo -s
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/2016-03-20/flight1
Telemetry log: MyCopter/logs/2016-03-20/flight1/flight.tlog
MAV> param show ARMING_CHECK

and it shows nothing, no status, nothing like in the example. 

Also should the aircraft be bluerov(I am using the bluerov frame)
Note I am using raspberrypi 3, but I think it shouldn't matter if its 2 or 3
I appreciate any advice. 

Thanks,



How are you connecting the pi and the pixhawk? Try doing ‘ls /dev/tty*’ before and after plugging the pixhawk in, and see if ttyAMA0 is there.
-Jacob

I am connecting it like in the diagram http://dev.ardupilot.com/wiki/raspberry-pi-via-mavlink/#connecting_to_rpi_with_an_sshtelnet_client

but without the red 5 volts since I am powering directly the pixhawk and rpi with independent 5V power source.

The pikhawk has a green blink twice light (I believe is RC not armed, that is another error I can’t figure out how to solve.) I am

Before connecting pikhawk to rpi :

ls /dev/tty*
/dev/tty /dev/tty15 /dev/tty22 /dev/tty3 /dev/tty37 /dev/tty44 /dev/tty51 /dev/tty59 /dev/tty9
/dev/tty0 /dev/tty16 /dev/tty23 /dev/tty30 /dev/tty38 /dev/tty45 /dev/tty52 /dev/tty6 /dev/ttyAMA0
/dev/tty1 /dev/tty17 /dev/tty24 /dev/tty31 /dev/tty39 /dev/tty46 /dev/tty53 /dev/tty60 /dev/ttyprintk
/dev/tty10 /dev/tty18 /dev/tty25 /dev/tty32 /dev/tty4 /dev/tty47 /dev/tty54 /dev/tty61 /dev/ttyS0
/dev/tty11 /dev/tty19 /dev/tty26 /dev/tty33 /dev/tty40 /dev/tty48 /dev/tty55 /dev/tty62
/dev/tty12 /dev/tty2 /dev/tty27 /dev/tty34 /dev/tty41 /dev/tty49 /dev/tty56 /dev/tty63
/dev/tty13 /dev/tty20 /dev/tty28 /dev/tty35 /dev/tty42 /dev/tty5 /dev/tty57 /dev/tty7
/dev/tty14 /dev/tty21 /dev/tty29 /dev/tty36 /dev/tty43 /dev/tty50 /dev/tty58 /dev/tty8

after connecting pikhawk to rpi: there is no difference

ls /dev/tty*
/dev/tty /dev/tty15 /dev/tty22 /dev/tty3 /dev/tty37 /dev/tty44 /dev/tty51 /dev/tty59 /dev/tty9
/dev/tty0 /dev/tty16 /dev/tty23 /dev/tty30 /dev/tty38 /dev/tty45 /dev/tty52 /dev/tty6 /dev/ttyAMA0
/dev/tty1 /dev/tty17 /dev/tty24 /dev/tty31 /dev/tty39 /dev/tty46 /dev/tty53 /dev/tty60 /dev/ttyprintk
/dev/tty10 /dev/tty18 /dev/tty25 /dev/tty32 /dev/tty4 /dev/tty47 /dev/tty54 /dev/tty61 /dev/ttyS0
/dev/tty11 /dev/tty19 /dev/tty26 /dev/tty33 /dev/tty40 /dev/tty48 /dev/tty55 /dev/tty62
/dev/tty12 /dev/tty2 /dev/tty27 /dev/tty34 /dev/tty41 /dev/tty49 /dev/tty56 /dev/tty63
/dev/tty13 /dev/tty20 /dev/tty28 /dev/tty35 /dev/tty42 /dev/tty5 /dev/tty57 /dev/tty7
/dev/tty14 /dev/tty21 /dev/tty29 /dev/tty36 /dev/tty43 /dev/tty50 /dev/tty58 /dev/tty8

 

Any help is appreciated.


Below is some information found on this page:RPi Serial Connection - eLinux.org. I think this is your issue.

The Broadcom UART appears as /dev/ttyAMA0 under Linux. There are several minor things in the way if you want to have dedicated control of the serial port on a Raspberry Pi.

UPDATE: The raspberry pi 3 has changed things around a bit: ttyAMA0 now refers to the serial port that is connected to the bluetooth. The old serial port is now called ttyS0. So if you have an RPI3, everywhere you see “ttyAMA0” below, you should read “ttyS0”.

Also, find the parameter for arming checks and disable.

-Jacob

I found the issue for my problem. Here it is for others who have similar issue. As I mentioned I am using rpi3. They change somethings to whenever you used “ttyAMA0” in rp2, you should read “ttyS0” in rpi3. I used the rpi2 and worked. However, now I have the following issue:

When I run command: mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --aircraft MyCopter

I get APM: PreArm: RC not calibrated
Connect /dev/ttyAMA0 source_system=255
no script MyCopter/mavinit.scr
Log Directory: MyCopter/logs/2016-03-21/flight1
Telemetry log: MyCopter/logs/2016-03-21/flight1/flight.tlog
MAV> Waiting for heartbeat from /dev/ttyAMA0
Qonline system 1
STABILIZE> Mode STABILIZE
fence breach
GPS lock at 0 meters
APM: ArduSub V3.4-dev (b1cada53)
APM: PX4: 62d935eb NuttX: d48fa307
APM: Frame: ROV_BLUEROV_FRAME
APM: PX4v2 00400034 33345118 32353634
APM: PreArm: RC not calibrated
Received 546 parameters
Saved 546 parameters to MyCopter/logs/2016-03-21/flight1/mav.parm
APM: PreArm: RC not calibrated
APM: PreArm: RC not calibrated

and can’t pass this. How do I calibrate that? In QGroundController I calibrated the joystick, etc, but couldn’t find anything that worked to calibrate RC. I am a newbie in autopilot so I am not sure what it means. I don’t think I am using any RC controller. Want to connect QGroundController via ethernet via rpi to pikhawk.

Also, other question, how does QGroundController (on my mac) connect to pikhawk via ehternet via rp2?

I appreciate any help. Thanks

Tanks Jacob, that was also the solution I found. that is great. you used “ttyAMA0” in rp2, you should read “ttyS0” in rpi3.

I also found the answer how to conncet to Qgroundcontroller, using -out flag:

mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --out yourComputerIP:14550 --aircraft MyCopter

The only thing left over is the “APM: PreArm: RC not calibrated”, Is there a way to get that warning out? Does it matter?

I’m pretty sure you can ignore that if you are using a joystick to control it. In order to arm anyways, disable the arming checks.
-Jacob

Perfect. Thanks Jacob!

Hello, i use Apm and Raspberry pi2 connection (serial with logic converter) ; i have the same problem

root@raspberrypi:/home/pi# mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --aircraft MyCopter
Using MAVLink 1.0
Using MAVLink 1.0
Connect /dev/ttyAMA0 source_system=255
Failed to load module: No module named adsb. Use ‘set moddebug 3’ in the MAVProxy console to enable traceback
no script MyCopter/mavinit.scr
Log Directory: MyCopter/logs/2016-05-30/flight21
Telemetry log: MyCopter/logs/2016-05-30/flight21/flight.tlog
Waiting for heartbeat from /dev/ttyAMA0
MAV>

MAV> param show ARMING_CHECK and it shows nothing, no status, nothing like in the example.

ls /dev/tty*
/dev/tty /dev/tty19 /dev/tty3 /dev/tty40 /dev/tty51 /dev/tty62
/dev/tty0 /dev/tty2 /dev/tty30 /dev/tty41 /dev/tty52 /dev/tty63
/dev/tty1 /dev/tty20 /dev/tty31 /dev/tty42 /dev/tty53 /dev/tty7
/dev/tty10 /dev/tty21 /dev/tty32 /dev/tty43 /dev/tty54 /dev/tty8
/dev/tty11 /dev/tty22 /dev/tty33 /dev/tty44 /dev/tty55 /dev/tty9
/dev/tty12 /dev/tty23 /dev/tty34 /dev/tty45 /dev/tty56 /dev/ttyAMA0
/dev/tty13 /dev/tty24 /dev/tty35 /dev/tty46 /dev/tty57 /dev/ttyprintk

in advance option of Rasp , at serial <Would you like a login shell to be accessible over serial? >> i do “Yes”, serial is enable, if "no"disable i will not have the “/dev/ttyAMA0”

there is some parameteres to change in Mission planner or in APM to work? please ,i need help , who can help me ?

  1. Make sure you have rx/tx connected correctly to raspberry pi.
  2. Are you connected to USB or Telem Port on Pixhawk? You may need to change some parameters
    If you are connected to USB, Make sure that SERIAL0_PROTOCOL = GCS Mavlink and SERIAL0_BAUD = 57600
    If you are connected to Telem1, do this with SERIAL1

-Jacob

think you Jacob , I use APM2.6 , i want use temetry port , but i dont find SERIAL1_PROTOCOL in Mission planner ! only SERIAL1_BAUD=57 , i dont know why

which virsion of firmware are you using? i suggest you to use 3.2.1 its working fine with apm 2.6 and mav link proxy.

Hey Christian!

Can you please describe or upload a photo of your power setup on RPI?
I saw your photo above, and it seems that you’re using a power source different than the 5 VCC input directly from Pi, but the angle in which it was taken is not helping any further in this detail I’m looking for.

Thank you in advance,

Marcelo

All,

I too am having the same issue. I am trying to connect the Pixhawk to a Rpi and I do not get any response, after trying to follow the instructions from

http://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html

I have tried RPi3 and after reading Christian’s post, I switched back to RPi2. I am still having the same problem.

I have checked the setting in Pixhawk, and the baud rate on telem port 2 is set at 57600. I would truly appreciate your help!

Thanks!

Srik


Hi Srikanth,

We usually connect the Pixhawk to the Raspberry Pi via USB so that it shows up at /dev/ttyACM0. We connect to that at 115200 and it works great and reliably. I would recommend trying that.

Please see our Raspberry Pi setup instructions and disk image, which has everything set up and ready to use: http://ardusub.com/raspi-setup/#easy-setup-with-disk-image

-Rusty

Hello! Rusty!

I’m DS wang! Nice to meet you!

I’m researching in how to integrate pixhawk and RPi ,too

and I also can’t connect each other by /dev/ttyAMA0.

So I followed your advice to replace /dev/ttyAMA0 from /dev/ttyACM0 last week.

It’s successful that RPi can receive the information of pixhawk just like arming or disarming.

But if I wanted to control pixhawk by RPi, whatever command I entered, it didn’t work!

No state,no operating, no response…

Do you know how to resolve this problem…?

Thank you very much!!

 

DS Wang

Hi DS,

Can you give an example of the commands that you are entering? Are you using mavproxy on the Pi?

-Jacob

This picture is the first situation that is connected by /dev/ttyAMA0 57600

whatever command I entered, it didn’t work.


This is the second situation that is connected by /dev/ttyACM0 115200

If I entered the command ‘mode’ or ‘arm’, it will show some usages.

If I armed motors by remote control, it will show some information just like arming or disarming.

But…whatever command I entered, the RPi still didn’t control motors.


This is the third situation that is connected by /dev/serial0 57600

I saw this way in a video on youtube before

But it’s like the first situation, whatever command I entered, it didn’t work…

Â