Coder Social home page Coder Social logo

Comments (7)

MajicDesigns avatar MajicDesigns commented on May 24, 2024

Animate() takes a few milliseconds to run if it has to animate, so I don't expect that that should stop MQTT from running. If it is dropping connection because in that brief time, then there is not much to do about this as the animation needs to run somehow.

I would be more likely that your code (which is unseen) is not calling the whatever MQTT needs for maintaining the connection, or you are somehow exceeding the watchdog timer for the ESP8266.

from md_parola.

debsahu avatar debsahu commented on May 24, 2024

Thanks for the quick reply.

Here is the code: https://github.com/debsahu/Scrolling-Text-Home-Assistant/blob/master/Scrolling_Text_Home_Assistant/Scrolling_Text_Home_Assistant.ino

I agree that Animate() takes some time, but is there a way to insert "mqtt.loop(); yield();" in some way while animating? Just point me to where in library that I need to change.

from md_parola.

MajicDesigns avatar MajicDesigns commented on May 24, 2024

The point is that animate() by itself takes almost no time at all, so the problem is more likely somewhere else in your code.

I would expect that "client.loop(); yield();" should be performed EVERY TIME through loop(), not just as an 'else' condition. They work the same way that animate() does - they need to be called as often as possible.

from md_parola.

debsahu avatar debsahu commented on May 24, 2024

While MQTT connection is maintained, "client.loop(); yield();" is done. If it disconnects, it tries to reconnect. This is the non-blocking MQTT implementation, even with this it fails. And I already have them outside the animation loop as well.

from md_parola.

MajicDesigns avatar MajicDesigns commented on May 24, 2024

I still think your structure for calling the yield() and client.loop() methods is wrong, but I am not writing your code.

Then you will just have to try different things until it works. Changing all the animations to PRINT will be a start, as these finish in 1 cycle (a few milliseconds).

from md_parola.

debsahu avatar debsahu commented on May 24, 2024

I figured out the WiFi & MQTT dropouts. The analogread needs a delay which I did not include. This is no fault of MD_Parola, please close this (non)-issue.

from md_parola.

MajicDesigns avatar MajicDesigns commented on May 24, 2024

ok. Good to hear you fixed your problem.

from md_parola.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.