How to decide system_id and component_id

I would like to connect 3G communication board to Pixhawk via UART and send some sensor values to a cloud server.

My understanding is that I should implement MAVLINK protocoll on my 3G board and communicate with pixhawk.
To get sensor value from pixhawk,
(1) send MESSAGE_INTERNAL to select which message the 3G board receive
(2) receive some messages, decode it and extract the values I want and send them to the cloud server

My question is, to communicate with Pixhawk, I have to specify system id and component id (byte index 3 and 4 in MAVLINK packet). How can I decide
those values?

I found the discussion “Can we have multiple system ids in different components in the same vehicle?” . According to this, system_id equates to a vehicle (usually, ‘1’), how about component_id? May I set it to MAV_COMP_IDUART_BRIDGE?

I am a newbie and I might have sent this message to a wrong place.If this is the wrong place, please let me know and I would send this to the right place.
Thanks in advance.

Though you can do that but will that be necessary? Once your 3G modem dial-up and connection is built, pixhawk does not need to see it besides the QGround or other GCS, or some kind of server program on the cloud side. The modem just pass the packet through, unless you would like to do some specially process to it.

Thank you very much for your reply. I am going to try.

I want to control my drone from QGC through WiFi. 3G modem send some sensing data to the cloud server so people can watch them in real time from remote.
In this case, my idea to use 3G modem sounds reasonable?
Later on, I want to control pixhawk from remote and that case 3G modem just pass the packet as you mentioned.
I am totally newbie (I haven’t used drone yet) so if you give me some more advice, I would be gratefil.

Yes i think that is reasonable.

Unless it is your purpose, putting connection and mavlink message handling logic on cloud side can save the work on changing PX4 code on Pixhawk side and inside 3G modem.

An interesting thought is, if your cloud server is running Linux then perhaps you can directly run QGC on the server. Then just some customization of QGC code may do your job…

Consider it some random idea and hope that helps.

Hi, Rolandash,

Thank you for your advice.
Yes, I want to run QGC on the cloud server so people can manipulate my drone from anyware.
I am not sure whether I can do that but want to try it.