# Restart of mqtt client

**URL:** <https://discourse.nodered.org/t/restart-of-mqtt-client/82057>\
**Category:** General\
**Tags:** node-red-dashboard, database, mqtt\
**Created:** [15 October 2023 19:18 UTC](https://discourse.nodered.org/t/restart-of-mqtt-client/82057 "2023-10-15T19:18:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AloisBachmeier](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aloisbachmeier/32/82319_2.png) [@AloisBachmeier](https://discourse.nodered.org/u/AloisBachmeier)\
**Post date:** [15 October 2023 19:18 UTC](https://discourse.nodered.org/t/restart-of-mqtt-client/82057/1 "2023-10-15T19:18:27Z")

</div>

Hi all: I run nodeRed + the Mosquitto broker.  
My problem:  
The Mosquitto send the mqtt message only if the value changes e.g. a number from a slider in the dashboard. I use that value in a client (C++) for anything. However when the client restart the mosquito still does not send any mqtt \>\> the variable in the client remains 0.  
Any idea how to "motivate" the mosquitto to poste the values of the scopes?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [15 October 2023 19:26 UTC](https://discourse.nodered.org/t/restart-of-mqtt-client/82057/2 "2023-10-15T19:26:00Z")

</div>

If you send the MQTT message with the retain flag set - then when the client reconnects the broker will resend the last message on that topic.

---

<div class="post-metadata">

**Author:** ![AloisBachmeier](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aloisbachmeier/32/82319_2.png) [@AloisBachmeier](https://discourse.nodered.org/u/AloisBachmeier)\
**Post date:** [15 October 2023 19:49 UTC](https://discourse.nodered.org/t/restart-of-mqtt-client/82057/3 "2023-10-15T19:49:39Z")

</div>

Pefect!

Thanks a lot 🙂

b.r. Alois

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 October 2023 19:50 UTC](https://discourse.nodered.org/t/restart-of-mqtt-client/82057/4 "2023-10-29T19:50:17Z")

</div>

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