Better debugging

The current debugging capability of Node-Red leaves a lot to be desired. While there are plans to improve it, these will take some time to complete.

In the meantime, I've created an alternative that is fairly easy for anyone to implement and seems to work well. I'm now using it in my projects.

The approach is to create a subflow that outputs a msg to MQTT instead of debug. Then to create a flow that creates a debug web page that receives the MQTT debug messages. The page creates a section for each message TOPIC so it is important to set that correctly before sending the msg to the subflow. Then each topic shows a formatted display of the full msg object. The topic display is updated each time a message with the same topic is sent out. A timestamp is included to show when each topic was last updated.

As there is both a flow and a subflow & some example images, I've put the example on github.

https://github.com/TotallyInformation/node-red-example-debug

Although labelled an example, it is fully working and can be simply added to your own instance and should work straight away. Please leave any issues and comments in the github issues list.

Note the dependencies. The main dependency is an implementation of a MQTT broker with websockets support. You should be able to use Mosca but I've tested this with Mosquitto 1.4 compiled with websockets support.

{}
TotallyInformation

Flow Info

created 2 years, 4 months ago

Node Types

Tags

  • debug
  • mqtt
  • live-updates
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option