Inject message not correct after interval

Hello all.

Having an issue with the inject node. I have it set to inject after 5sec and then repeat every minute. On the startup it does what I expect. After the interval, it is like the join node doesn't work or something is going on as you get a message for every object. Any idea how I fix this or what i did wrong.

Hi @jonkers71

Without see the details of the flow, it's hard to say what is going on here.

Can you share the flow json? See this post for how to share code on the forum: How to share code or flow json

@knolleary here it is.

[{"id":"2331a5b77840a476","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"782906c9534eed7e","type":"join","z":"2331a5b77840a476","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"9","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":670,"y":120,"wires":[["5d6afb0fbce3f837"]]},{"id":"5d6afb0fbce3f837","type":"debug","z":"2331a5b77840a476","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":120,"wires":[]},{"id":"010c384ea0813364","type":"change","z":"2331a5b77840a476","name":"","rules":[{"t":"change","p":"topic","pt":"msg","from":"1.3.6.1.4.1.6574.1.5.1.0","fromt":"str","to":"Model","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"1.3.6.1.4.1.6574.1.5.2.0","fromt":"str","to":"Serial Number","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"1.3.6.1.4.1.6574.1.5.3.0","fromt":"str","to":"DSM Version","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"1.3.6.1.4.1.6574.1.5.4.0","fromt":"str","to":"Upgrade","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"1.3.6.1.4.1.6574.1.3.0","fromt":"str","to":"powerStatus","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"1.3.6.1.4.1.6574.1.4.2.0","fromt":"str","to":"cpuFanStatus","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"1.3.6.1.4.1.6574.1.4.1.0","fromt":"str","to":"systemFanStatus","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"1.3.6.1.2.1.25.1.1.0","fromt":"str","to":"Uptime","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"1.3.6.1.4.1.6574.1.1.0","fromt":"str","to":"systemStatus","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":120,"wires":[["782906c9534eed7e"]]},{"id":"69753a53a42fec7b","type":"function","z":"2331a5b77840a476","name":"Nas Info","func":"var user = {\n    name: \"brendan\", \n    level: snmp.SecurityLevel.authPriv,\n    authProtocol: snmp.AuthProtocols.sha,\n    authKey: \"xxxxxxx\",\n    privProtocol: snmp.PrivProtocols.aes,\n    privKey: \"xxxxxxxx\" \n    };\n    \n    var session = snmp.createV3Session (\"xx.xx.xx.xx\", user);\n    \n    //var model = \"1.3.6.1.4.1.6574.1.5.1.0\";\n    var systemStatus = \"1.3.6.1.4.1.6574.1.1.0\";\n    var uptime = \"1.3.6.1.2.1.25.1.1.0\";\n    var upgrade = \"1.3.6.1.4.1.6574.1.5.4.0\";\n    var powerStatus = \"1.3.6.1.4.1.6574.1.3.0\";\n    var cpuFanStatus = \"1.3.6.1.4.1.6574.1.4.2.0\";\n    var systemFanStatus = \"1.3.6.1.4.1.6574.1.4.1.0\";\n    var model = \"1.3.6.1.4.1.6574.1.5.1.0\";\n    var serial = \"1.3.6.1.4.1.6574.1.5.2.0\";\n    var version = \"1.3.6.1.4.1.6574.1.5.3.0\";\n    \n    var oids = [systemStatus, uptime, upgrade, powerStatus, cpuFanStatus, systemFanStatus, model, serial, version];\n    \n    session.get (oids, function (error, varbinds) {\n        if (error) {\n            console.error (error);\n        } else {\n            for (var i = 0; i < varbinds.length; i++) {\n                if (snmp.isVarbindError (varbinds[i])) {\n                    console.error (snmp.varbindError (varbinds[i]));\n                } else {\n                    msg.payload = varbinds[i].value;\n                    msg.topic = varbinds[i].oid;\n                    node.send(msg)\n                }\n            }\n        }\n        session.close ();\n    });","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"snmp","module":"net-snmp"}],"x":300,"y":120,"wires":[["010c384ea0813364"]]},{"id":"2f10ececab2cf246","type":"inject","z":"2331a5b77840a476","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":"10","topic":"Nas Health","payload":"","payloadType":"str","x":130,"y":120,"wires":[["69753a53a42fec7b"]]}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.