Mavlink-router still sends heartbeat even when disconnected from flight controller

For this scenario:
Flight controller - companion computer (UART connection)

Companion computer running Mavlink-Router

Companion computer - GCS on ground computer (TCP/IP connection)

It seems that if the UART connection is broken, the mavlink-router still sends heartbeats to the ground computer from the companion computer.

This “tricks” the ground computer running the GCS into thinking the vehicle is still connected, even when it is not. This is a potentially very dangerous situation.

Is there a way to configure Mavlink-Router so that stops sending heartbeats to the ground computer from the companion computer if the vehicle disconnects from the companion computer?

I’d be very surprised if this is the case - it’s just a proxy, I don’t think it generates mavlink messages itself at all.

Mavproxy does and it fooled me once, it was sending heartbeat to controller while ground station was not reachable anymore, so arducopter tought GCS was still online. I had to add a line with something like Hearthbeat NO in mavproxy config file (can’t remember the exact name of the file).

I know you are not talking about mavproxy but could be same with mavlink-router.

Corrado

It seems that if the UART connection is broken, the mavlink-router still
sends heartbeats to the ground computer from the companion computer.

Seems appropriate.

This “tricks” the ground computer running the GCS into thinking the vehicle
is still connected, even when it is not. This is a potentially very
dangerous situation.

Yes. The GCSs should be looking for the correct system ID / component ID

  • not just system ID.

Is there a way to configure Mavlink-Router so that stops sending heartbeats
to the ground computer from the companion computer if the vehicle
disconnects from the companion computer?

I don’t actually see mavlink-router sending heartbeats.

Could be other components on APSync… which system ID / component ID are
you seeing?

Ok. I was wrong. mavlink-router does not send a heartbeat to the GCS. I analyzed the traffic with tcpdump and wireshark.

Here is what I found happens:

When the connection from the flight controller to mavlink-router on the companion computer is broken (e.g. the flight controller is powered down entirely):

No more heartbeats are sent to the GCS (Mission Planner on Win10 in my case).

However, GCS still sends heartbeats (one per second) to mavlink-router.

Since the connection is over TCP, there is a TCP “ACK” to from the companion computer to the GCS for every heartbeat from the GCS to the companion computer.

But, no mavlink messages are ever sent to the GCS.

The question is, why doe the GCS still think it is still connected, even when it doesn’t receive heartbeats for a long time??? Is it because the TCP “ack” tricks the GCS into thinking it’s still connected all the way to the flight controller, when in reality it is only connected via TCP to the companion computer and mavlink-router?

Is there some setting in Mission Planner to make it say disconnected if it doesn’t receive a heartbeat from the flight controller after some timeout time?

I think I meet a same problem.But I didn’t solve it.