Mqtt disconnects after some time - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Mqtt disconnects after some time (/showthread.php?tid=1387) |
Mqtt disconnects after some time - JohnTH - 09.05.2018 Hi, I use this code as a resident script that runs every 30 second. It works great, but it is loosing connection after 4-4.5 hour. I then have to disable --> enable script again to get it started. I have tried both line 12 and 15 commented out with no difference. This script is running fine on 2 other LM`s so I dont`t think the broker is the problem. Code: mqtt = require("mosquitto") Have anyone had the same problem, or any idea of what the problem can be ? RE: Mqtt disconnects after some time - admin - 09.05.2018 Add this to the end of your script or switch to a scheduled script that runs every minute. Code: collectgarbage('collect') RE: Mqtt disconnects after some time - JohnTH - 22.05.2018 Thanks, works great now. |