当前位置:网站首页>DGIOT device configuration synchronously sends control commands
DGIOT device configuration synchronously sends control commands
2022-08-07 05:20:00 【DGIOT platform】

[小 迪 导读]:In the process of control equipment,经常会碰到下面这些问题:
| The old plan | dgiot基于dlinkProtocol configuration synchronization scheme |
|---|---|
| Platform according to actual condition control switch machine | Platform of remote control equipment state of synchronous switch machine |
Old scheme faults:
- When the platform control instruction without hair down,Platform need to click send control instructions again,The waste of human
dgiotConfiguration synchronization scheme advantages:
- 设备上电,Device status solely by platform administrator control is control values,例如:Platform for shutdown,Field devices even boot platform will automatically be issued shutdown instructions,Turn off the equipment again.
整体交互图

Implementation steps
1.On the platform to create product,如下图为例.

2.In the product details of model created in the equipment to upload"key":"value"The corresponding physical model,如下图为例.

3.Low code is added in the visualization of the product details,如下图为例.

4.Click on the design editor low code,To edit into products low code to add platformkeyAnd upload equipmentkey进行关联,如下图.

Low product code examples,以实际产品为准:
{
"type": "form",
"api": {
"url": "iotapi/classes/Device/parse_objectid",
"method": "put",
"headers": {
"store": "localStorage",
"dgiotReplace": "parse_objectid"
},
"dataType": "json",
"requestAdaptor": "return {\r\n \"status\":0,\r\n \"msg\":\"\",\r\n \"data\":response\r\n }"
},
"body": [
{
"id": "u:52fbc3355570",
"mode": "inline",
"name": "Ctrl",
"type": "switch",
"label": "开关机",
"onText": "开",
"option": "",
"offText": "关",
"trueValue": 1,
"falseValue": 0,
"validateApi": {
"url": "iotapi/amis/Product/b5f75b59a3",
"method": "put",
"requestAdaptor": "return {\r\n ...api,\r\n data:{\r\n profile:{\r\n Ctrl:api.data.Ctrl \r\n }\r\n }\r\n}"
},
"submitOnChange": true
}
],
"title": "Switch machine controller",
"trueValue": true,
"falseValue": false,
"submitText": "",
"optionAtLeft": false
}5.Find you just created in the visualization of the product details of low code,点击预览,Click add switch machine platformkey,如下图.

6.In the product details found in the physical model of newly created object model,点击编辑,关联平台key与设备key,如下图.

7.Find you just created in the visualization of the product details of low code,点击设计,Modified to equipment low code,如下图.

Equipment low code sample:
{
"type": "form",
"api": {
"url": "iotapi/classes/Device/parse_objectid",
"method": "put",
"headers": {
"store": "localStorage",
"dgiotReplace": "parse_objectid"
},
"dataType": "json",
"requestAdaptor": "return {\r\n \"status\":0,\r\n \"msg\":\"\",\r\n \"data\":response\r\n }"
},
"body": [
{
"id": "u:52fbc3355570",
"mode": "inline",
"name": "Ctrl",
"type": "switch",
"label": "开关机",
"onText": "开",
"option": "",
"offText": "关",
"trueValue": 1,
"falseValue": 0,
"validateApi": {
"url": "iotapi/amis/Device/parse_objectid",
"method": "put",
"headers": {
"store": "localStorage",
"dgiotReplace": "parse_objectid"
},
"requestAdaptor": "return {\r\n ...api,\r\n data:{\r\n profile:{\r\n Ctrl:api.data.Ctrl \r\n }\r\n }\r\n}"
},
"submitOnChange": true
}
],
"title": "Switch machine controller",
"trueValue": true,
"falseValue": false,
"submitText": "",
"optionAtLeft": false
}8.设备模拟登录,方式一:MQTTX登录;方式二:ip:18083登录,用户名:admin,密码:public
方式一:MQTTX登录

方式二:ip:18083登录,用户名:admin,密码:public

The user name and password access,如下图:

9.Equipment data simulation report,方式一:MQTTX上报;方式二:ip:18083上报
dgiot上报数据Topic
$dg/thing/{ProductId}/{DeviceAddr}/properties/report
dgiot下发控制命令Topic
$dg/device/{ProductId}/{DeviceAddr}/profileCan the device details to view the correspondingTopic,如下图:

方式一:MQTTX上报

上报数据

Subscribe to the control instruction

方式二:ip:18083上报

上报数据

Subscribe to the control instruction

10.Equipment configuration synchronization to realize,以ip:18083为例
Platform is set to boot,如下图

ip:18083Simulation report status value as0(The state of the shutdown),Platform automatically issued boot command,如下图

Platform is set to off,如下图

ip:18083Simulation report status value as1(The state of the boot),Platform automatically issued the shutdown command,如下图

[小 迪 点评]
- dgiotDistributed platform configuration synchronization control instruction.
- 在成本方面dgiotIn order to reduce the user cost,降低运维成本.
边栏推荐
猜你喜欢
随机推荐
跨境电商如何通过打好数据底座,实现低成本稳步增长
国际权威认可!OceanBase入选Forrester Translytical数据平台报告
谭浩强第五版第三章课后习题
SIP12 脚 电磁隔离放大器0-75mV/0-2.5V/0-5V/0-10V转0-1mA/0-10mA/0-20mA/ 4-20mA信号转换器IC
DGIoT网页代理
Redis 常用数据类型之list(字符串列表)
1.SDRAM简介
转速信号变送模块 频率转电压电流信号变换器
四路DI四路继电器输出,RS-485/232数据采集远程I/O模块
对话ACE第四期:分布式数据库未来发展的挑战和机遇
无聊的冷知识4
Redis 三个特殊数据类型之Geospatail、Hyperloglog、bitMaps
向量化引擎对HTAP的价值与技术思考
无聊的冷知识5
Paper Time 回顾|MB2:为自治数据库建立行为模型
2021-01-18
「SwiftUI」TabView中添加NavigationBarItems
2022/5/8 SSM框架整合增删改查(模糊查询+分页)(详细案例)
phpoffice/phpspreadsheet的使用(export篇)
uniapp的map地图组件介绍









