I am running node-red on a brand new pi 4, so completely up to date software.
My mqtt node shows as disconnected, but is still sending messages. screenshot shows the flow with debug with messages at 11:16 onwards and the node-red log saying that the mqtt disconnected at 11:10.
re-starting or refreshing the browser doesn't do anything, but rebooting the pi does seem to reset it.
Which node is producing those messages? Can you please add a debug node after the mqtt-in to make sure it is actually that node that is outputting the data?
Also please give your debug mode names, even the ones not set to display the message.
I'm not sure how this would help, the screenshot clearly shows that the only debug node active is the one far right, the node red console shows that the mqtt was disconected @11:10:07, yet messages arrived after this time.
After I rebooted the issues hasn't re-appeared.
@mczakk,
by adding names it makes it easier to know which debug node your reading. however we all know if you hover over the id in debug panel the actual debug know is highlighted.
Placing a debug node directly to your mqtt in node was so we could see if while it said disconnected if it was producing a payload message. You have 10 different nodes doing things in-between the mqtt in node and your debug node that is active, so one of those nodes could be creating a message loop while your mqtt in node is disconnected. If your using your payload to control something it may warrant looking into the nodes more deeply to make sure what ever is still making a message when you dont have a connection to the mqtt server, you dont want to have something go haywire.
further more, I dont have one connected to the mqtt server, however i do have error reporting if one of my mqtt in messages doesnt give me my sensor info i get an email stating my sensor is down, and it also reboots my Esp8266 to resolve the issue and will let me know that its back up and running.
here is flow if you needs something like it.
[{"id":"570daa8bf3509f4c","type":"group","z":"367543bb6e76b182","name":"Temp Sensor Baby sitting","style":{"stroke":"#000000","fill":"#bfdbef","label":true,"color":"#000000"},"nodes":["d806e51aeeeb10bd","60386b18b2df7641","dc8ce5127e968fc0","6bc8712d86f8e7b0","0aab442fdc1add0c","0dfa0dabdb2dfc97","acd76b3c2f3d347e","885a482c5920543a","bfb1134493345c98","08eae226573dfd3a","8c55a2a2dc464855","8a409f1ed6e06d4a","506f2d6b73eadd89","283102acdae3ddf1","7594e99b3164f706","e89dc91e33a8ae42","315cba1095f2757f","47e6193cfd7e2d6d","eb1236d0c7656e47","0571b7a10abd1e9c","586acd16bb360734","b4f94d2f3cbca87b","d03a032f16d091bf","cc8b9f07e2e935e4","1782baa32b3be548"],"x":5,"y":111.83758926391602,"w":1288.5001058578491,"h":476.829083442688},{"id":"d806e51aeeeb10bd","type":"inject","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cmnd/Eferm/RESTART","payload":"1","payloadType":"num","x":604.5000905990601,"y":358,"wires":[["60386b18b2df7641"]]},{"id":"60386b18b2df7641","type":"ui_button","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"","group":"efd7b7c424179c82","order":1,"width":0,"height":0,"passthru":true,"label":"REBOOT","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"str","topic":"cmnd/Eferm/RESTART","x":815.5000905990601,"y":230.9999713897705,"wires":[["885a482c5920543a"]]},{"id":"dc8ce5127e968fc0","type":"trigger","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"","op1":"East sensor working","op2":"On","op1type":"str","op2type":"str","duration":"60","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":303.5000066757202,"y":224.66666412353516,"wires":[["0aab442fdc1add0c","7594e99b3164f706","cc8b9f07e2e935e4"],["6bc8712d86f8e7b0","60386b18b2df7641","08eae226573dfd3a","586acd16bb360734"]]},{"id":"6bc8712d86f8e7b0","type":"debug","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"badsensor","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":501.50009059906006,"y":313.9999713897705,"wires":[]},{"id":"0aab442fdc1add0c","type":"debug","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"sensor good","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":401.1543912887573,"y":152.83758926391602,"wires":[]},{"id":"0dfa0dabdb2dfc97","type":"e-mail","z":"367543bb6e76b182","g":"570daa8bf3509f4c","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"railhoperrors@gmail.com","dname":"","credentials":{},"x":634.7011022567749,"y":204.09369564056396,"wires":[]},{"id":"acd76b3c2f3d347e","type":"link in","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"","links":["7c4cbc1a995ee8c7"],"x":46,"y":225.66666412353516,"wires":[["dc8ce5127e968fc0","47e6193cfd7e2d6d"]]},{"id":"885a482c5920543a","type":"mqtt out","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"","topic":"cmnd/Eferm/RESTART","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"31a99116.50a74e","x":1084.50009059906,"y":235.9999713897705,"wires":[]},{"id":"bfb1134493345c98","type":"gate","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"default","x":1030.4999685287476,"y":432.6667194366455,"wires":[["315cba1095f2757f","1782baa32b3be548"]]},{"id":"08eae226573dfd3a","type":"mytimeout","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"Close the Gate after a single message","outtopic":"","outsafe":"Sensor Failed","outwarning":"","outunsafe":"off","warning":"5","timer":"10","debug":false,"ndebug":false,"ignoreCase":false,"repeat":false,"again":false,"x":546.5000905990601,"y":526.6667194366455,"wires":[["bfb1134493345c98","8c55a2a2dc464855"],["8a409f1ed6e06d4a"]]},{"id":"8c55a2a2dc464855","type":"debug","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"After Timer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":952.4999380111694,"y":377.66666889190674,"wires":[]},{"id":"8a409f1ed6e06d4a","type":"change","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"Close the Gate","rules":[{"t":"set","p":"payload","pt":"msg","to":"Close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":889.4999303817749,"y":547.666672706604,"wires":[["bfb1134493345c98"]]},{"id":"506f2d6b73eadd89","type":"link in","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"Fermenter (East) Gate Control In","links":["283102acdae3ddf1"],"x":901.4999380111694,"y":483.6666650772095,"wires":[["bfb1134493345c98"]]},{"id":"283102acdae3ddf1","type":"link out","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"Fermenter (East) Out to Gate Control","mode":"link","links":["506f2d6b73eadd89"],"x":1012.4999990463257,"y":173.6666440963745,"wires":[]},{"id":"7594e99b3164f706","type":"change","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"Open The Gate after a Good Temperature Read","rules":[{"t":"set","p":"payload","pt":"msg","to":"Open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":702.4999380111694,"y":167.66669273376465,"wires":[["283102acdae3ddf1"]]},{"id":"e89dc91e33a8ae42","type":"inject","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"Test Flow","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":144.50008296966553,"y":186.00003623962402,"wires":[["dc8ce5127e968fc0"]]},{"id":"315cba1095f2757f","type":"debug","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"After Gate","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1177.5001058578491,"y":412.00000381469727,"wires":[]},{"id":"47e6193cfd7e2d6d","type":"debug","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":148.16674709320068,"y":273.6666669845581,"wires":[]},{"id":"eb1236d0c7656e47","type":"change","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900.1668386459351,"y":275.6667194366455,"wires":[["885a482c5920543a","0571b7a10abd1e9c"]]},{"id":"0571b7a10abd1e9c","type":"debug","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1093.1667165756226,"y":285.666597366333,"wires":[]},{"id":"586acd16bb360734","type":"link out","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"Restart Out Link","mode":"link","links":["b4f94d2f3cbca87b"],"x":468.1667776107788,"y":260.666597366333,"wires":[]},{"id":"b4f94d2f3cbca87b","type":"link in","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"restart in link","links":["586acd16bb360734"],"x":784.1668386459351,"y":272.666597366333,"wires":[["eb1236d0c7656e47"]]},{"id":"d03a032f16d091bf","type":"comment","z":"367543bb6e76b182","g":"570daa8bf3509f4c","name":"Temp Sensor Babysitting","info":"this section controls email notifications if the temperature sensor stops reporting to the esp8266\nemails should be sent to railhoperrors@gmail.com\nths section of flow should also restart the esp8266\nto refresh connection with the ds18b20 temp sensor.","x":148.16680812835693,"y":537.6666440963745,"wires":[]},{"id":"cc8b9f07e2e935e4","type":"e-mail","z":"367543bb6e76b182","g":"570daa8bf3509f4c","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"","dname":"","credentials":{},"x":552,"y":203,"wires":[]},{"id":"1782baa32b3be548","type":"e-mail","z":"367543bb6e76b182","g":"570daa8bf3509f4c","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"","dname":"","x":1190,"y":468,"wires":[]},{"id":"efd7b7c424179c82","type":"ui_group","name":"East Fermenternew","tab":"a74ffe3d.4eb73","order":7,"disp":true,"width":24,"collapse":false},{"id":"31a99116.50a74e","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"a74ffe3d.4eb73","type":"ui_tab","name":"Brewery","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
(i have my mqtt in and outs on own tab in editor, i use linked in and outs to join things and keep clean)
I have noticed my mqtt in node gets disconnected. I just shutdown the mqtt server in command prompt and then restart it.
that usually fix's it.
Hope all is good with your system now.
cheers.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.