# node-red-contrib-dfiothub **Repository Path**: dfskgh/node-red-contrib-dfiothub ## Basic Information - **Project Name**: node-red-contrib-dfiothub - **Description**: 东方数科开发的 Node-RED 物联网设备接入节点,支持多协议设备接入与数据标准化。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 0 - **Created**: 2025-12-11 - **Last Updated**: 2025-12-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # node-red-contrib-dfiothub > 东方数科开发的 Node-RED 物联网设备接入节点,支持多协议设备接入与数据标准化。 ## 功能概述 DFIoTHub 是专为物联网场景设计的 Node-RED 节点包,提供以下核心功能: - **多协议支持**:同时兼容 MQTT、HTTP、CoAP 常见物联网协议 - **数据标准化**:将不同设备数据转换为统一 JSON 格式 - **设备管理**:支持设备状态监控与连接管理 - **安全认证**:提供 TLS/SSL 加密支持和设备级密钥认证 ## 安装方法 ### 前提条件 - Node.js 版本 14.0 或更高版本 - Node-RED 版本 1.0 或更高版本 ### 安装步骤 bash 通过 npm 安装 npm install node-red-contrib-dfiothub 或从源码安装 git clone https://github.com/东方数科/node-red-contrib-dfiothub.git cd node-red-contrib-dfiothub npm install npm link cd ~/.node-red npm link node-red-contrib-dfiothub ## 配置说明 ### 设备配置节点 首先需要添加设备配置节点,设置连接参数: 1. 在 Node-RED 编辑器中拖动 `dfiothub-device` 节点到工作区 2. 双击节点打开配置面板 3. 填写设备连接信息(协议类型、地址、端口等) 4. 设置认证参数(用户名、密码或证书) ### 数据格式 设备数据输入格式 json { "deviceId": "device_001", "timestamp": 1672531200000, "sensors": { "temperature": 25.6, "humidity": 60.2 } } ## 使用示例 ### 基础设备数据流 json [ { "id": "device-input", "type": "dfiothub-device", "name": "温度传感器", "protocol": "mqtt", "topic": "sensors/temperature", "wires": [["data-processor"]] }, { "id": "data-processor", "type": "function", "name": "数据处理", "wires": [["debug-output"]] } ] ## API 参考 ### 输入属性 - `msg.payload`:设备原始数据 - `msg.topic`:设备主题/地址 - `msg.deviceInfo`:设备元信息 ### 输出属性 - `msg.standardizedData`:标准化后的设备数据 - `msg.deviceStatus`:设备连接状态 ## 故障排除 ### 常见问题 1. **设备连接失败**:检查网络连接和认证信息 2. **数据格式错误**:验证数据是否符合 JSON 格式要求 3. **节点加载失败**:确认 Node-RED 版本兼容性 ### 日志调试 启用详细日志记录: javascript // 在 settings.js 中添加 logging: { console: { level: "debug" } } ## 技术支持 - 项目主页:[东方数科物联网平台](https://iot.east-digital.com) - 问题反馈:[GitHub Issues](https://github.com/东方数科/node-red-contrib-dfiothub/issues) - 技术文档:[详细开发文档](https://docs.east-digital.com) ## 许可证 Apache-2.0 License © 2025 东方数科