MAVLink and Arduino: step by step

When I put it before the switch and in the comm_receive() function, nothing came out still. So I print msg.id and the other parameters in the void loop, outside of the function, and am getting this with msg.id being 0:
07:14:47.963 → GPS Fix: 83

07:14:47.991 → GPS Latitude: 545316611

07:14:47.991 → GPS Longitude: 1735290700

07:14:47.991 → GPS Speed: 20551

07:14:47.991 → Sats Visible: 112

Putting the msg.id print outside of comm_receive() unfortunately doesn’t help, the values in msg at that point are not valid/unassigned.
Also, getting no output when you have the msg.id print inside comm_receive() and before the switch() confirms you are not receiving data bytes over the serial link clearly.
If you are certain you have the serial port speeds correct then I would try and listen in on the serial wire that goes from the AutoPilot TX to your Arduino RX. You can do this by using an FTDI buddy connected via USB to your computer. Then on your computer open a terminal program that allows you to see the received bytes in hex and open the fetid buddy serial port. Then last but not least connect the ground pin of the ftdi buddy to the ground of your project and the ftdi buddy RX to the AutoPilot TX.
That way you can evesdrop on all data bytes coming from the AutoPilot. That should help you troubleshoot at the serial port level and confirm that clean correct speed bytes are being sent by the AutoPilot.
You can also listen in on the Arduino TX line as well to check data flow from Arduino to AutoPilot.
This should help you confirm low level issues.
Again keep the serial port voltages in mind, make sure they are all 3.3v or 5v and not a mix of the two.

This is what I mean by and FTDI Buddy
https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwii37nG2fSEAxXiqWYCHbisAmQYABAPGgJzbQ&gclid=EAIaIQobChMIot-5xtn0hAMV4qlmAh24rAJkEAQYAyABEgIIdfD_BwE&cit=EAIaIQobChMIot-5xtn0hAMV4qlmAh24rAJkEAQYAyABEgIIdfD_BwE&ei=ZmzzZY6FGPXlseMP-_2R8Ak&ohost=www.google.com&cid=CAASJeRo14XljW-QApFrqD_z5nZACXuBihVrVruyc5A7Oj3qHz8YiO0&sig=AOD64_0arhR0t6JajB8zGpLZFexJjNTWTw&ctype=5&q=&sqi=2&pjf=1&ved=2ahUKEwiO0LXG2fSEAxX1cmwGHft-BJ4Qwg8oAHoECAMQEw&adurl=

How to get ardupilot log messages from mavlink?

Hello everyone!

Could you please assist me with obtaining data from a LiDAR sensor? Ideally, I should be using DISTANCE_SENSOR ( #132 ) and its current_distance value, but I can’t find a suitable description for it in the MAVLink library. I found that I need to use MAV_DATA_STREAM_EXTRA3 (this is described in GCS_Mavlink.cpp, line 543). But I don’t understand what to do next… I am using the TF Mini Plus lidar ( I2C, it works fine), and it’s crucial to transmit its readings to Arduino. I might be overlooking something, as I’ve been struggling for three days without success. Thank you all in advance for your help!

hi i try to connect teensy 4.1 to my drone
i config all the data and use the example of the heartbeat
i get row data with no logic and it not readable
try to switch rx and tx
i am not connect the teensy to the power only tx rx and ground
thanks for help |

OK, I did it). I used another library for my task.

Hi @jplopezll

I need your help am using esp8266 wifi module.I have connected the wifi module with pixhawk device and also gps module(ready to sky) also connected with pixhawk device.I need to reterive the gps data from the pixhawk device using the esp8266 wifi module can you please how to reterive the gps using wifi module using the ardunio ide software what are library’s need to add on the wifi module and what code need to be embeded on the wifi module to reterive the gps data over pixhawk device.

can you share your code use to reterive the gps data.Can you confirm are you using the esp8266 or esp32 wifi module?.

@jplopezll Thank u so much for this helpful post.

I need help on how to transmit data from arduino to the cube+ orange (pixhawk).

Thanks in advance.

@amilcarlucas