Closed bartbutenaers closed 1 year ago
Hi @bartbutenaers How did you create this flows.json? If by the plugin, then it's - most probably - a plugin issue ...
So I did an extra test: when I create a new config node via my wt32-eth01 flow, then the json of that new config node is correctly added to my flow.json file. And then I see the messages arriving smoothly in my MQTT broker!
That's the result I get here as well trying to simulate your issue. There needs to be something different in the config you have.
Could you please post the flow definition as NR exports it: Menu -> Export -> Current flow -> JSON -> Copy to Clipboard. This flow definition should hold the data for the config node...
Never mind. I think I've found the cause for this issue: The plugin assumes config nodes ids have a length of 16. These old styles are of length 14. A fix is committed to the repo of the plugin.
Thanks, @ralphwetzel. It didn't understand why the broker node was missing from the exported flow.
BTW. There is one difference with a 'normal' MQTT-Out node: the status is not "connected", as soon as it is connected to the mqtt broker. Not sure if you can do anything about that...
@bartbutenaers – I'd be happy to take a look at this one. But, I'm not 100% sure I follow and it is kind of a separate issue. The MQTT broker does try to propagate status information to connected MQTT-In and MQTT-Out nodes. But, it is very possible that behavior isn't a perfect match with Node-RED (or there is a bug). Would you mind opening a separate issue with additional detail so that I can understand the difference you are seeing?
@ralphwetzel: you nailed it! I can confirm that it now works, which is nice because now I can easily reuse my existing config nodes. Very useful fix. Thanks a lot!!
@phoddie: I created the issue in your repo, because I thought the flow was generated by your code... Yes you are are right that it is a completely separate issue, so I will create one.
I created the issue in your repo, because I thought the flow was generated by your code....
No problem at all. The source of the problem is not always obvious.
...it is a completely separate issue, so I will create one.
Thank you.
Hi @phoddie,
I'm afraid I need your assistance again.
I had added an MQTT-Out node to my flow, but after deploying I saw this error in the xterm terminal of Ralph's sidebar:
Since it has an "undefined" at nodered.js at line 1247, I assume the #broker is undefined:
Which means (line 1243) it cannot find my config node, although it is available in my flow editor. This is how my simple flow looks like:
Got a good tip from @ralphwetzel, to look in the working directory. This is the flows.json file I found there:
As you can see, the json of the config node itself (node id "ed237c6b.40d1b") is NOT concluded in this flows.json file.
I had created this flow from scratch, to be used with node-red-mcu. Except from the config node which already existed from quite some time. As you can see at the "." in the middle of the broker config node id, which was the old way of creating node id's in Node-RED.
So I did an extra test: when I create a new config node via my wt32-eth01 flow, then the json of that new config node is correctly added to my flow.json file. And then I see the messages arriving smoothly in my MQTT broker!
So it would be nice if you could have a look if you could have a look why existing config nodes are not exported to the flows.json file in the working directory.
BTW. There is one difference with a 'normal' MQTT-Out node: the status is not "connected", as soon as it is connected to the mqtt broker. Not sure if you can do anything about that...
Thanks !!!
Bart