美文网首页
node-red 之 边缘计算网关(EG8000mini)电表

node-red 之 边缘计算网关(EG8000mini)电表

作者: wwmin_ | 来源:发表于2023-08-23 15:28 被阅读0次

1. 电表读取数据

电表读取数据

导出node-red节点

[
    {
        "id": "95dc0dd050ab3901",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "baadb31eff879fb1",
        "type": "inject",
        "z": "95dc0dd050ab3901",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 120,
        "y": 120,
        "wires": [
            [
                "ea4c7e63204009d0"
            ]
        ]
    },
    {
        "id": "799a16756d7dc6d8",
        "type": "debug",
        "z": "95dc0dd050ab3901",
        "name": "debug 13",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1160,
        "y": 400,
        "wires": []
    },
    {
        "id": "52c0fe628651a67b",
        "type": "serial port",
        "z": "95dc0dd050ab3901",
        "name": "",
        "serial": "87f78da6b6ce12e3",
        "x": 580,
        "y": 400,
        "wires": [
            [
                "d734a3d4055b7ca4"
            ]
        ]
    },
    {
        "id": "ea43aaa56da4c5fd",
        "type": "debug",
        "z": "95dc0dd050ab3901",
        "name": "调试 7",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 480,
        "y": 120,
        "wires": []
    },
    {
        "id": "d734a3d4055b7ca4",
        "type": "function",
        "z": "95dc0dd050ab3901",
        "name": "解析成json",
        "func": "var target = {\n    \"id\": \"1102363\",\n    \"com\": {\n        \"port\": \"1\",\n        \"baud\": \"2400\",\n        \"parity\": \"2\"\n    },\n    \"data\": {\n        \"type\": \"1\",\n        \"sch_no\": \"\",\n        \"frame\": \"01 06 00 00 00 00 89 CA\"\n    }\n}\nlet buffer = msg.payload;\nlet frame = JSON.parse(JSON.stringify(buffer)).data.map(p => p.toString(16).padStart(2,\"0\")).join(\" \");\ntarget.data.frame = frame;\nmsg.payload = target;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 790,
        "y": 400,
        "wires": [
            [
                "b65a484ed40e9aef"
            ]
        ]
    },
    {
        "id": "b65a484ed40e9aef",
        "type": "function",
        "z": "95dc0dd050ab3901",
        "name": "序列化成Buffer",
        "func": "msg.payload = Buffer.from(JSON.stringify(msg.payload));\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 980,
        "y": 400,
        "wires": [
            [
                "799a16756d7dc6d8",
                "0b58ebdacc5d2f31"
            ]
        ]
    },
    {
        "id": "2eef359efd2e5fbb",
        "type": "tcp in",
        "z": "95dc0dd050ab3901",
        "name": "TCP服务端9529",
        "server": "server",
        "host": "",
        "port": "9529",
        "datamode": "stream",
        "datatype": "buffer",
        "newline": "",
        "topic": "",
        "trim": false,
        "base64": false,
        "tls": "",
        "x": 120,
        "y": 520,
        "wires": [
            [
                "e815fcba1ef09e26",
                "a3c883d6c689f907",
                "d233df8f941cf211"
            ]
        ]
    },
    {
        "id": "0b58ebdacc5d2f31",
        "type": "tcp out",
        "z": "95dc0dd050ab3901",
        "name": "",
        "host": "",
        "port": "",
        "beserver": "reply",
        "base64": false,
        "end": false,
        "tls": "",
        "x": 1150,
        "y": 520,
        "wires": []
    },
    {
        "id": "e815fcba1ef09e26",
        "type": "function",
        "z": "95dc0dd050ab3901",
        "name": "仅回复心跳",
        "func": "var payload = msg.payload.toString(\"utf8\");\nif (payload.startsWith('3')) {\n    msg.payload = 1;\n    return msg;\n}",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 450,
        "y": 520,
        "wires": [
            [
                "0b58ebdacc5d2f31"
            ]
        ]
    },
    {
        "id": "a3c883d6c689f907",
        "type": "function",
        "z": "95dc0dd050ab3901",
        "name": "645数据序列化命令",
        "func": "var payload = msg.payload.toString(\"utf8\");\nif(payload.startsWith('3')){\n    return;\n}\nmsg.payload = Buffer.from(JSON.parse(payload).data.frame.trim().split(\" \").map(p=>parseInt(p,16)));\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 370,
        "y": 400,
        "wires": [
            [
                "52c0fe628651a67b"
            ]
        ]
    },
    {
        "id": "ea4c7e63204009d0",
        "type": "DLT645Read",
        "z": "95dc0dd050ab3901",
        "name": "",
        "serial": "4a19a59bebbc09ae",
        "columns": [
            {
                "Key": "ZDL",
                "Label": "总电量-1102363",
                "Address": "320302164358",
                "Tdata": "00000000"
            },
            {
                "Key": "L1-ZDL",
                "Label": "上1日总电量-1102363",
                "Address": "320302164358",
                "Tdata": "00000001"
            },
            {
                "Key": "L2-ZDL",
                "Label": "上2日总电量-1102363",
                "Address": "320302164358",
                "Tdata": "00000002"
            },
            {
                "Key": "L3-ZDL",
                "Label": "上3日总电流-1102363",
                "Address": "320302164358",
                "Tdata": "00000003"
            },
            {
                "Key": "A-V",
                "Label": "A相电压-1102363",
                "Address": "320302164358",
                "Tdata": "02010100"
            },
            {
                "Key": "A-I",
                "Label": "A相电流-1102363",
                "Address": "320302164358",
                "Tdata": "02020100"
            },
            {
                "Key": "YGGL",
                "Label": "有功功率-1102363",
                "Address": "320302164358",
                "Tdata": "02030000"
            },
            {
                "Key": "GLYS",
                "Label": "功率因数-1102363",
                "Address": "320302164358",
                "Tdata": "02060000"
            }
        ],
        "x": 300,
        "y": 120,
        "wires": [
            [
                "ea43aaa56da4c5fd"
            ]
        ]
    },
    {
        "id": "d233df8f941cf211",
        "type": "debug",
        "z": "95dc0dd050ab3901",
        "name": "TCP接收到的原始消息",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 360,
        "y": 620,
        "wires": []
    },
    {
        "id": "87f78da6b6ce12e3",
        "type": "serial config",
        "name": "串口收发",
        "serialport": "/dev/ttyS3",
        "baudrate": "9600",
        "databits": "8",
        "stopbits": "1",
        "parity": "none",
        "timeout": "50",
        "reqtimeout": "1000"
    },
    {
        "id": "4a19a59bebbc09ae",
        "type": "serial config",
        "name": "温控仪",
        "serialport": "/dev/ttyS2",
        "baudrate": "9600",
        "databits": "8",
        "stopbits": "1",
        "parity": "none",
        "timeout": "50",
        "reqtimeout": "5000"
    }
]

