Node-RED dashboard development has gained wide adoption amongst the IOT community owing to its simple visual programming model, allowing data flow to be wired together and configured graphically. This enables its users to connect sensors to backend databases, hook into social media, create HTML dashboards, all without writing a line of code. When the user wants to modify the data, then a ‘function node’ is available to add custom code (Source – IBM)
Node-RED dashboard best practices
- Avoid too many nodes in one flow. If the number of nodes is growing, try to create sub flows
Design reusable nodes/sub-flows
- Insert condiments inside function nodes to improve understanding
- In settings.js set flowFilePretty: true so that the flows are formatted on a line by line basis rather than all squashed up, this makes it easier to see what has changed.
- Maintain backup of flows. This can be done by dumping flows as JSON and storing in Git or any other Version Control Systems
- Log events to the console for a better understanding of the events that took place
- Disconnect/disable debug nodes once they’re done with
- While using web services, make sure to reuse existing nodes or the target server is capable of handling asynchronous requests
- Assign proper names to nodes in order to identify the source of output messages. Helps while debugging
- Try to make use of context variables for sharing data across flows
Our sensor & dashboard development services for the Node-RED dashboard, involving best practices for integrating smart devices on edge gateway for IOT in manufacturing, smart factories industrial monitoring, maintenance management, smart farming, indoor positioning, asset tracking, etc.
Read about Node-RED integrated testing