Greetings all. I`m looking for some information on how I can extract Telemetry information from QGC for inputting into an Arduino so use the data on a small display within a HCU. Ive spent all afternoon trying to find the answer but cant seem to get find how I can get a hold of the mavlink data onto an Arduino. Is the COMMS LINK in QGC used for this? I haven’t had any joy in successfully receiving any data through this means. Currently Using Navigator Board & Pi4 if this is of any use.
Hi David -
What is “HCU” ?
Getting an Arduino to talk mavlink is a challenge, as all the mavlink traffic is TCP/IP, not something the Arduino can speak without an ethernet port or wifi radio. You may be able to run a python script on your control computer to receive all or some of the mavlink data, and forward it to the Arduino via the serial port connection it creates with the computer - but at that point you may be better off just generating whatever graph or feedback on the computer, and not n external device? I’m not aware of a way to do what you’re trying that doesn’t involve developing your own code, as it’s not a standard use case.
Thanks for the reply Anthony,
I`m working on a custom Hand Control Unit and plan to incorporate a small 3/4" touchscreen panel into it. The screen is primarily to be used to monitor trim % on the X & Y but as ive got the screen, I would like to monitor other things like heading, depth, lights status .ect. So its more of Display than an HMI as I dont need to send any Mavlink commands but sniff the data thats being sent to QGC. Qgroundcontrol does have a COMMS Link but I cant find any documentation on what it is used for?
Hi David -
For your application, I would recommend using a microcontroller only to emulate game-pad input. For your small display, I would recommend a small USB display, and using our new Cockpit ground control software you should be able to configure something without any coding! The multiple screens and customizable widgets should help.
The Teensy microcontroller can be programmed with arduino, and is a popular choice for basing custom USB game controller’s on due to its support for HID, human input device drivers. Just an idea! You would map the relevant trim ardusub functions to the axis / buttons that are emulated by your Arduino code and the physical devices connected to the microcontroller.
I don’t think QgroundControl would be involved in your custom solution, the COMMS link is intended for setting up manual links to mavlink vehicles.
Best of luck!
Sorry for the late reply Anthony. I got side tracked with my actual job Ive had a play and looks like I can get Mavlink data out from UDP port 14445 from QGC. I then used a UDP to serial to send it to Arduino but I dont seen to have any joy in being able to read it in Arduino. I feel like im so close but just cant get this late bit.
Im using a Leo Bodnar 12 Bit joystick interface for speaking to windows. Ive not had a good looks at Cockpit yet but will delve into it this weekend. I determined to try and get these mavlink messages into Arduino though
Hi David -
Again, I don’t think QGround Control needs to be involved! You could setup a Mavlink Endpoint (pirate mode) and run a script on your computer to forward the mavlink messages to whatever com port the Arduino is at… and generate appropriate mavlink control messages to send back over the same link?
Since weve spoke ive had a look at Cockpit and have to say i like it and will more than likely use this instead of QGC. I
m not working this week so im going to start getting back into this project again. I will have a look at Endpoints and see if can achieve what im looking for. Thanks again for your input Anthony. Ill report back my findings
Just an update Anthony. Ive finally managed to get a chance to have a play and ive achieved what I was looking to do. By the time I had all my code loaded in to my Arduino It was starting to slow down so I had a look replaced it with a Teensy 4.0. What a bit ive got to say so thanks for the recommendation. It will be my go to board from now on. Thanks again for your help