Connecting Raspberry Pi to Pixhawk

Hi everyone,

I’m going to be straight, I am thankful to have scored an excellent internship that will open many doors for me in the future. I am a computer engineer major going into my senior year this fall. Though I lack a lot of experience/knowledge in the engineering world.

Now for the project I am working on. I am building a UAV Hexacoptor for research that’s going to be taking in data from multiple areas. I have no experience working with any of this but eager to learn. I just need a little guidance as my mentor has little knowledge on this as well.

I am following this guide:
http://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html

Trying to connect the Pi3 and the Pixhawk but I am not getting any communication between the two. From terminal, I don’t get any data streaming in and all my log files are empty. I am not sure if there are any initial setup prior to both Pi and Pixhawk. I was provided this link and just went straight to connecting and hope that it worked.

Could someone guide me through this process? I have downloaded Mission Planner. Did the minor initial setup of the pixhawk(Firmware, Accelerometer, Radio, etc.). Not sure what else might be required.

Hi, pi3 has changed the uart access a bit because of the onboard bluetooth. In short, you need to disable the onboard bluetooth and reassign the exposed uart gpio back to the PL011 which has better timing at different clockspeeds. It’s then accessed as before on /dev/ttyAMA0.

Add this to /boot/config.txt:

enable_uart=1
dtoverlay=pi3-disable-bt
1 Like

Hey fnoop,

I included the respective line in /boot/config.txt but no luck. I still cannot connect Rpi to flight controller. Any suggestions.

I tried with /dev/ttyAMA0 and /dev/ttyS0. And the outputs on console are as following.

pi@apsync:~ $ sudo -s
root@apsync:/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/2018-04-23/flight7
Telemetry log: MyCopter/logs/2018-04-23/flight7/flight.tlog
MAV> Waiting for heartbeat from /dev/ttyAMA0
PXP@@~@(@P@$@@@P@@@H@@@@@@4@@@@ $@P@@@(@@P@@@6@ @p4@@@PP@@@D@@@"@@ @@@@@@0 @@ 6@@l P@@@@@"@@@@HP@@@4@@@@"@@@@@@ @ @B@@@@@@P$@@@@"@@@@@@@6@@ (@@@@@ `P@@@@>H@

root@apsync:/home/pi# mavproxy.py --master=/dev/ttyS0 --baudrate 57600 --aircraft MyCopter
Connect /dev/ttyS0 source_system=255
Failed to connect to /dev/ttyS0 : Could not configure port: (5, ‘Input/output error’)

Please help! Thanks in advance

At least your Pixhawk is talking to you, though at the wrong speed. Mine is completely silent :sweat_smile:

Work with Raspberry PI 3+, Pixhawk4, baudrate 921600.