相关文章

  • 5g/4g边缘计算网关

    边缘计算网关好处边缘计算网关优势 计讯物联边缘计算网关和传统的集中化云计算系统不同,边缘计算强调的是节点。不仅在中...

  • 边缘计算网关是什么 边缘计算网关功能优势

    边缘计算,即在源头部署数据处理活动和操作,而不必经过集中式网段。通过使计算更接近产生数据的这些项目的网络边缘,此计...

  • 边缘计算网关功能

    什么是边缘计算: 边缘计算,是指在靠近物或数据源头的一侧,采用网络、计算、存储、应用核心能力为一体的开放平台,就近...

  • 什么是边缘计算网关?

    什么是边缘计算网关[http://www.hignton.com/products/HinetG111.html]...

  • 物联网简述

    工业智能网关也叫工业物联网关,是一款具备协议解析,数据边缘计算并标准化的物联网网关终端服务器,利用公用 3G/4G...

  • PLC设备远程调试系统基于工业边缘计算网关

    基于工业边缘计算网关的PLC设备远程调试系统 一、PLC设备远程调试系统背景 PLC作为目前信息采集、控制的主要技...

  • 工业 边缘计算网关是怎么工作的

    市面上的网关种类林林总总有几百种,工业自动化的人经常接触到。由于工业的设备种类繁多,厂家各不一致,所以在工业界长期...

  • 5G边缘计算网关的优势

    边缘计算,即在源头部署数据处理活动和操作,而不必经过集中式网段。通过使计算更接近产生数据的这些项目的网络边缘,此计...

  • 边缘计算网关助力建筑能耗监测系统

    一、项目背景   到2020年,我国建筑能耗占社会总能耗的比例将达到35%左右,超越工业用能,成为用能的第一领域,...

  • 工业协议网关

    工业协议网关是一种集合了通讯管理、数据接收、数据转发、串口接入、无线WiFi、协议转换、边缘计算等功能,支持使用移...

网友评论

      本文标题:node-red 之 边缘计算网关(EG8000mini)电表

      本文链接:https://www.haomeiwen.com/subject/ucvpmdtx.html