management of MQTTqueue overflow!

Die Verwendung von Skripten liegt im eigenen Ermessen des Benutzers. Unterstützung für Skripte wird vom Autor des Skripts bereitgestellt.
  • Hi,

    I restart to dev my Shelly script to manage my pool pump with new version of firmware 1.0.3.

    I wouldike know how the MQTT queue is managed because I don't have some information on my mqtt broker ( mosquito) without stop/crash of the script and have many log with :

    Code
    shos_mqtt_conn.c:872 MQTT0 queue overflow!

    I make some test with MQTT.publish, and it seems that the limit is 20 in loop "for" before MQTT queue overflow log.

    Do you have some informations about that ?

    I don't use 20 MQTT.publish on my script, so i imagine that the queue is related to anything ? number of call ? size of the call ? ...

    The MQTT queue managment has changed since firmware 0.14 ?

  • MQTT queue overflow is not related to script MQTT publishing functions. This error occurs when the CPU is overwhelmed, often due to excessive function calls or for loops, resulting in continuous MQTT overflow messages.

    So if you're receiving MQTT overflow messages, it's a strong indicator that your Shelly device is overloaded. To mitigate this, reduce the number of scripts running on your Shelly and the associated script memory usage.

    This should help decrease MQTT overflow errors.

    Here is a small script, which triggers mqtt overflow messages without using a mqtt publish function.


    Code
    let stack = [];
    function stacking(a) {
    stack.push(a);
    }
    for (let i=0; i<200; i++) {
    stacking(['Switch.set', {on: true, id:0}, i]);
    print(i);
    }

    My personal thoughts on this topic:

    there isn't an MQTT queue within MQTT itself, it's a specific feature of Shelly devices. My assumption is that there's an internal call queue that drops calls when they time out so not getting processed anymore. This has been happening continuously since firmware version 1.0. In fact, the first beta versions of FW 1.0 used to crash when an MQTT queue error occurred. So, that it now only drops one or two messages is a significant improvement.

    Firmware version 1.0 likely requires more hardware resources, especially when all MQTT settings are enabled. The device continuously sends internal MQTT status updates, and if you also use the BT gateway and cloud functions, the device is essentially operating at its hardware limit. This results in numerous internal timeouts. Adding a complex script to this setup pushes the device beyond its limits. Frankly, I'm not sure how they intend to fix this issue.

    6 Mal editiert, zuletzt von _[Deleted]_ (9. Oktober 2023 um 17:45)

  • now it’s almost 2 years later and lots of b0rked firmwares later and it seems that Shelly will never fix this bug :-( … and it doesn’t matter how much bug reports you send them, they don’t mind.


    I have a BLU GW, one Button 1, three door/window sensors and one motion sensor and get this error > 100 times a day.


    I actually wanted to equip my whole house with it, but definitely not like this. You can't rely on any status if some of the MQTT messages will never reach the broker :-(


    The devices are really great but the firmware is crap.

  • Dieses Thema enthält einen weiteren Beitrag, der nur für registrierte Benutzer sichtbar ist.