Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mqtt.loop() blocks loop temporarily #241

Open
mjmare opened this issue Jan 28, 2025 · 0 comments
Open

mqtt.loop() blocks loop temporarily #241

mjmare opened this issue Jan 28, 2025 · 0 comments

Comments

@mjmare
Copy link

mjmare commented Jan 28, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant