Servers by jDrones

Mavlink dont receive ads-b command

Hi there,
I am using mavlink 1.0, but I can’t receive any MAVLINK_MSG_ID_ADSB_VEHICLE message. With the current Missionplanner it is working (Mavlink 1.0), but I want to show them on my own GS. Any secret message that the MissionPlanner is using for requesting it ;)?

You may have to request the stream or set a streamrate. Most GCSes do this automatically, so you might need to do it yourself:

  • Make sure you set SR*_ADSB parameter to a nonzero value, where * is the number of the serial port used to connect to the GCS
  • You may have to send MAV REQUEST_DATA_STREAM to get the ADSB messages. Ardupilot has not implemented SET_MESSAGE_INTERVAL yet, so don’t use that.
1 Like

Thank you Rick for your response. Of course I have requested the streams and the ADSB Interval is set to 5hz on the pixhawk but still I am not able to receive this specific message. I do not feel like digging through the MissionPlanner code :smiley: Any other idea?

void request_mavlink_rates()
{
const int maxStreams = 7;
const byte MAVStreams[maxStreams] = {
MAV_DATA_STREAM_RAW_SENSORS,
MAV_DATA_STREAM_EXTENDED_STATUS,
MAV_DATA_STREAM_RAW_CONTROLLER,
MAV_DATA_STREAM_POSITION,
MAV_DATA_STREAM_EXTRA1,
MAV_DATA_STREAM_EXTRA2,
MAV_DATA_STREAM_EXTRA3
};

const int MAVRates[maxStreams] = {
0x02, 0x02, 0x02, 0x02, 0x10, 0x02, 0x02
};

for (int i = 0; i < maxStreams; i++)
{
mavlink_msg_request_data_stream_send(MAVLINK_COMM_0,
mav_system,
mav_component,
MAVStreams[i],
MAVRates[i], 1);
}

@Michael_Oborne, did you do any special to receive the ADS-B message? I would be very happy if someone helped me. Thanks in advance!

Are you using PingRX? I recall that my Ping had its own component ID, so you may have to request stream from a different component than your FC. You can use Mission Planner’s MAVLink inspector (Ctrl+F) to see what component ID is sending ADSB messages.

1 Like

Thanks again Rick! I also had the idea yesterday and have tried different component IDs, unfortunately without success. Looks like the component ID from Missionplanner is 1. May be there is something like “MAV_DATA_STREAM_ADSB_VEHICLE” (does not exist in my mavlink lib) ? - or to which stream belong the ADSB data?

Unbenannt

Unfortunately that’s the end of my knowledge. It looks like MAVProxy requests MAV_DATA_STREAM_ALL, which must include ADSB messages since its ADSB module just looks at incoming messages and doesn’t request anything special. Maybe ADSB is included in one of the EXTRA streams.

1 Like

Nevertheless, many thanks for your help and honesty! :+1:
Maybe I’ll find something out…:upside_down_face:

@rmackay9 do you know why I can’t receive the ADSB Message, even though I requestet all Mavlink Streams? I have an Arduino on Serial1 and everything on the pixhawk is set up right. With the Missionplanner it’s working…what am I missing?

Maybe its something wrong or missing with my mavlink lib. I will try to use a newer version, hopefully this will help

OK its working, I had an old mavlink version :relieved:

2 Likes
Servers by jDrones