# Mqtt-tls - client.loop() frequency?

**URL:** <https://community.particle.io/t/mqtt-tls-client-loop-frequency/62133>\
**Category:** Cloud\
**Tags:** boron\
**Created:** [February 25, 2022, 11:53pm UTC](https://community.particle.io/t/mqtt-tls-client-loop-frequency/62133 "2022-02-25T23:53:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![romuloescamilla](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@romuloescamilla](https://community.particle.io/u/romuloescamilla)\
**Post date:** [February 25, 2022, 11:53pm UTC](https://community.particle.io/t/mqtt-tls-client-loop-frequency/62133/1 "2022-02-25T23:53:11Z")

</div>

hi all,

one more questions regarding the public libarry mqtt-tls provided by the great hirotakaster:

I’m sending 3 json strings via MQTT-TLS at 3 different rates:  
mqtt\_slow - every 4 hours  
mqtt\_fast - every 15 minutes  
mqtt\_onChange - whenever any of the basic parameter changes, I check them once a minute.

every time one of these timers saturates, I check if mqtt is connected. if not – enable TLS – connect – create json – client.publish()

What is the appropriate frequency to run the client.loop()? I’m currently running it every 10 seconds, but I don’t know if it’s using a lot of cellular data, or when is it actually required to be run.

Any input will be greatly appreciated.

thanks!

**-R**

---

<div class="post-metadata">

**Author:** ![romuloescamilla](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@romuloescamilla](https://community.particle.io/u/romuloescamilla)\
**Post date:** [March 10, 2022, 4:54pm UTC](https://community.particle.io/t/mqtt-tls-client-loop-frequency/62133/2 "2022-03-10T16:54:12Z")

</div>

anybody has any comments on this?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/3/2/3291e3c9351789fe8620ae5bcec8d3fec67ff221.png) [@system](https://community.particle.io/u/system)\
**Post date:** [September 9, 2022, 4:54am UTC](https://community.particle.io/t/mqtt-tls-client-loop-frequency/62133/3 "2022-09-09T04:54:27Z")

</div>

Closed on September 9, 2022, 4:54am UTC

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