为编程爱好者分享易语言教程源码的资源网
好用的代理IP,游戏必备 ____广告位招租____ 服务器99/年 ____广告位招租____ ____广告位招租____ 挂机,建站服务器
好用的代理IP,游戏必备 ____广告位招租____ 服务器低至38/年 ____广告位招租____ ____广告位招租____ 挂机,建站服务器

网站首页 > 网络编程 正文

开源一个阿里边缘计算网关WebSocket协议dlt645智能电表驱动程序

三叶资源网 2022-09-25 20:18:50 网络编程 313 ℃ 0 评论

项目地址在github。本项目是阿里云物联网边缘计算网关驱动,用于中国电力标准DLT645智能电表. 目前驱动仅支持Aliyun 物联网平台,符合阿里云边缘网关WebSocket协议。 可以通过串口连接并采集多个Dlt电表数据(同一串口下,暂不支持多串口)并转换为阿里云边缘网关WebSocket协议。使用前应先连接好Dlt电表与串口。(本地 调试工具开发中)。

阿里云物联网平台操作指南

边缘计算网关详细的WebSocket协议见阿里云官网SDK linkedge-thing-access-websocket_client_sdk 。

目前仅支持 "onlineDevice","reportProperty" 和 "getProperty" 方法,更多方法待开发。

使用前需要在阿里云物联网平台新建产品和设备.新建产品参考模型见项目文件 model.json.

需要安装阿里云边缘计算网关程序, 并部署WebSocket驱动.驱动目前仅在Unbuntu 18.04 平台下测试.

使用指南

  1. 在config.json, 文件内设置串口及dlt电表对应参数. 如果网关环境为linux portName 部分只需要填写 ttyS1 或者ttyUSB1 ,驱动可以自动解析为 /dev/ttyS1, windows下直接写COM1,COM2 (未测试验证).
  2. 如果修改了阿里云边缘网关驱动默认参数 (ip地址或者端口), 在 server.json 文件修改相应内容。
  3. 如果要增加更多的Dlt645电表参数(协议支持的), 更新 model.json 文件,并且修改dltparser 参数以确保变量正确解析。目前还不支持块数据读写。
  4. 自动安装下载install.sh脚本并运行,或者复制文件内容到本地新建安装脚本。如果要全局安装node(不推荐),可以注释掉安装脚本里的nvm安装部分以全局安装node。注意,cnpm工具仅适用国内环境,中国区外可以注释掉cnpm安装脚本,直接用npm安装即可。

开发

使用Nodejs V8.16.2,项目主要依赖serialport和websocket包,依赖log4js包记录日志。开发部分依赖sinon,mocha,chai进行测试,依赖jsdoc生成文档。

欢迎Pull Request来修改和增加更多功能。

开发文档 包含了更多细节内容。

待办事项

  • 更多DLT645属性参数支持
  • 块读取功能支持
  • 写参数、修改变量功能支持
  • 阿里云边缘网关自动上报事件功能支持
  • 阿里云边缘网关服务功能支持
  • 虚拟串口测试程序
  • WebSocket协议测试程序
  • 本地Dlt驱动调试助手
  • 本地网页化服务界面用于驱动调试及监控


This is a dlt645 Chinese intelligent power meter driver for Aliyun Iot Edge Gateway driver using WebSocket protocal. The driver is currently works well on Aliyun Iot Platform, you need to setup Aliyun Enviroment, connect Dlt meter on the serialport of linkedge gateway before using it.


Operation Guide on Aliyun Iot Platform

See Aliyun linkedge-thing-access-websocket_client_sdk for the protocal details to connect device with Aliyun Linkedge Gateway.

Currently the Driver only support "onlineDevice","reportProperty" and "getProperty" methods, the rest methods are to be updated.

First of all,you need to create a DLT product and devices on aliyun Iot platform.See model.json for detailed product properties.

To use this driver you need to install an Aliyun Linkedge Gate way following Official Instruction, and deploy a WebSocket driver.Currently the driver is tested only under Unbuntu 18.04 platform.


To Use

  1. In config.json, setup the serialport information as well as the dlt meters. If you are using linux portName field just fill like ttyS1 or ttyUSB1 the driver will parse it to /dev/ttyS1, otherwise in windows just use COM1,COM2 (not testified).
  2. If you have changed default aliyun WebSocket server (ip address and port number), update server.json file. Currently TLS support is not available.
  3. If you want to support more DLT 645 properties, update the model.json file, please be sure to modify the propertyCode in dltparser too so as the driver can parse relative property properly.
  4. For aumomated installation download install.sh file first or copy the contents, run install.sh script to finish project installation, if you want to install node global, uncomment the global install file and comment nvminstallation file. If you are out of China, please comment the cnpm installation line and use npm directly.
  5. Use start.sh script for automated start.

To develop

Use Nodejs V8.16.2

Pull request is welcome to add more features.

See docs for development information.

Todo List

  • More Dlt645 properties support
  • Dlt645 Block property support
  • Write property and modify dlt parameter function support
  • Aliyun Linkedge setProperty,reportEvent function support
  • Aliyun Linkedge callService function support
  • Mock serialport function for test
  • Mock WebSocket server for test
  • Local Dlt 645 debugger
  • Local Web debug interface

来源:三叶资源网,欢迎分享,公众号:iisanye,(三叶资源网⑤群:21414575

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

百度站内搜索
关注微信公众号
三叶资源网⑤群:三叶资源网⑤群

网站分类
随机tag
酷Q智能机器人源码文本颜色Printable无限加好友post上传文件UDP源码简历下载PugiXml进度复制文件fiddlerRFID读卡器加载皮肤HTTP服务器RTF文本转图片答题小游戏源码网页代理硬笔劲舞团多关键词筛选局域网扫描器
最新评论