adafruit / adafruit/Adafruit_CircuitPython_MiniMQTT

mqtt.loop() blocks loop temporarily

Open
#241 5 comments 1 reaction 1 assignee Claimed by @brentru View on GitHub
Dominant language
Python
Stars
81
Forks
52
PR merge metrics
No merged PRs in 30d

Description

I have a Neopixel strip animation with my RPI Pico 2040 W which runs smoothly until I add mqtt.loop() to my main loop. This will cause a very noticeable halt in the animation.
I experimented with different timeout values. I can decrease the timeout to 0.2 (necessitating a decrease to the socket_timeout to 0.2 as well). This improves the situation but the stall is still very noticeable. Decreasing the timeout even more causes network problems.

Of course it would be much nicer if there would be a async version of this library.

My main loop:

```
while True:
current_animation.animate()

mqtt_client.loop(timeout=0.2)

read_card(state)
publish_card(state)
```

TIA
Marcel

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.