0
votes

I ma new to Node-red and still finding my way around it. I am using SmartMesh network motes that communicate with a manager connected to my laptop. How can I just display in the debug window the whole payload that is coming through in JSON format? Do I just use a debug node with msg.payload or I need to use a function node?

An help is very much appreciated!

1
When you say "in JSON format", are you really meaning that you want to inspect the raw JSON string? By default, the debug node shows JS objects/arrays in a expandable tree format, similar to the browser's dev console log. - SteveR

1 Answers

0
votes

Assuming the data you want is contained in the msg.payload field then a normal debug node should be fine.

If the data is else where in the msg object then you can change the debug node to show the whole message.

But be aware there is a limit to how much data will be shown in the debug sidebar in order to stop the debug node having too greater impact on performance. If the payload it too large it will be truncated. You can still see the whole output by changing the debug node to print to the console as well as the debug sidebar.

You can also change the limit (debugMaxLength) in the settings.js if you want to, but it is better to leave that value at it's default.