How to read the pixhawk serial number(unique ID using QGC)

Hello all, I need to read the pixhawk number (Unique ID) on every connection. Can anyone suggest me a way out

Hello community !!! It has been 8 days but I got no reply. Anyone who knows how to read the pixhawk ID in QGC please help…

1 Like

@DonLakeFlyer Please help…

I looked into the code and found sysID, componentID, and vehicleID but none of them represent the Flight Controller Number (Pixhawk Unique ID). Any Suggestions ??
Moreover when I see the firmware of pixhawk I see a function returning Pixhawk ID.
Can anyone suggest me how to read pixhawk ID using QGroundControl.
@DonLakeFlyer please help

This link could be useful for you bud

@kapil_kumar to give you a bit more info, I’ve just pulled the Pixhawk ID from my vehicle. I’ve been writing a plugin for QGC, and when overriding the FirmwarePlugin architecture, there is a function adjustIncomingMavlinkMessage. This function is essentially called for every message coming from the vehicle.

By keeping an eye out for the message’s ID equalling the StatusText ID:
if (message.msgid == MAVLINK_MSG_ID_STATUSTEXT)
and then decoding that:

mavlink_statustext_t statusText;
mavlink_msg_statustext_decode(message, &statusText);

You can access the message. Then you just need to set up a conditional to find the correct StatusText message. The link uses C# but all you need to do is determine if
statusText.text contains the text PX4v2 - the rest of the text is the Pixhawk serial number.

At least, I’m fairly sure

1 Like

Thanks @Emulai thank you so much. Even I was concluding the same that status text might contain the pixhawk number. I will check and try to return the pixhawk number on the console and will get back to you if needed.

Hello @Emulai, I tried to print Pixhawk ID, but it is just showing me status text. Below attached is the picture of what I have done. Can you please tell me what I missed ?

Hi @kapil_kumar, near as I can tell you are accessing this the correct way. The fact that you are getting status text output of any kind is proof of that.

I would guess that the reason you aren’t getting the Pixhawk serial number is because of the failed pre-flight checks - perhaps the system as a whole isn’t progressing far enough to actually query for the Pixhawk information. Beyond that, I couldn’t say for sure

Thanks @Emulai, I finally got the pixhawk nummber, what I concluded was unless your pixhawk has RC calibrated it doesn’t provide you with the unique Pixhawk ID. Thanks for your support !!