CWT JSON-MQTT Protocol
CWT JSON-MQTT Protocol
, LIMITED
TEL:+86-755-26719954 | www.comwintop.com
I. Overview
Choose Json MQTT mode to communication with server
Subscribe topic: client id:JSON
Publish topic: client id:CWTIO-SVR
Content Explanation
2 Digital input
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"CH":1 Index of channel, 0 represent Di1
"PID":"DI02" DI02 is flag of data type, represent single channel
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
"DI1":0 DI1 status (0: normal, 1: alarm)
Format:{"ID":"dyf00001","PID":"DI20","CH":4,"START":0,"TIME":"2021-07-02
14:58:35","DI0":0,"DI1":0,"DI2":0,"DI3":0}
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"PID":"DI20" DI20 is flag of data type, represent all channels
"CH":4 All 4 channels data
"START":0 Start from Di0
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
"DI0":0 DI0 status (0: normal, 1: alarm)
3 Analog input
Format:{"ID":"dyf00001","CH":0,"PID":"AD10","TIME":"2021-07-02
14:58:59","AIV0":0.000,"AIS0":2}
Content Explanation
Format:{"ID":"dyf00001","PID":"AD22","CH":5,"START":0,"TIME":"2021-07-02
14:58:38","AI0":{"S":2,"V":0.000},"AI1":{"S":2,"V":0.000},"AI2":{"S":2,"V":0.000},"AI3":{"S":2,"V":0.00
0},"AI4":{"S":0,"V":23.927}}
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"PID":"AD22" AD22 is flag of data type, represent all channels
"CH":5 All 5 channels data
"START":0 Start from Ai0
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
AI0: channel 0
"S":2 (status, 0: normal, 1: alarm, 2: disconnect, 3: output
"AI0":{"S":2,"V":0.000},
measure range)
"V":0.000 (value)
4 Digital output
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"CH":1 Index of channel, 0 represent DO1
"PID":"DO22" DO22 is flag of data type, represent single channel
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
"DO1":1 DO1 status (0: off, 1: on)
14:58:36","DO0":0,"DO1":0}
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"PID":"DO21" DO21 is flag of data type, represent all channels
"CH":2 All 2 channels data
"START":0 Start from DO0
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
"DI0":0 DO1 status (0: off, 1: on)
5 Modbus register
5.1 single channel (flag: RG80)
Format:{"ID":"dyf00001","CH":0,"PID":"RG80","TIME":"2021-07-02
14:58:59","RGV0":0.000,"RGS0":2}
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"CH":0 Index of channel, 0 represent AI0
"PID":"RG80" RG80 is flag of data type, represent single channel
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
"RGV0":0.000 Channel 0 value, RGV0 represent register 0
Channel 0 status (0: normal, 1: alarm, 2: disconnect, 3: output
"RGS0":2
measure range)
Format:{"ID":"dyf00001","PID":"RG81","CH":4,"START":0,"TIME":"2021-07-02
14:58:44","RG0":{"S":2,"V":0.000},"RG1":{"S":2,"V":0.000},"RG2":{"S":2,"V":0},"RG3":{"S":2,"V":0}}
Content Explanation
RG0: register 0
"S":2 (status, 0: normal, 1: alarm, 2: disconnect, 3: output
"RG0":{"S":2,"V":0.000}
measure range)
"V":0.000 (value)
6 Counter
6.1 All counter (CT32)
Format:{"ID":"dyf00001","PID":"CT32","CH":4,"START":0,"TIME":"2021-07-02
14:58:40","CT0":{"S":0,"V":35.600},"CT1":{"S":2,"V":0.000},"CT2":{"S":2,"V":0.000},"CT3":{"S":2,"V":0.
000}}
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"PID":"CT32" CT32 is flag of data type, represent all channels
"CH":4 All 4 channels data
"START":0 Start from Di0
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
CT0: channel 0
"CT0":{"S":0,"V":35.600} "S":0 (status, 0: normal, 1: alarm, 3: disconnect)
"V":35.6 (value)
14:58:59","CTV0":35.600,"CTT0":41,"CTS0":0}
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"CH":0 Index of channel, 0 represent channel 0
"PID":"CT48" CT48 is flag of data type, represent single
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
"CTV0":35.600 Channel 0 counting value
"CTT0":41 Channel counting time
Channel 0 status (0: normal, 1: alarm, 2: disconnect, 3: output
"CTS0":0
measure range)
Format:{"ID":"dyf00001","PID":"HT99","TIME":"2021-07-02 14:59:19","HT":""}
Content Explanation
Format:{"ID":"dyf00001","PID":"DC03","CH":1,"START":0,"TIME":"2021-07-02
14:58:42","Power":0}
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"PID":"DC03" DC03 is flag of data type, represent power supply
"CH":1 Fixed value
"START":0 Fixed value
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
"Power":0 Power supply status (0: external power, 1: interior battery)
Format:{"ID":"dyf00001","PID":"RS45","TIME":"2021-07-02
14:58:29","IMEI":"868142043541268","SIMID":"898600121755771","OPERATOR":"CHINA
MOBILE","PVer":"CwtIO 1.413","FVer":"1.56","HdVer":"1.1","DevTp":"STM32","LIVED":"1"}
Content Explanation
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"PID":"GM67" GM67 is flag of data type, represent power supply
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
"IMEI":"868142043541268" IMEI(International Mobile Equipment Identity)
"SIMID":"898600121755771" This code is read from simcard
"OPERATOR":"CHINA MOBILE" Mobile operator
"GPRSIP":"10.89.58.235" GPRS IP address
Format:{"ID":"dyf00001","PID":"LB66","TIME":"2021-07-02
14:58:23","MCC":"460","MNC":"0","LAC":"0219","CID":"0093BA41"}
Content Explanation
"ID":"dyf00001" Client ID (set in device)
"PID":"LB66" LB66 is flag of data type, represent LBS info
"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS
"MCC":"460" Mobile Country Code
"MNC":"0" Mobile Network Code
"LAC":"0219" Location Area Code, it’s used for tracking location
"CID":"0093BA41" Customer Identity, it’s used for tracking location
$%% CMD $
head command (multiple command can be connected by #, end
such as command1#command2#command3)