Then I connected Pixhawk to computer via micro USB cable. I connected via telemetry modules to write the following parameters:
On Mission Planner / Config / Full Parameter Tree:
[SERIAL2_PROTOCOL] = 2 (the default) to enable MAVLink 2 on the serial port.
[SERIAL2_BAUD] = 921 so the flight controller can communicate with the RPi at 921600 baud.
I SSHed into RPi and enabled UART port in RPi:
sudo raspi-config
Interface options change
Run the following commands in RPi terminal to set up MAVProxy:
sudo apt-get install python-pip.
sudo apt-get install libxml2-dev.
sudo apt-get install libxslt-dev.
pip install dronekit.
pip install dronekit-sitl.
pip install MAVProxy.
PATH=sPATH:/home/pi/.local/bin
Enter the command to establish communication:
mavproxy.py --master=/dev/serial0 --baudrate 921600 --aircraft MyCopter
This is the output. Connect /dev/serial0 source_system=255 Failed to load module: No module named terrain. Use âset moddebug 3â in the MAVProxy console to enable traceback no script MyCopter/mavinit.scr Log Directory: MyCopter/logs/2021-03-10/flight2 Telemetry log: MyCopter/logs/2021-03-10/flight2/flight.tlog Waiting for heartbeat from /dev/serial0 MAV> link 1 down
I am stuck on this step. Any help would be appreciated. Thank you.
The steps youâve outlined may work, but it appears they diverge a bit in places (either different routes to achieve the same means, or missing some steps (like disabling bluetooth)).
I would check out this video starting at around minute 10.
This is a freemium video I posted to youtube, but contains all the steps required to establish a connection between RPI and Pixhawk.
I even tried exchanging the blue and white wire spots but I still get the annoying âlink 1 downâ message on RPi terminal. Iâm not sure whatâs going wrong.
New versions of software introducing issues?
What version of ArduCopter are you using?
What version of MAVProxy and pymavlink are you using?
You can check the latter by typing
sudo pip freeze | grep -i mav
May be worth it to try downgrading to older versions, say ArduCopter 4.0.3 and MAVproxy 1.8.16 or 17
Did you deactivate bluetooth in /boot/config.txt?
Did you enable serial over the hardware port via rasp-config (outlined as a step in the video, if you likely did if you followed the steps).
Can you connect the drone to your computer via telemetry? If not, this could be a firmware issue with ArduPilot and not a GroundControlStation problem with MAVProxy.
Is the Pixhawk receiving power when the drone is powered on? (flashing lights on pixhawk)
Can you confirm the presence of /dev/ttyAMA0 by typing âls /dev | grep ttyAMA0â? Wondering if the device is present or under a different name.
Specify different baud rates, try 57600 and 115200. Could be that the chosen baud rate of 921600 is wonât work.
Hard to say what the issue is with so many variables, but my bet is on either 1 or 2 or 7. I think I have experienced issues in the past where newer versions and incorrect baud rate corrupted connectivity.
Hey guys, after 3 days of desperate results I finally got it working!
Caleb, I formatted the SD cards and followed your steps from the YouTube video in detail (meaning same software versions you used: 4.0.5 Ardupilot firmware, 2020 RPi OS Lite version).
Jack, thank you for pointing out the baudrate. I think this was the issue. I tried multiple buadrates starting from 1200 and unexpectedly it worked with 921600 this time.
This was a critical step in my project so thank you again for your directions.
HiâŚthe flight regulator will react to MAVLink orders got through Telemetry 1 and Telemetry 2 ports (see picture at top of this page) implying that both the RPi and the normal ground station (for example Mission organizer, and so forth) can be associated. Likewise it is feasible to associate the Mission Planner to the MAVProxy application running on the RPi like how it is accomplished for SITL.