Skip to content

UDP client parse errors with valid ArduPilot MAVLink stream that QGroundControl can read #245

@gavrilaf

Description

@gavrilaf

Hi,
I’m seeing what looks like a UDP-specific parsing problem in gomavlib.

What works

  • Direct connection to the same controller over serial works correctly with gomavlib.
  • QGroundControl (or MAVProxy) can connect directly to the remote UDP endpoint and works normally.

What fails

Direct connection with gomavlib to this remote UDP endpoint:

I use:

node := &gomavlib.Node{
    Endpoints: []gomavlib.EndpointConf{
        gomavlib.EndpointUDPClient{Address: "100.75.166.252:18450"},
    },
    Dialect:             ardupilotmega.Dialect,
    OutVersion:          gomavlib.V2,
    OutSystemID:         255,
    OutComponentID:      1,
    HeartbeatDisable:    false,
    HeartbeatPeriod:     5 * time.Second,
    HeartbeatSystemType: 6,
    StreamRequestEnable: true,
}

The node initializes successfully and I do receive some valid messages, for example SYS_STATUS and RAW_GPS, but then parsing starts failing with errors like:

wrong checksum, expected 690b, got e1cf, message id is 34
invalid magic byte: b3
invalid magic byte: 3a
invalid magic byte: e1

I also tested with mavp2p, and the same remote UDP endpoint produces many errors there too:

mavp2p udpc:100.75.166.252:18450 udps:127.0.0.1:14550

Example output:

router started with 2 endpoints
channel opened: udp:100.75.166.252:18450
node appeared: chan=udp:100.75.166.252:18450 sid=1 cid=1
node appeared: chan=udp:100.75.166.252:18450 sid=0 cid=0
node appeared: chan=udp:100.75.166.252:18450 sid=205 cid=253
595 errors in the last 5s
node appeared: chan=udp:100.75.166.252:18450 sid=1 cid=253
node appeared: chan=udp:100.75.166.252:18450 sid=253 cid=28
483 errors in the last 5s

Why I think this points to gomavlib

  • Same controller + same MAVLink stack over serial works.
  • Same remote UDP stream works in QGroundControl.
  • Both my app and mavp2p fail on the same remote UDP stream

So this seems likely to be:

  • a bug in UDP handling in gomavlib, or
  • an edge case in how this UDP MAVLink stream is parsed by gomavlib.

Question

Is there any known issue with EndpointUDPClient and remote ArduPilot UDP streams that QGroundControl tolerates but gomavlib does not?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions