Home Forums General Discussion Waiting for heartbeat from /dev/ttyAMA0 msg when connecting rsp and pixhawk

This topic contains 29 replies, has 8 voices, and was last updated by Profile photo of Jacob Jacob 2 months ago.

This forum is closed for new responses.

Please visit this topic on our new forums here.

  • Author
    Posts
  • #6559
    Profile photo of Christian
    Christian
    Participant
    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,
    
    
    
    
  • #6561
    Profile photo of Jacob
    Jacob
    Participant

    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

  • #6569
    Profile photo of Christian
    Christian
    Participant

    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.

    Attachments:
  • #6572
    Profile photo of Jacob
    Jacob
    Participant

    Below is some information found on this page:http://elinux.org/RPi_Serial_Connection. 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

    • This reply was modified 1 year ago by Profile photo of Jacob Jacob.
  • #6577
    Profile photo of Christian
    Christian
    Participant

    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

  • #6579
    Profile photo of Christian
    Christian
    Participant

    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?

  • #6581
    Profile photo of Jacob
    Jacob
    Participant

    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

    • #6639
      Profile photo of Christian
      Christian
      Participant

      Perfect. Thanks Jacob!

  • #8013
    Profile photo of tarek
    tarek
    Participant

    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 ?

    • This reply was modified 9 months, 3 weeks ago by Profile photo of tarek tarek.
  • #8015
    Profile photo of Jacob
    Jacob
    Participant

    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

  • #8022
    Profile photo of tarek
    tarek
    Participant

    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

  • #8238

    Keyur Rakholiya
    Participant

    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.

  • #11591

    Marcelo Muniz
    Participant

    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

  • #11671
    Profile photo of Srikanth
    Srikanth
    Participant

    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

    Attachments:
  • #11674
    Profile photo of Rusty
    Rusty
    Keymaster

    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

    • #13414
      Profile photo of DS Wang
      DS Wang
      Participant

      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

  • #13417
    Profile photo of Jacob
    Jacob
    Participant

    Hi DS,

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

    -Jacob

    • #13439
      Profile photo of DS Wang
      DS Wang
      Participant

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

      whatever command I entered, it didn’t work.

      Attachments:
      • #13491
        Profile photo of Jacob
        Jacob
        Participant

        When mavproxy just shows ‘Mav>’ it has not yet connected to a vehicle. Check that you have correct port and baudrate.

    • #13443
      Profile photo of DS Wang
      DS Wang
      Participant

      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.

      Attachments:
      • #13492
        Profile photo of Jacob
        Jacob
        Participant

        The correct usage is ‘arm throttle’ to arm and ‘disarm’ to disarm. Also note that the MANUAL_CONTROL and RC_CHANNELS_OVERRIDE messages will be rejected by the autopilot if the sysid of the sender does not match the SYSID_MYGCS parameter.

    • #13447
      Profile photo of DS Wang
      DS Wang
      Participant

      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…

       

      Attachments:
      • #13494
        Profile photo of Jacob
        Jacob
        Participant

        Again, you are not actually connected to a vehicle.

    • #13449
      Profile photo of DS Wang
      DS Wang
      Participant

      I followed this page to connect my RPi and pixhawk.

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

      And I already had downloaded mavproxy before.

      Attachments:
    • #13451
      Profile photo of DS Wang
      DS Wang
      Participant

      This is another direction for my connection between RPi and pixhawk

      Thank you very much!!!!

       

      DS Wang

      Attachments:
  • #13495
    Profile photo of Jacob
    Jacob
    Participant

    You need to specify the right serial port and baud rate that the Pixhawk is connected to with the –master option. If you are using usb, the pixhawk will appear as /dev/ttyACM0 or /dev/ttyACM1 (you can do ls /dev/tty* to see which ports you have). If you are using the UART on the raspberry pi, like in your pictures, you should connect to /dev/ttyAMA0 if you are using a raspberry pi 2 or /dev/ttyS0 if you are using a raspberry pi3. If you want to use the UART, you will also have to disable the console. The baudrate is controlled by the SERIAL parameters on the pixhawk http://ardupilot.org/copter/docs/parameters.html#serial-parameters.

     

    -Jacob

    • This reply was modified 2 months, 1 week ago by Profile photo of Jacob Jacob.
    • #13596
      Profile photo of DS Wang
      DS Wang
      Participant

      I followed this page to connect.

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

      I want to use the UART, and I’m using RPi3 now

      So I connected it by /dev/ttyS0   (0 is zero)

      And the picture is the result after I connected

      It still didn’t connect, right?

      Attachments:
    • #13598
      Profile photo of DS Wang
      DS Wang
      Participant

      I used mission planner to connect pixhawk, and checked the parameters.

      I used telemetry2, so I checked the parameters of it.

      This picture is the parameters of telemetry.

      Is it right? Or I need to change something?

      Attachments:
      • #13612
        Profile photo of Jacob
        Jacob
        Participant

        Mavlink2 is the name of a new version of the mavlink protocol, it does not mean a second mavlink connection. Mavlink2 is not officially supported yet by mavproxy. Select Mavlink1 as the protocol for the port that you will use.

    • #13602
      Profile photo of DS Wang
      DS Wang
      Participant

      By the way, I’m not only connecting RPi and pixhawk by UART, but also by USB.

      Just like this picture.

      Do I need to disconnect the USB port?

      Or I need to change something?

      I really appreciate your help and effort!!!!!!

      Thank you!!!!!!

      Attachments:

The forum ‘General Discussion’ is closed to new topics and replies.