@4tunaio/4tuna-iot-node-red 中文文档教程
4TUNA IoT Node for Node-RED
4tuna-iot-node-red 节点 Node-RED。
Prerequisites
- Be a registered user in 4TUNA with IoT Admin permissions in your organization.
- Have a running installation of Node-RED on the IoT device.
- Python version 2.7 must be installed on the IoT device
Setting
在 4TUNA 中注册您的设备并生成您的证书。 以下文章提供了详细信息:crear-un-nuevo -dispositivo-iot-en-4tuna
登录到您的 Node-RED 服务器,并安装
@4tunaio/4tuna-iot-node-red
节点,为此请遵循中详述的过程文章的第 3 步 vincular-4tuna- con-un-dispositivo-iot-usando-node-red。您也可以从控制台在 Node-RED 主文件夹中运行
npm install @4tunaio/4tuna-iot-node-red
安装它。现在,您应该会在节点面板的 4tuna 类别下看到可用的
4tuna 事件
节点。 将它添加到您的流程中,然后双击它进行设置。首先,您需要指定要用于发送事件的设备。 您可以通过单击 Device 字段并选择
Add new 4tuna-device
添加新设备,然后按编辑按钮:配置设备填充字段如下:
- Device ID: the device id assigned in 4TUNA.
- Certificate: copy and paste the certificate text from 4TUNA.
私钥:从 4TUNA 复制并粘贴私钥文本。
- After pressing the done button, you can continue with the configuration of the parameter event you will be sending through this node:
- Name: write a custom name.
ID:从 4TUNA 复制并粘贴参数 ID。
Usage
该节点可用于两种类型的参数,模拟和事件。
模拟模式的步骤:
- Connect the variable you want to send to the
4tuna event
node input. - The node has 3 outputs that are activated according to the state of the parameter (normal, warning, danger). these outputs contain the value of the parameter and the condition in the state of danger and warning.
事件模式的步骤:
首先,需要按照以下文章中的步骤在 4tuna 中创建事件:configuracion-de-eventos
使用以下数据创建一个向量:[事件开始/结束、事件代码、动机代码]。
事件开始必须为 1,事件结束必须为 0。
事件代码和动机代码是字母数字字符串。
动机代码是可选的。
将数组连接到
4tuna event
节点输入。当输入事件开始时,每个事件都被计算在内。
该节点有 3 个输出,根据参数的动作(正常、警告、危险)激活。 这些输出包含触发动作的事件代码、动机代码和状态。
- Note: stop-type events will only be recorded with a duration of more than 1 minute
有关详细信息,请转到文章的第 4 步 vincular-4tuna-con-un-dispositivo-iot-usando-node-red。
你准备好了! 现在您可以登录 4TUNA 并在参数仪表板中可视化您的输入。
Test connection node (to physical device)
为此,有必要使用 4tuna-conn
节点,按照以下步骤进行配置:
- Add the
4tuna-conn
node.
- In the configuration tab, under 'Device Name' add a name for the physical equipment with which the connection is to be checked, under timeOut add the time with which the cyclic bit is to be tested, under device select the IoT device (only one 4tuna-device is allowed per
4tuna conn
).
- Next deploy and the node will check if the connection with the physical device is good, in case of error the output and node will be shown as follows.
Other options
离线:如果您希望在没有互联网连接时将信息保存在物联网设备中,请在 4tuna-event 节点的选项窗口中启用此字段。
debug to console:如果要在控制台中查看调试信息,请在调试窗口中启用此字段。
debug to bar:如果你想在用于此目的的 node-red 中查看调试信息,请在调试窗口中启用此字段。
如需更多帮助,请访问我们的帮助中心。
Copyright and License
版权所有 4TUNA, Inc.
根据 发布Apache-2.0 许可证。
4TUNA IoT Node for Node-RED
4tuna-iot-node-red node for Node-RED.
Prerequisites
- Be a registered user in 4TUNA with IoT Admin permissions in your organization.
- Have a running installation of Node-RED on the IoT device.
- Python version 2.7 must be installed on the IoT device
Setting
Register your device in 4TUNA and generate your certificates. the details are given in the following article: crear-un-nuevo-dispositivo-iot-en-4tuna
Login to your Node-RED server, and install the
@4tunaio/4tuna-iot-node-red
node, for this purpose follow the procedure detailed in the step 3 of the article vincular-4tuna-con-un-dispositivo-iot-usando-node-red.You may also install it from console running
npm install @4tunaio/4tuna-iot-node-red
at the Node-RED main folder.Now you should see the
4tuna event
node available under de 4tuna category on the nodes panel. Add it to your flow, and double clic on it to set it up.First you need to specify the device you want to use to send the event. You can add a new device by clicking on the Device field and selecting
Add new 4tuna-device
, then press on the edit button:Configure the device filling the fields as follows:
- Device ID: the device id assigned in 4TUNA.
- Certificate: copy and paste the certificate text from 4TUNA.
Private Key: copy and paste the private key text from 4TUNA.
- After pressing the done button, you can continue with the configuration of the parameter event you will be sending through this node:
- Name: write a custom name.
ID: copy and paste the Parameter ID from 4TUNA.
Usage
The node can be used for two types of parameters, analog and event.
Steps to analog mode:
- Connect the variable you want to send to the
4tuna event
node input. - The node has 3 outputs that are activated according to the state of the parameter (normal, warning, danger). these outputs contain the value of the parameter and the condition in the state of danger and warning.
Steps to event mode:
first, it is necessary to create the event in 4tuna following the steps found in the following article: configuracion-de-eventos
create a vector with the following data: [Event start/end, Event code, Motive code].
Event start must be 1, and Event end must be 0.
Event code and Motive code are alphanumeric strings.
Motive code is optional.
Connect the array to
4tuna event
node input.Each event is counted when Event Start is entered.
The node has 3 outputs that are activated according to the action of the parameter (normal, warning, danger). these outputs contain the event code which triggered the action, motive code and status.
- Note: stop-type events will only be recorded with a duration of more than 1 minute
For more information go to step 4 of the article vincular-4tuna-con-un-dispositivo-iot-usando-node-red.
You are ready to go! Now you can login to 4TUNA and visualize your inputs in the Parameters dashboard.
Test connection node (to physical device)
For this it is necessary to use the 4tuna-conn
node, follow the next steps for its configuration:
- Add the
4tuna-conn
node.
- In the configuration tab, under 'Device Name' add a name for the physical equipment with which the connection is to be checked, under timeOut add the time with which the cyclic bit is to be tested, under device select the IoT device (only one 4tuna-device is allowed per
4tuna conn
).
- Next deploy and the node will check if the connection with the physical device is good, in case of error the output and node will be shown as follows.
Other options
offline: Enable this field in the options window of the 4tuna-event node if you want the information to be saved in the iot device, when there is no internet connection.
debug to console: Enable this field in the debug window if you want to see the debug information in the console.
debug to bar: Enable this field in the debug window if you want to see the debug information in the node-red used for this purpose.
For additional help visit our Help Center.
Copyright and License
Copyright 4TUNA, Inc.
Released under the Apache-2.0 License.