Passing through input message stops join node

Hi Steve,

Did you see my post earlier yesterday afternoon? I don't believe it has anything to do with the KNX nodes as I can replicate the same failure when taking the nodes out. It seems to be something do with the HTTP in and join combination. I posted a flow which you may be able to paste in and check that you're seeing the same thing.

Yes, they are 100% reliable when directly injecting something and also 100% reliable when being triggered by the HTTP in node. They only become unreliable when there is a both a HTTP in node and a join node in the flow together (either a join node or HTTP node is fine, but not both).

Cheers,
Ben

Sorry I completely skipped that post. :flushed:

I'm gonna give your flow a go & see if I get the same results.

Will be a bit later on today.

1 Like

@element22

Hi again, so I tried your flow (albeit on an older version v0.20.8 of node-red), I see this in the log...

TypeError: Cannot assign to read only property 'writeQueueSize' of object '#<TCP>'
    at _clone (c:\ProgramData\npmglobal\node_modules\node-red\node_modules\clone\clone.js:162:16)
    at _clone (c:\ProgramData\npmglobal\node_modules\node-red\node_modules\clone\clone.js:162:18)
    at _clone (c:\ProgramData\npmglobal\node_modules\node-red\node_modules\clone\clone.js:162:18)
    at _clone (c:\ProgramData\npmglobal\node_modules\node-red\node_modules\clone\clone.js:162:18)
    at _clone (c:\ProgramData\npmglobal\node_modules\node-red\node_modules\clone\clone.js:162:18)
    at _clone (c:\ProgramData\npmglobal\node_modules\node-red\node_modules\clone\clone.js:162:18)
    at clone (c:\ProgramData\npmglobal\node_modules\node-red\node_modules\clone\clone.js:202:10)
    at Object.cloneMessage (c:\ProgramData\npmglobal\node_modules\node-red\node_modules\@node-red\util\lib\util.js:90:13)
    at JoinNode.Node.send (c:\ProgramData\npmglobal\node_modules\node-red\node_modules\@node-red\runtime\lib\nodes\Node.js:199:61)
    at completeSend (c:\ProgramData\npmglobal\node_modules\node-red\node_modules\@node-red\nodes\core\logic\17-split.js:482:18)

So it is falling down at the join node due to the cloning of the http in message. A quick search in the forum reveals a couple of posts including "writeQueueSize" but not same use case and i didnt see a solution

I tried a few things including only passing the required res object ({res: msg.res}) to the join node (essentially kept the res and ditched the req object) - same error

Last gasp attempt I changed the join node setting "Combine each" from msg to msg.payload - it works.

Question: is it enough to combine the payloads from the KNX nodes or do you need the full msg returned to the http endpoint?

Hi Steve,

I had previously discounted combining each payload as I needed more of the message (such as the device ID and address etc) but your question got me to rethink this and instead I have used a function node to redefine msg.payload with all the required information. The join node node then creates an array for each payload as you suggest.

This method allows me to connect the HTTP in node to the join node (because it seems to miraculously work when combing payloads!) and ensure that the joined message isn't released until all the readings are back. This is way better than using memory and timers to divorce the HTTP in and change nodes.

With hindsight, this should have been an option earlier as I always needed to parse the message, however I'd planned to do it after the join so was fixated on trying to join the entire message, rather than just a part.

The only downside is that I get an empty object at the beginning of the array from the HTTP in node because it doesn't have a msg.payload but I can live with that!

Thanks for devising this work-around with me.

Take care and stay safe.

Cheers,
Ben

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