# My method to connect RPi3 with Pixhawk

**URL:** <https://discuss.bluerobotics.com/t/my-method-to-connect-rpi3-with-pixhawk/879>\
**Category:** BlueROV2\
**Created:** [March 28, 2017, 4:17pm UTC](https://discuss.bluerobotics.com/t/my-method-to-connect-rpi3-with-pixhawk/879 "2017-03-28T16:17:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dswang](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dswang](https://discuss.bluerobotics.com/u/dswang)\
**Post date:** [March 28, 2017, 4:17pm UTC](https://discuss.bluerobotics.com/t/my-method-to-connect-rpi3-with-pixhawk/879/1 "2017-03-28T16:17:32Z")

</div>

Hello every friends!  
I success to connect RPi3 with Pixhawk !  
And I think I need to share my method to you.  
If somewhere is wrong, please tell me, thank you!

## By the way, I’m Taiwanese. So if my grammar has any mistakes, please forgive me. I am still practicing it now.

Step one  
I followed this page

> **[Communicating with Raspberry Pi via MAVLink — Dev documentation](https://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html)**

Connect RPI3 with Pixhawk by this picture.

 ![](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/d/d2ac138a9b82fe94e5d45d3b4ccd4eb2ea1aa6e7.JPG)  
 ![](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/c/cee410ac9adb10a658468f52c11bdbf8b7f2de64.jpg)

---

<div class="post-metadata">

**Author:** ![dswang](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dswang](https://discuss.bluerobotics.com/u/dswang)\
**Post date:** [March 28, 2017, 4:25pm UTC](https://discuss.bluerobotics.com/t/my-method-to-connect-rpi3-with-pixhawk/879/2 "2017-03-28T16:25:35Z")

</div>

Step two

## Download the image file from this page I chose the NOOBS (not the NOOBS LITE) [https://www.raspberrypi.org/downloads/](https://www.raspberrypi.org/downloads/)

And set the parameters in pixhawk like the picture.

 ![](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/b/b931bbd32226fb3ced1c55132063dc3e69d27e71.JPG)

SERIAL2\_PROTOCOL = 1  
SERIAL2\_BAUD = 921  
LOG\_BACKEND\_TYPE = 3

But if I set “SERIAL2\_BAUD = 921”, it’s will fail.  
So I changed it to “SERIAL2\_BAUD = 57”, and then it’s successful.

---

<div class="post-metadata">

**Author:** ![dswang](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dswang](https://discuss.bluerobotics.com/u/dswang)\
**Post date:** [March 28, 2017, 4:39pm UTC](https://discuss.bluerobotics.com/t/my-method-to-connect-rpi3-with-pixhawk/879/3 "2017-03-28T16:39:17Z")

</div>

Step three

Connect the WIFI, and confirm that it’s can surf the internet.  
Download these packages.

 ![](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/5/5cfdfb1f2a94b8a92f833857f6cf28c67d0ae89c.JPG)

By the way, if you have mistakes in the period of downloading “pymavlink”.  
Maybe you can try to download the package “future” first. (sudo pip install future)  
And then try to download “pymavlink” again, maybe it will work.

when you finish the packages, please update again (sudo apt-get update)

* * *

Use the command “sudo raspi-config”  
And set the serial is enable.

 ![](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/8/86f59af5540fa1033daa79de4d11b1f153a81f16.JPG)

---

<div class="post-metadata">

**Author:** ![dswang](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dswang](https://discuss.bluerobotics.com/u/dswang)\
**Post date:** [March 28, 2017, 4:58pm UTC](https://discuss.bluerobotics.com/t/my-method-to-connect-rpi3-with-pixhawk/879/4 "2017-03-28T16:58:30Z")

</div>

Step four

Just like this picture

 ![](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/8/85bfbbc7dd2f09a43aa5334a8bde01525111e962.JPG)

Use the command “sudo -s”  
It will show “root@raspberrypi:/home/pi#”

and then use the command “mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --aircraft MyCopter”  
It will show some information , but it will stop at the row of red line, just like  
MAV\>  
And use the command “sudo screen -r mavproxy”  
It will show "MAV\> " again.  
Press “Ctrl+C”, back to “root@raspberrypi:/home/pi#”

Use the command “mavproxy.py --master=/dev/ttyS0 --baudrate 57600 --aircraft MyCopter”  
And it will connect each other successfully !

* * *

The only different way from before is using the command “sudo screen -r mavproxy”  
I used this method on two pixhawks and two RPIs, both of their connection are successful…  
But…I don’t know why…I’m so confused…

If anyone know the reason, please discuss with me, thank you!

* * *

Wish every friends can solve this problem successfully !  
Cheers!

DS Wang
