Pixhawk Orange Cube using a payload system with Arduino Mega

Hello All,
I have been working with the cube orange and an Arduino Mega. I have been trying to figure out how to connected these two devices on Mavlink to get the Heartbeat of the Pixhawk on the Arduino Mega IDE so I can ensure that the connection of them is working to proceed. I was able to get the Arduino Mega MAVLink library downloaded on my Arduino IDE and was able to get the heartbeat message to display on its serial monitor. Following this, I managed to get the Arduino Mega to connect to Mission Planner and verified its communication of its heartbeat on MAVLink Inspector. As for the Pixhawk Orange cube I was able to get its heartbeat on a different IDE of that being VSCODE of downloading the XML files. Finally I used MavProxy to make sure the connections of them are working, which they are separately. The main goal of this is to have the pixhawk orange cube to send a Mavlink Message which then would let the arduino use a “winch” command to have it drop a water bottle. The main issue is getting the linkage of pixhawk to Arduino, I don’t receive any btyes when I run my code and yes I have set the parameters within Mission Planner of going to full parameter list, serial2 and changing the BAUD at 57600 and Protocol to Mavlink 1, Options is set to 0 (default). I would appreciate if anyone would assist me in solving this ongoing issue that I have been working on for well over a week now.
Thank you.

Library of Mavlink to Arduino: MAVLink - Arduino Reference
Latest Version: 2.0.4
Documentation Added:





Hello @Mxtt welcome to the community,

You do not post any .bin log file and no .param file and no arduino code, and you even do not explain which ArduCopter FW version you are using. How are we supposed to guess all that?

Hi @Mxtt,

So I guess you’re not seeing any data coming out of the Cube autopilot connected to the Arduino.

Copter at least does not send data by default on serial ports. It waits for the other side to request messages. You can overcome this though by setting the SRx_xxx parameters to 1 (hz) or higher.

I guess you’ve probably already seen our developer focused MAVLink wiki page? In particular this section on Requesting Data From The Autopilot might have what you need.

By the way, I’d recommend using MAVLink2 instead of MAVLink1. E.g. SERIALx_PROTOCOL = 2.

Hope that helps.

sorry about that, I just edited the main post including the information, as for a .bin log file, I’m not quite sure what that is. From all the research I have looked into it should be very simple of to connected these two via Mavlink, I’m completely lost on the issue of no heartbeat being set to the code with the Arduino from it transferring from Tx and Rx to my Arduino Mega (pins 18 and 19).

I just edit the new post with the new code and settings of what I have changed from it, I use MAVLink 1 since from my understanding the Arduino IDE library is using 1, I believe, I tried setting it to MAVLink 2 as well. With the code I provided I do have “MAVLINK_MSG_ID_HEARTBEAT” of its data stream request… I have done numerous troubleshooting of understanding why the Pixhawk is not sending messages to the Arduino Mega, I was able to use an Arduino Nano to communicate via Tx and Rx ports to the Arduino Mega but not the Pixhawk.

I believe I have set everything up on the Arduino side of:

  1. Download the MAVLink Library
  2. Request Data Stream of a Heartbeat message to ensure the connection to the pixhawk
    (Arduino IDE)
    *as for the other steps it seems more of just a troubleshooting process of connecting via MissionPlanner or MavProxy which I did successfully.