# Adjust the frequency of mavlink topics (System\_status/Heartbeat)

**URL:** <https://discuss.px4.io/t/adjust-the-frequency-of-mavlink-topics-system-status-heartbeat/44282>\
**Category:** MAVLink\
**Created:** [March 11, 2025, 4:11pm UTC](https://discuss.px4.io/t/adjust-the-frequency-of-mavlink-topics-system-status-heartbeat/44282 "2025-03-11T16:11:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LaurelFaena](https://discuss.px4.io/user_avatar/discuss.px4.io/laurelfaena/32/18762_2.png) [@LaurelFaena](https://discuss.px4.io/u/LaurelFaena)\
**Post date:** [March 11, 2025, 4:11pm UTC](https://discuss.px4.io/t/adjust-the-frequency-of-mavlink-topics-system-status-heartbeat/44282/1 "2025-03-11T16:11:46Z")

</div>

Hello!  
I am trying to build a custom state machine around PX4 for my project. The goal is to remote control the drone using the offboard mode and to reliably control autopilot functions, detect errors and i.e. abort missions in case of errors.

The state machine is being built in ROS2 and utilizes Mavlink and Mavros for communication with the FC. It eventually is supposed to run on an onboard Raspberry Pi, for now I use a SITL setup.  
To reliably mirror the state of my drone I have been using the _state_ and _mode_-signals from the Mavlink Heartbeat message as Signals for my Statemachine.

The problem I am facing now is, that the low Frequency of the Heartbeat of 1Hz, is not sufficent to keep my statemachine updated in near Real-Time.  
How can I adjust this rate ? Are there perhaps alternative Solutions ?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Alp\_Ucan](https://discuss.px4.io/user_avatar/discuss.px4.io/alp_ucan/32/22000_2.png) [@Alp\_Ucan](https://discuss.px4.io/u/Alp_Ucan)\
**Post date:** [March 11, 2025, 7:22pm UTC](https://discuss.px4.io/t/adjust-the-frequency-of-mavlink-topics-system-status-heartbeat/44282/2 "2025-03-11T19:22:15Z")

</div>

Hi. You can adjust mavlink stream rates from console like this :

mavlink stream -r 50 -s BATTERY\_STATUS\_DEMO -u 14556

you canfind more info about this from here

> **[MAVLink Messaging | PX4 Guide (main)](https://docs.px4.io/main/en/middleware/mavlink.html)**
>
> PX4 User and Developer Guide

By the way, when you reboot this effect will disappears. If you want to adjust the rate permanently you should add this command to rcs script. And it will run automatically beginning of each boot.

---

<div class="post-metadata">

**Author:** ![LaurelFaena](https://discuss.px4.io/user_avatar/discuss.px4.io/laurelfaena/32/18762_2.png) [@LaurelFaena](https://discuss.px4.io/u/LaurelFaena)\
**Post date:** [March 12, 2025, 7:55pm UTC](https://discuss.px4.io/t/adjust-the-frequency-of-mavlink-topics-system-status-heartbeat/44282/3 "2025-03-12T19:55:23Z")

</div>

I missed that. Thanks for your help!
