Ok,
I was messing about with a function
node in Telemetry
(tab).
I made a mistake and there was badly formatted stuff sent to a text
node.
(I'll accept being kicked for that)
So the flow was running and in each invocation it clocked up an error.
My error trap routine captured it and I got the node.warn
saying there is an error.
node.warn("Error detected check indication");
Sure, that was a bit of a silly chase looking for it, but I got to it quickly enough.
So I de-spooled a message from the queue and got the message ....
My understanding is that the line shown in the red box is "who" sent the error.
So when I click on it, it sends me ...... "no where useful"
I am not really getting what that is. Maybe it isn't supposed to take me to the node.
I know sometimes when I go into the error message (from that queue) and open it up and look at the error.object (I think that's what it is called) it takes me to the node.
But I am again not 100% certain.
Now,
Correct. So I am stumped.
That's because I can't find it. Kind of makes it difficult and raises my frustration.
I have to go back to what I last did and "undo" it, and see if that fixes the problem.
As I don't know how to fake an error in a flow, I can't do that to (maybe) invoke this thing happening.
But I don't think that will really test what I am claiming to be happening.
For the sake of getting all cards on the table, here is the flow I use to catch errors.
(Because if it has a built in flaw, I am really not going to get anywhere fast.)
Understand that any variables are set externally.
I hope this is handy as it either passes on the error, or: If I am working on a flow: Catches them and keeps them local so I don't mess with the bigger picture.
That is the reason for the Stop/Go buttons which also allows remote control of the error capturing too.
(Anyway, enough about that.)
[{"id":"6a527359.c4140c","type":"function","z":"c636aa5a.cc34","name":"Name flow","func":"var device_name = global.get('myDeviceName');\nmsg.topic =\"ERROR_REPORT/\" + device_name + \"/\" + flow.get(\"name\");\nnode.status({fill:\"red\",shape:\"dot\",text:\"ERROR\"});\nreturn msg;\n","outputs":1,"noerr":0,"x":4330,"y":220,"wires":[["951aa275.2a172","279f0eb0.44e83a"]]},{"id":"a2f8b3b4.fe609","type":"comment","z":"c636aa5a.cc34","name":"Error catcher","info":"","x":4340,"y":40,"wires":[]},{"id":"464040ff.1bcfc","type":"debug","z":"c636aa5a.cc34","name":"Telemetry error message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":4580,"y":270,"wires":[]},{"id":"9f58f465.2b8898","type":"catch","z":"c636aa5a.cc34","name":"","scope":null,"x":4170,"y":220,"wires":[["6a527359.c4140c","aec459f9.3ac4e8"]]},{"id":"ccb01cd4.3e68c8","type":"inject","z":"c636aa5a.cc34","name":"Stop","topic":"CONTROL","payload":"STOP","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":4346,"y":130,"wires":[["951aa275.2a172","279f0eb0.44e83a"]],"icon":"font-awesome/fa-hand-paper-o"},{"id":"f98ee097.f99f4","type":"inject","z":"c636aa5a.cc34","name":"Go","topic":"CONTROL","payload":"GO","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":"1","x":4346,"y":170,"wires":[["951aa275.2a172","279f0eb0.44e83a"]]},{"id":"43109b09.254874","type":"inject","z":"c636aa5a.cc34","name":"Next","topic":"","payload":"next","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":4190,"y":320,"wires":[["beb6b9b4.3b21f"]]},{"id":"882677c5.388ba8","type":"inject","z":"c636aa5a.cc34","name":"Wipe","topic":"","payload":"wipe","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":4190,"y":360,"wires":[["f329becb.e9d9"]],"icon":"node-red/alert.png"},{"id":"beb6b9b4.3b21f","type":"change","z":"c636aa5a.cc34","name":"","rules":[{"t":"set","p":"trigger","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":4360,"y":320,"wires":[["990f4a7b.2a5d8"]]},{"id":"f329becb.e9d9","type":"change","z":"c636aa5a.cc34","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":4360,"y":360,"wires":[["990f4a7b.2a5d8"]]},{"id":"990f4a7b.2a5d8","type":"simple-queue","z":"c636aa5a.cc34","name":"queue1","firstMessageBypass":false,"bypassInterval":"0","x":4340,"y":270,"wires":[["464040ff.1bcfc"]]},{"id":"63611ed4.b30278","type":"comment","z":"c636aa5a.cc34","name":"READ ME!","info":"Getting errors when machines come online/go off\nwith the chart getting NULL.\nNeed to investigate further.\n","x":4180,"y":150,"wires":[]},{"id":"951aa275.2a172","type":"gate","z":"c636aa5a.cc34","name":"","controlTopic":"CONTROL","defaultState":"open","openCmd":"GO","closeCmd":"STOP","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":4510,"y":220,"wires":[["59dae45c.c6d02c"]]},{"id":"59dae45c.c6d02c","type":"function","z":"c636aa5a.cc34","name":"Set topic","func":"var device_name =global.get('myDeviceName');\nmsg.topic =\"ERROR_REPORT/\" + device_name + \"/\" + msg.topic;\nreturn msg;","outputs":1,"noerr":0,"x":4650,"y":220,"wires":[["fd7f5a79.13061"]]},{"id":"fd7f5a79.13061","type":"mqtt out","z":"c636aa5a.cc34","name":"ERROR_REPORT","topic":"","qos":"","retain":"false","broker":"931f34a.34a47c8","x":4840,"y":220,"wires":[]},{"id":"279f0eb0.44e83a","type":"function","z":"c636aa5a.cc34","name":"","func":"var name = flow.get('name');\nvar ok = global.get('Error_Flow_Pass');\nvar stop = global.get('Error_Flow_Stop');\nvar caught = global.get('Error_Detected');\n\n//node.warn(\"Name of the flow \" + name);\n// -- check if this is a CONTROL message.\nif (msg.topic == 'CONTROL')\n{\n node.warn(\"Control signal received \" + msg.payload);\n if (msg.payload == 'STOP')\n {\n context.set('notify',1);\n msg.topic = name;\n msg.colour = stop;\n } else\n {\n context.set('notify',0);\n msg.topic = name;\n msg.colour = ok;\n }\n return msg;\n}\n\n// -- Send YELLOW as the message if error detected.\n//\tThis is only if the error reporting is blocked.\nvar pass = context.get('notify') ||0;\nif (pass == 1)\n{\n // set msg.payload to indicate\n node.warn(\"Error detected check indication\");\n msg.topic = name;\n msg.colour = caught;\nreturn msg;\n}\n","outputs":1,"noerr":0,"x":4510,"y":160,"wires":[["4976ec1b.89440c"]]},{"id":"4976ec1b.89440c","type":"link out","z":"c636aa5a.cc34","name":"","links":["432257a4.443a48","bb335d19.a8936"],"x":4605,"y":160,"wires":[]},{"id":"2fd169b2.bd515e","type":"inject","z":"c636aa5a.cc34","name":"","topic":"","payload":"Telemetry","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":4700,"y":100,"wires":[["6c7c6bf3.06be9c"]]},{"id":"6c7c6bf3.06be9c","type":"change","z":"c636aa5a.cc34","name":"","rules":[{"t":"set","p":"name","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":4870,"y":100,"wires":[[]]},{"id":"c947f9cd.9e7a9","type":"link in","z":"c636aa5a.cc34","name":"Telemetry_Error_CTL","links":["327bcdce.972912"],"x":4375,"y":90,"wires":[["951aa275.2a172","279f0eb0.44e83a","dc54a7ef.293fd"]]},{"id":"dc54a7ef.293fd","type":"debug","z":"c636aa5a.cc34","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":4510,"y":60,"wires":[]},{"id":"aec459f9.3ac4e8","type":"function","z":"c636aa5a.cc34","name":"Time stamp","func":"msg.time = new Date().toLocaleString();\nreturn msg;","outputs":1,"noerr":0,"x":4180,"y":270,"wires":[["990f4a7b.2a5d8"]]},{"id":"931f34a.34a47c8","type":"mqtt-broker","z":"","name":"MQTT host","broker":"192.168.0.99","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"SOM","birthQos":"2","birthPayload":"TimePi Comms Up","closeTopic":"EOM","closePayload":"TimePi shutting down","willTopic":"EOM","willQos":"0","willPayload":"TimePi Comms Failure"}]