I am very new to mavlink communication and I have couple of questions about communicating between APM and Arduino Uno (or Mega).
Does APM board send out heartbeat message automatically? If so, should I able to catch it in Arduino IDE's serial monitor by connecting RX/TX port from Arduino to the telemetry port in APM board?
Any help will be great! Thank you!
Replies
When it is powered, the telemetry port on the APM will automatically send out a MAVLink stream. You can definitely use the Arduino to read these messages.
Edit:
If you're wanting to go APM->Arduino->PC, you will need to program the Arduino to route the telemetry messages from the APM->Arduino side to the Arduino->PC side.
Hi Stephen,
Thank you for your reply. How should connect the wires? TX from APM telemetry to RX on Arudino and RX form APM telemetry to TX Arduino?
Cuz when I do it that way, serial.avaible() on Arudino side never received anything.
Thanks
That wire connection should work. Did you connect ground between them too?
This site, although for a different project, might give you some pointers: http://vizual54.github.io/APM-Mavlink-to-FrSky/
I am getting the heartbeat package from APM board now. However, all I got was #0 and #253 pack. Even after I send out mavlink_msg_request_data_stream_pack.
I'm not sure why that would be the case.
Maybe try a ground station program (Mission Planner, APM Planner, MAVProxy, etc) to confirm that you can get the telemetry.
Otherwise, it might be worth looking through the source code of the above programs and see how they implement the communications.