# MAVLink connection freezes with heartbeat timeout and tx\_buffer\_overruns

**URL:** <https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150>\
**Category:** Uncategorized\
**Created:** [December 18, 2025, 8:19am UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150 "2025-12-18T08:19:41Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhichao.li](https://discuss.px4.io/letter_avatar_proxy/v4/letter/z/e9c0ed/32.png) [@zhichao.li](https://discuss.px4.io/u/zhichao.li)\
**Post date:** [December 18, 2025, 8:19am UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/1 "2025-12-18T08:19:41Z")

</div>

### Description

I am experiencing severe MAVLink communication issues on a companion computer setup (MAVROS connected to a Pixhawk via serial). The core problem is that **the MAVLink sending thread on the PX4 flight controller completely freezes during operation** , causing communication with the companion computer to fail. During the failure, all transmission statistics freeze. The connection eventually recovers by itself, but results in severe command sequence desynchronization.

### Detailed Symptoms & Timeline

1. **Failure Occurs (approx. 11 minutes into flight)**:

2. **During Failure (approx. 1 minute)**:

3. **Connection Recovery (approx. 12 minutes 30 seconds into flight)**:

### Logs and Evidence

- **Complete Flight Log (ULG)**: [flight\_review\_log](https://logs.px4.io/plot_app?log=ed79d4b0-bf96-4741-aa7d-1bf15f99a51b)
- **Key Symptom Screenshots** :
  1. [Fig 1: tx\_buffer\_overruns and tx\_message\_count frozen in mavlink\_status](https://github.com/user-attachments/assets/622c2330-820e-490b-a65a-858778335ce2)
  2. [Fig 2: Significant drop in CPU load during the failure period](https://github.com/user-attachments/assets/bd382a92-1829-44a7-8f52-d48f55d5848c)
  3. [Fig 3: vehicle\_command loss with generation number jumps](https://github.com/user-attachments/assets/42310ec2-2ed0-44fc-a673-13195f19c53f)

### Environment

- **PX4 Firmware Version** : v1.15.4
- **PX4 Autopilot Hardware** : Holybro Pixhawk V6X

### 

### Request for Help

1. Could the PX4 developers help analyze the provided ULG log to confirm the internal state of the MAVLink module at the moment of failure?
2. Are there any known issues or fixes related to MAVLink sending thread freezes?
3. What are the recommended areas for deeper debugging (e.g., enabling more verbose kernel or MAVLink debug logs)?
4. Are there any viable workarounds in the current version?

### 

* * *

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [December 18, 2025, 8:17pm UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/2 "2025-12-18T20:17:16Z")

</div>

What rates are you trying to send out? What is the configuration of streams? And what baudrate are you using? And are you connecting and using flow control?

---

<div class="post-metadata">

**Author:** ![zhichao.li](https://discuss.px4.io/letter_avatar_proxy/v4/letter/z/e9c0ed/32.png) [@zhichao.li](https://discuss.px4.io/u/zhichao.li)\
**Post date:** [December 19, 2025, 1:40am UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/3 "2025-12-19T01:40:04Z")

</div>

Thanks for the quick reply!

Here are the details you asked for:

- **Baudrate** : 921600 (serial connection on /dev/ttyS1, TELEM port)
- **Flow control** : OFF
- **Mode** : Onboard
- **Current stream rates/configuration** : Default for Onboard mode, but I previously modified the source code in `mavlink_main.cpp` to set HIGHRES\_IMU to 200Hz (original was 50Hz). This significantly increased TX bandwidth usage. Current `mavlink status` for the companion instance shows:
  - TX rate: around 36 KB/s (avg), with tx rate max set to 80000 B/s
  - No manual stream configuration overrides yet, but planning to lower some rates.

Latest discovery (from last night):  
I was able to perfectly reproduce the exact same behavior as during yesterday’s flight (sudden HEARTBEAT timeout on MAVROS side, outgoing topics freeze, but setpoints still partially work, and it recovers by itself after a while) by **manually stopping and restarting the MAVLink instance** in the nsh console

mavlink stop -d /dev/ttyS1:  
Immediate HEARTBEAT timeout on MAVROS, all PX4 topics stop updating (exactly like the flight freeze).

mavlink start -d /dev/ttyS1 -b 921600 -m onboard -r 80000:  
Connection recovers in 1-2 seconds, all topics resume.

This strongly suggests that during flight, the MAVLink send thread on the PX4 side gets “stuck” or deadlocked under high load then tx\_message\_count and txavgrate freeze/stop updating,causing HEARTBEAT to stop being sent temporarily. Restarting the instance clears the queue and resets everything, mimicking the spontaneous recovery in flight.

Do you think this could be related to TX buffer overruns causing a temporary deadlock in the send path when rates are too high (especially with HIGHRES\_IMU at 200Hz)? Any recommendations for safer rates or ways to prevent the freeze without restarting the module?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [December 22, 2025, 7:35pm UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/4 "2025-12-22T19:35:56Z")

</div>

Interesting, so I should be able to reproduce this issue… I’ll put it on my list, probably for next year.

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [December 23, 2025, 11:04pm UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/5 "2025-12-23T23:04:10Z")

</div>

I’m just trying to reproduce this now. The first thing I found so far is that you are using Telem 3 (because that’s ttyS1). I often use Telem 2 for the connection to the companion computer and haven’t seen that problem there. However, Telem 2 is using DMA while Telem 3 does not. You could try to use Telem 2 instead and check whether you can reproduce it there as well, or not.

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [December 23, 2025, 11:33pm UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/6 "2025-12-23T23:33:35Z")

</div>

I have this working stable and haven’t seen drops yet. However, I’m not sending setpoints but only receiving at this stage. I might have to add in some traffic.

Also, do you have other mavlink instances running, and do you have forwarding enabled? It might be worth sending the output of `mavlink status` to see what is going on.

I also changed `HIGHRES_IMU` to 200 Hz which strangely sends it down at 250 Hz…

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [December 24, 2025, 1:13am UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/7 "2025-12-24T01:13:50Z")

</div>

> [@JulianOes](#):
>
> I also changed `HIGHRES_IMU` to 200 Hz which strangely sends it down at 250 Hz…

Nevermind, this was an issue of my MAVSDK debug code.

---

<div class="post-metadata">

**Author:** ![zhichao.li](https://discuss.px4.io/letter_avatar_proxy/v4/letter/z/e9c0ed/32.png) [@zhichao.li](https://discuss.px4.io/u/zhichao.li)\
**Post date:** [December 24, 2025, 1:51am UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/8 "2025-12-24T01:51:43Z")

</div>

Hi Julian,

Quick update after more testing:

Actually, after reverting some of the aggressive rate increases (HIGHRES\_IMU at 200 Hz plus moderate increases on a few other streams), **I have not been able to reproduce the freeze again** in extended ground tests and several additional flights.

So far, the MAVLink send thread freeze (with stuck tx stats and HEARTBEAT timeout) has only occurred:

- Once during the original flight (the one that started this thread)
- And consistently when I manually stop and restart the MAVLink instance (`mavlink stop -d /dev/ttyS1` + `mavlink start ...`), which perfectly reproduces the same symptoms and recovery

In normal operation since then (multiple hours of armed Offboard with vision\_pose ~50 Hz and setpoints 50 Hz), everything stays stable:

- TX rate around 46 KB/s
- No accumulating tx\_buffer\_overruns
- tx\_message\_count and txavgrate continue increasing normally
- No spontaneous freeze or HEARTBEAT timeout

For reference, the configuration I tested in the stable runs included:

- HIGHRES\_IMU → 200 Hz
- ATTITUDE → 200 Hz
- ATTITUDE\_TARGET → 200 Hz
- LOCAL\_POSITION\_NED → 100 Hz
- GLOBAL\_POSITION\_INT → 100 Hz

My question remains: Are there any known conditions (e.g., prolonged backlog in the TX queue, specific stream patterns, mutex contention, or scheduling issues) under which the MAVLink send thread can temporarily freeze/stop sending messages (including HEARTBEAT) and then spontaneously recover ?

Thanks again for your time — really appreciate the insights from the dev team!

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [December 28, 2025, 12:44am UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/9 "2025-12-28T00:44:12Z")

</div>

> [@zhichao.li](#):
>
> My question remains: Are there any known conditions (e.g., prolonged backlog in the TX queue, specific stream patterns, mutex contention, or scheduling issues) under which the MAVLink send thread can temporarily freeze/stop sending messages (including HEARTBEAT) and then spontaneously recover ?

Not that I know of, and it obviously shouldn’t, unless you are genuinely saturating the link.

If you can point me to a direction how to consistently reproduce it, I’ll try it again.

---

<div class="post-metadata">

**Author:** ![zhichao.li](https://discuss.px4.io/letter_avatar_proxy/v4/letter/z/e9c0ed/32.png) [@zhichao.li](https://discuss.px4.io/u/zhichao.li)\
**Post date:** [January 23, 2026, 5:56am UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/10 "2026-01-23T05:56:36Z")

</div>

This happened twice more, each time resuming after a one-minute disconnection.

 ![image](https://discuss.px4.io/uploads/default/original/3X/d/d/ddcabd737e83cdc4d564464d7e06fdb2932e8af0.png)

> **[Flight Review](https://logs.px4.io/plot_app?log=d6b39242-042d-47dc-bd70-edd3f5638be3)**

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [January 29, 2026, 9:35pm UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/11 "2026-01-29T21:35:52Z")

</div>

![image](https://discuss.px4.io/uploads/default/original/3X/f/2/f22938091f1483bf67d3bc052d437a781d3c8464.png)

You seem to be sending/receiving a lot of commands somehow? Commands with acks are not meant to be sent at high rates because they involve some buffering, etc. so that could be what leads to this problem.

What sort of commands are you sending? Maybe this can be addressed. Maybe gimbal commands?

---

<div class="post-metadata">

**Author:** ![ss\_aa](https://discuss.px4.io/user_avatar/discuss.px4.io/ss_aa/32/21438_2.png) [@ss\_aa](https://discuss.px4.io/u/ss_aa)\
**Post date:** [April 13, 2026, 12:50pm UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/12 "2026-04-13T12:50:03Z")

</div>

me too.I also find this problem, the flight control receive AI board’s visual odometry data and control setpoint command, but the AI boards can’t receive flight control message(like attitude, position and so on),and regained connection after 60S.

---

<div class="post-metadata">

**Author:** ![system](https://discuss.px4.io/uploads/default/original/3X/7/3/73ce918bdcd64854de904f0c8d9ab70ca9723f2a.png) [@system](https://discuss.px4.io/u/system)\
**Post date:** [July 12, 2026, 12:50pm UTC](https://discuss.px4.io/t/mavlink-connection-freezes-with-heartbeat-timeout-and-tx-buffer-overruns/48150/13 "2026-07-12T12:50:09Z")

</div>

Closed on July 12, 2026, 12:50pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
