Example of usage of UDP

Take NBSN95 mod1 as an example

After logging into the interface click '+' to create a flow

image-20220519133634-1.png

Rename the stream

image-20220519134042-2.png

image-20220519134318-3.png

image-20220519134346-4.png

Drag UDP into the editing area

image-20220519134533-5.png

The same method as above, drag and drop functions and debug into the editing area

image-20220519134850-6.png

configure UDP in

image-20220519135402-7.png

Write to the UDP port that the device node sends to the server

Example My UDP device node sends to server port 8585
just write 8585

Note that the port that is already in use cannot be used. If the receiving fails, you need to check whether the port of the server is occupied. The sending port of the device node should not use the default port used by the server, such as a common port such as 8080.

In order to avoid data confusion, different types of nodes do not use the same UDP port, because different nodes have different data formats and different functions.

image-20220519135915-8.png

image-20220519144651-14.png

image-20220519141355-11.png

image-20220519141704-12.png

About function

If you are familiar with JS code, you can write it yourself
If you are not familiar, we have the JS code for each type of node, you just need to copy and paste it into it

image-20220519141833-13.png

image-20220519150455-15.png

If you need data visualization, please refer to the following

image-20220519152802-16.png

1. Click Install
2. Search the dashboard
3. Click Install

image-20220519152956-17.png

After the installation is successful, nodered will show the following node icon

image-20220519153335-19.png

Below I use the line chart as an example

Drag the line chart to the editing area

Just drag and drop as many as you need, or you can copy

The demo uses 3 kinds. Voltage, temperature, humidity

image-20220519154521-20.png

Double-click the function to set it

image-20220519154640-21.png

Adjusted to 3, because we need to display 3 charts

image-20220519154812-22.png

Below are the chart settings

Double-click while setting up the node as above

image-20220519160314-23.png

image-20220519160412-24.png

image-20220519160759-27.png

image-20220519161326-30.png

image-20220519161431-31.png

image-20220519161650-32.png

After the display interface is defined for the first time, subsequent charts can directly select the display interface

image-20220519162039-34.png

image-20220519162214-35.png

Connect graph nodes to functions with lines

Click to deploy

image-20220519162412-36.png

Enter the server public IP + port 1880/ui

example:http://xxx.xx.xx.xx:1880/ui

image-20220519163141-37.png

At this point, the basic demonstration of nodered is completed. If you need to beautify the chart and various visualizations, you can go to the official documentation of nodered for further understanding.

Tags:
    
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0