Nodes Disabled, But Configuration Nodes Still Running (and Causing Problems)

I have a single flow I deploy to a Pis in a large number of machines. Each machine is different (different PLC, tags, etc.). I have everything set up so I can make updates (code fixes, additional features, etc.) from my development machine and trigger an inject node to deploy the flow to all the Pis so I don't have to update each one individually. This was working fine until now.

I have one tab of the flow which contains a node for each machine in the field. The following screenshots show an example of what I have. Each of the eth-ip nodes are configured for different machines. The PLCs in two of the machines have the same IP address (each machine is on an isolated network) and different tags. The eth-ip 4 in machine 1 (which uses eth-ip 1) generates an uncaught exception.

I disabled all the eth-ip nodes except for the one required by that particular machine, but the configuration node was still active and had the same result. I disabled all the configuration nodes except for the one required by that machine and everything worked well. Since enabling/disabling configuration nodes at runtime isn't possible from what I'm seeing in the forum, I'm at a loss. I could leave everything disabled, deploy, and then log in to each instance of Node Red and enable what is needed, but that's between 40 and 50 Pis I would have to do that with. I'm looking for a much better solution. I can't programmatically configure an eth-ip or pccc node because they lack that functionality and @machadotiago indicated in another thread that it's not possible to implement that functionality.

23 Apr 13:23:21 - [error] TypeError: Cannot read properties of undefined (reading '_members')
    at TagList.getTemplateByTag (/home/sftp/.node-red/node_modules/st-ethernet-ip/src/tag-list/index.js:212:47)
    at Controller.newTag (/home/sftp/.node-red/node_modules/st-ethernet-ip/src/controller/index.js:1327:43)
    at extController.addTag (/home/sftp/.node-red/node_modules/st-ethernet-ip/src/controller-manager/index.js:91:22)
    at createTags (/home/sftp/.node-red/node_modules/node-red-contrib-cip-st-ethernet-ip/red/ethernet-ip.js:140:41)
    at extController.onConnect (/home/sftp/.node-red/node_modules/node-red-contrib-cip-st-ethernet-ip/red/ethernet-ip.js:192:13)
    at extController.emit (node:events:513:28)
    at /home/sftp/.node-red/node_modules/st-ethernet-ip/src/controller-manager/index.js:52:12
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

MWSnap-RC3Desktop 2023-04-23, 12_57_26

Do you deploy the exact same flow to all devices or a custom version flow to each device?

It's the same flow to every device.

For reference, @ChZeman raised an issue here: Populate Vartable from Environment Variables · Issue #36 · st-one-io/node-red-contrib-cip-ethernet-ip · GitHub

In the MQTT nodes, we permit the user to uncheck "Auto Connect" in the config node and permit the user to send a the string "connect" or "disconnect" in msg.action to any regular MQTT node. Additionally, the MQTT node permits dynamic subscriptions by sending "subscribe" or "unsubscribe" in the msg.action - along with the topic to subscribe in msg.topic

I suspect this node requires something similar. Perhaps you could mention something like this as a feature request in the issue. OR fork the node, add the feature and raise a PR back to the original node.

1 Like

That would be an excellent approach, Steve! It's frustrating that the config nodes are still active even when the nodes they're configured for are disabled.

Some config nodes are used for more than one node. Also, depending on the type, it might need to stay enabled. It is up to the developer to provide a means of dynamically controlling what their config node does - node-red can't assume I'm afraid.

1 Like

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