海外协议
设备型号转换
部分型号在中台和EIOT平台显示的名称不同,对应关系如下
设备上传型号 | 平台录入型号 |
---|
ADF300LD | ADF300L-DY |
ADF300LS | ADF300L-SY |
ADF400LD | ADF400L-DY |
ADF400LS | ADF400L-SY |
DTSY1352 | DTSY |
DDSY1352 | DDSY |
ADL100-EY | ADL100 |
ADL300-EY | ADL300 |
DTSD1352 | DTSD |
DDSD1352 | DDSD |
海外的ADL100、ADL300其实就是国内的DDSY、DTSY
Topic
Topic基本格式为: /{数据发送方}/{厂家及应用名称}/{产品标识}/{命令字}/{sn}
第一级:数据发送方,server-服务器、gw-网关
第二级:厂家及应用名称 acrelHW-海外专用主题(用于区分后续公司物联网平台)
第三级:product-产品标识
第四级:命令字,区分数据类型
第五级:SN-唯一序列号;若是网关带仪表方案,则为网关序列号;若仪表直传方案,则为仪表序列号
协议
固定属性说明
参数 | 说明 |
---|
type | 数据信息类型 |
res | 回复结果: 1-成功 0-失败 |
gwSN | 网关识别号 |
meterSN | 仪表序列号 |
time | 实时时间 |
登录
设备连上服务器后,立即发一包登录帧,以表示设备上线
1.设备使用Topic /gw/acrelHW/{product}/login/{sn}
发出登录消息,消息格式如下:
{
"ver": 1011,
"rssi": 48,
"code": 1968,
"ccid": " ",
"imei": " ",
"verpro": 0,
"time": "20221008105559",
"gwSN": "12209263660002",
"type": "login",
"iapVer": 0
}
属性说明
参数 | 说明 |
---|
code | 程序编号 |
ver | 设备版本号 |
iapVer | bootload版本号 |
ccid | SIM卡号 |
rssi | 信号强度 (百分比%) |
imei | IMEI号 |
2.服务端使用Topic /server/acrelHW/{product}/login/{sn}
进行响应,消息格式如下:
{"type":"login","res":1}
对时
收到login回复5-10秒后设备会请求一次对时命令,随后会以24h为周期对时一次
1.设备使用Topic /gw/acrelHW/{product}/time/{sn}
发出消息,消息格式如下:
{
"country": "China",
"utc": "8",
"time": "20221008105600",
"gwSN": "12209263660002",
"type": "time",
"timezone": "8",
"timezoneMin": "30"
}
属性说明
参数 | 说明 |
---|
time | 设备时间 |
utc | 设备时区:-12 至 14 |
country | 地区、国家(已废弃) |
timezone | 设备所在时区的小时偏移量,字符串,范围"-12"~"14" |
timezoneMin | 设备所在时区的分钟偏移量,字符串,范围"00"、30、"45" |
2.服务端使用Topic /server/acrelHW/{product}/time/{sn}
进行响应,消息格式如下:
{
"type": "time",
"res": 1,
"time": "20221008105605",
"country": "unknown",
"utc": 8.0,
"timezone": "8",
"timezoneMin": "00"
}
属性说明
参数 | 说明 |
---|
time | 服务器时间 |
utc | 服务器时区:-12 至 12 |
country | 地区、国家(已废弃) |
timezone | 设备所在时区的小时偏移量,字符串,范围"-12"~"14" |
timezoneMin | 设备所在时区的分钟偏移量,字符串,范围"00"、30、"45" |
参数上传
刚连接后会进行发送,上传现场仪表
1.设备使用Topic /gw/acrelHW/{product}/para/{sn}
发出消息,消息格式如下:
{
"meterName": "ADW300",
"meterSN": "12209072890013",
"num": "1",
"gwSN": "12209263660002",
"time": "20221010114719",
"upInterval": "5",
"type": "para"
}
属性说明
参数 | 说明 |
---|
meterName | 仪表名称 |
num | 序号 |
upInterval | 上报间隔 |
2.服务端使用Topic /server/acrelHW/{product}/para/{sn}
进行响应,消息格式如下:
{"type":"para","res":1 }
心跳
根据设定的心跳间隔时间上传
1.设备使用Topic /gw/acrelHW/{product}/heart/{sn}
发出消息,消息格式如下:
{
"gwSN": "12209263660002",
"time": "20221008121010",
"type": "heart"
}
2.服务端无需回复
实时数据上传
根据设定的数据上报间隔时间主动上传
1.设备使用Topic /gw/acrelHW/{product}/data/{sn}
发出消息,消息格式如下:
{
"type": "data",
"meterSN": "12005141150753",
"meterName": "DTSD1352",
"ch": 0,
"meterStatus": "normal",
"time": "20221008121000",
"datatime": "20221008121000",
"gwSN": "12209263660002",
"fragNo": 1,
"fragment": 5,
"Ua": 220.5
}
属性说明
参数 | 说明 |
---|
meterName | 仪表名称 |
meterStatus | 设备状态: normal-正常 missing-失联 |
ch | 非必传,回路号 |
datatime | 非必传,分包参数,数据采集时间 |
fragNo | 非必传,分包参数,分包上传的包序号,从1 开始编号,多包数据的datatime必须保持一致。 |
fragment | 非必传,分包参数,分包上传的总包数,多包数据的datatime必须保持一致。 |
Ua... | 电参量,详见命名与结构规范 |
2.服务端使用Topic /server/acrelHW/{product}/data/{sn}
进行响应,消息格式如下:
{"type":"data","res":1 }
历史数据上传
登录成功后,按照顺序的方式发送设备的历史数据,然后再发实时数据
1.设备使用Topic /gw/acrelHW/{product}/data/{sn}
发出消息,消息格式如下:
{
"type": "hstdata",
"meterSN": "12005141150753",
"meterName": "DTSD1352",
"ch": 0,
"meterStatus": "missing",
"time": "20221008121000",
"datatime": "20221008121000",
"gwSN": "12209263660002",
"fragNo": 1,
"fragment": 5,
"Ua": 220.5
}
2.服务端使用Topic /server/acrelHW/{product}/data/{sn}
进行响应,消息格式如下:
{"type":"hstdata","res":1 }
固件升级
服务端下发网关升级固件版本指令
1.服务端使用Topic /server/acrelHW/{product}/ota/{sn}
发出消息,消息格式如下:
{
"type": "ota",
"time": "20200709130030",
"gwSN": "12209263660002",
"url": "http://safe.acrelcloud.cn/webinfo/file/1844_APP_1009.bin",
"fwsize": 98520
}
属性说明
参数 | 说明 |
---|
url | 固件地址 |
fwsize | 文件字节数,单位byte |
2.设备使用Topic /gw/acrelHW/{product}/ota/{sn}
进行响应,消息格式如下:
{"type":"ota","time":"20200709130030","res":1}
重启
服务端下发重启指令
1.服务端使用Topic /server/acrelHW/{product}/restart/{sn}
发出消息,消息格式如下:
{
"type": "restart",
"time": "20200709130030",
"gwSN": "02121090700028",
"restartDelay": "0"
}
属性说明
参数 | 说明 |
---|
restartDelay | 重启延时时间:0-60,单位分钟 |
2.设备使用Topic /gw/acrelHW/{product}/restart/{sn}
进行响应,消息格式如下:
{"type":"restart","time":"20200709130030","gwSN":"01234567890123","res":1}
刷新
服务端下发刷新指令
1.服务端使用Topic /server/acrelHW/{product}/data/{sn}
发出消息,消息格式如下:
刷新全部设备数据
{"type":"data","res":2}
刷新单个设备数据
{"type":"data","res":3,"meterSN":"01234567890123","ch":1}
属性说明
2.设备使用Topic /gw/acrelHW/{product}/data/{sn}
进行响应,消息格式如下:
{
"type": "data",
"meterSN": "12005141150753",
"meterName": "DTSD1352",
"ch": 0,
"meterStatus": "missing",
"time": "20221008121000",
"datatime": "20221008121000",
"gwSN": "12209263660002",
"fragNo": 1,
"fragment": 5,
"Ua": 220.5
}
分合闸
服务端下发分合闸指令
1.服务端使用Topic /server/acrelHW/{product}/control/{sn}
发出消息,消息格式如下:
{
"type": "control",
"time": "20200709130030",
"gwSN": "12209263660002",
"meterSN": "12005141150753",
"meterCH": 0,
"DO1": 0
}
属性说明
2.设备使用Topic /gw/acrelHW/{product}/control/{sn}
进行响应,消息格式如下:
{"type":"control","time":"20200709130030","gwSN":"01234567890123","res":1}
请求版本号
网关上电或重启后主动请求版本号,平台回复网关配置版本号和下行配置版本号。修改配置后版本号递增,版本号越大,配置越新。
1.设备使用Topic /gw/acrelHW/{product}/allVersion/{sn}
发出消息,消息格式如下:
{"type":"allVersion","time":"20200709130030","gwSN":"01234567890123"}
2.服务端使用Topic /server/acrelHW/{product}/allVersion/{sn}
进行响应,消息格式如下:
{"type":"allVersion","time":"20200709130030","gwSN":"01234567890123","gwConfigVer":"1001","downlinkConfigVer":"2001","alarmConfigVer":"3001"}
属性说明
参数 | 说明 |
---|
gwConfigVer | 网关配置版本 |
downlinkConfigVer | 下行配置版本 |
alarmConfigVer | 报警配置版本 |
网关配置信息
网关从平台获取最新版本的网关配置信息
1.设备使用Topic /gw/acrelHW/{product}/gwConfigInfo/{sn}
发出消息,消息格式如下:
{"type":"gwConfigInfo","time":"20200709130030","gwSN":"01234567890123","act":"down","gwConfigVer":"1001"}
2.服务端使用Topic /server/acrelHW/{product}/gwConfigInfo/{sn}
进行响应,消息格式如下:
{"type":"gwConfigInfo","time":"20200709130030","gwSN":"01234567890123","gwName":"awt100","ipAdd1":"www.acrel.com","port1":1883,"apn":"xxx","apnUser":"xxx","apnPass":"xxx","mqttQos":0,"mqttHeart":2,"upInterval":5}
属性说明
参数 | 说明 |
---|
act | 操作类型: down-网关从平台获取配置信息 up-网关向平台发送配置信息 |
网关向平台发送最新版本的网关配置信息
1.设备使用Topic /gw/acrelHW/{product}/gwConfigInfo/{sn}
发出消息,消息格式如下:
{"type":"gwConfigInfo","time":"20200709130030","gwSN":"01234567890123","gwName":"awt100","act":"up","gwConfigVer":"1001","ipAdd1":"www.acrel.com","port1":1883,"apn":"xxx","apnUser":"xxx","apnPass":"xxx","mqttQos":0,"mqttHeart":2,"upInterval":5}
2.服务端使用Topic /server/acrelHW/{product}/gwConfigInfo/{sn}
进行响应,消息格式如下:
{"type":"gwConfigInfo","time":"20200709130030","gwSN":"01234567890123","res":1}
下行配置参数
网关从平台获取最新版本的下行配置信息
1.设备使用Topic /gw/acrelHW/{product}/downlinkConfigInfo/{sn}
发出消息,消息格式如下:
{"type":"downlinkConfigInfo","time":"20200709130030","gwSN":"01234567890123","act":"down","downlinkConfigVer":"2001"}
2.服务端使用Topic /server/acrelHW/{product}/downlinkConfigInfo/{sn}
进行响应,消息格式如下:
{"type":"downlinkConfigInfo","time":"20200709130030","gwSN":"01234567890123","downlinkInfo":"xxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyy……zzzzzzzzzzzzzzzzzzzz"}
属性说明
参数 | 说明 |
---|
downlinkInfo | xxx…./yyy…/zzz…:包含30个下行设备的参数信息, 每个设备占20个字节:s1……s14 p1 p2 p3 p4 p5 p6 (s1…s14-14位序列号或表地址,ascii码;p1..p6参数1-6,ascii码)。 p1p2: 预留(固定0) p3p4:回路数 P5-p6:预留(固定0) |
网关向平台发送最新版本的网关配置信息
1.设备使用Topic /gw/acrelHW/{product}/downlinkConfigInfo/{sn}
发出消息,消息格式如下:
{"type":"downlinkConfigInfo","time":"20200709130030","gwSN":"01234567890123","act":"up","downlinkConfigVer":"2001","downlinkInfo":"xxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyy……zzzzzzzzzzzzzzzzzzzz"}
2.服务端使用Topic /server/acrelHW/{product}/downlinkConfigInfo/{sn}
进行响应,消息格式如下:
{"type":"downlinkConfigInfo","time":"20200709130030","gwSN":"01234567890123","res":1}
透传
服务端下发透传数据给网关,网关将透传内容通过485发给下行设备。网关收到回复后,将下行设备的回复内容发送给平台
1.服务端使用Topic /server/acrelHW/{product}/control/{sn}
发出消息,消息格式如下:
{
"type": "transport",
"time": "20200709130030",
"gwSN": "12209263660002",
"meterSN": "12005141150753",
"meterCH": 0,
"act": "down",
"translen": 12,
"transdata": "010310000002"
}
属性说明
参数 | 说明 |
---|
meterCH | 回路号 |
act | 透传方向 down-平台下发到网关 up-网关回复平台 |
translen | 透传数据字节长度 |
transdata | 透传数据,ascii码格式 |
2.设备使用Topic /gw/acrelHW/{product}/control/{sn}
进行响应,消息格式如下:
{
"type": "transport",
"time": "20200709130030",
"gwSN": "01234567890123",
"meterSN": "12005141150753",
"meterCH": 0,
"act": "up",
"translen": 12,
"transdata": "010310000002"
}
命令
1.服务端使用Topic /server/acrelHW/{product}/instruct/{sn}
发出消息,消息格式如下:
{"type":"instruct","time":"20200709130030","gwSN":"01234567890123","xxxx":1}
属性说明
功能 | 说明 | 参数 |
---|
下行重新扫描 | Scan | 1 |
协议全功能开关 | Allpara | 0-关闭 1-开启 |
2.设备使用Topic /gw/acrelHW/{product}/instruct/{sn}
进行响应,消息格式如下:
{"type":"Instruct","time":"20200709130030","gwSN":"01234567890123","res":1}
模板配置
1.设备使用Topic /gw/acrelHW/{product}/metermodel/{sn}
发出消息,消息格式如下:
{"type":"metermodel","time":"20200709130030","gwSN":"01234567890123","SerialNumber":1,"url":"xxxxxx","fwsize":1024}
2.服务端使用Topic /server/acrelHW/{product}/metermodel/{sn}
进行响应,消息格式如下:
{"type":"metermodel","time":"20200709130030","gwSN":"01234567890123","res":1}
属性说明
参数 | 说明 |
---|
SerialNumber | 远程配置的模板序号(取值1~4) |
url | 获取文件的地址 |
fwsize | 文件大小 |
拓扑配置
1.设备使用Topic /gw/acrelHW/{product}/metertopology/{sn}
发出消息,消息格式如下:
{"type":"metertopology","time":"20200709130030","gwSN":"01234567890123","url":"xxxxxx","fwsize":1024}
2.服务端使用Topic /server/acrelHW/{product}/metertopology/{sn}
进行响应,消息格式如下:
{"type":"metertopology","time":"20200709130030","gwSN":"01234567890123","res":1}
模板信息召回
1.服务端使用Topic /server/acrelHW/{product}/callmodel/{sn}
发出消息,消息格式如下:
{"type":"callmodel","time":"20200709130030","gwSN":"00000000000000","Number":1}
2.设备使用Topic /gw/acrelHW/{product}/metertopology/{sn}
进行响应,消息格式如下:
{"type":"callmodel","time":"20221121130725","gwSN":"test2022092901","Name":"111","Offest":"0x0000","Type":"serial","Para":"ua,0x0200,uint0.01;ub,0x022e,uint0.01;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;,0x0000,null;"}
属性说明
参数 | 说明 |
---|
Number | 模板序号(取值1~4) |
Name | 模板名称 |
Offest | 回路偏移量 |
Type | 抄表方式,serial序列号,address地址 |
Para | 电参量格式为(名称),(寄存器地址),(数据类型); |
状态上报
1.设备使用Topic /gw/acrelHW/{product}/event/{sn}
发出消息,消息格式如下:
1.启停事件
判断依据:|P|>阈值时,设备运行,累计运行时长;反之设备待机。
被监测设备上传启动事件
{
"type": "event",
"time": "20200709130030",
"gwSN": "01234567890123",
"meterSN": "01234567890123",
"ch": 1,
"RUN_START": {
"starttime": "16575241290",
"startEPI": "45.600",
"startSwOnTime": "50"
}
}
被监测设备上传停止事件。设备的停止事件必须与启动事件成对上报
{
"type": "event",
"time": "20200709130030",
"gwSN": "01234567890123",
"meterSN": "01234567890123",
"ch": 1,
"RUN_STOP": {
"starttime": "16575241290",
"startEPI": "45.600",
"startSwOnTime": "50",
"stoptime": "1675241365",
"stopEPI": "48.00",
"stopSwOnTime": "150"
}
}
2.断电报警
{
"type": "event",
"time": "20200709130030",
"gwSN": "01234567890123",
"meterSN": "01234567890123",
"ch": 1,
"GW_PWROFF": {
"timestamp": 1638869890,
"detail": ""
}
}
2.服务端使用Topic /gw/acrelHW/{product}/event/{sn}
进行响应,消息格式如下:
{"type":"event","res":1}
属性说明
参数 | 说明 |
---|
starttime | 上电时间,为utc时间 |
startEPI | 上电时刻电能 |
| 被监测设备启动时的累计运行时长,单位:秒 |
stoptime | 停电时间,为utc时间 |
stopEPI | 停电时刻电能 |
| 被监测设备停止时的累计运行时长,单位:秒 |
timestamp | 断电报警时间 |
detail | 附带细节描述,没有可省略 |
24 五月 2024