0% found this document useful (0 votes)
27 views

CWT JSON-MQTT Protocol

This document describes the JSON format for MQTT communication between devices and servers. It outlines the format for different data types including power up, digital/analog inputs and outputs, counters, registers. It provides examples of single channel and all channel JSON formats with explanations of the fields.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

CWT JSON-MQTT Protocol

This document describes the JSON format for MQTT communication between devices and servers. It outlines the format for different data types including power up, digital/analog inputs and outputs, counters, registers. It provides examples of single channel and all channel JSON formats with explanations of the fields.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

深圳市盈科互动科技有限公司 CWT CO.

, LIMITED
TEL:+86-755-26719954 | www.comwintop.com

CWT JSON:MQTT Protocol V1.0

Page: 1 CWT JSON-MQTT Protocol \\\ Version: V1.0


深圳市盈科互动科技有限公司 CWT CO., 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

For example, setup in device as follow

Subscribe topic: 123456:JSON


Publish topic: 123456:CWTIO-SVR

1. description of data flag

flag description remark


$%%CMD$ Send command Send from server
AD10 Single channel analog input
AD22 All channels analog inputs
DC03 Power (external power/internal battery)
DI02 Single channel digital input
DI20 All channels digital inputs
DO65 Single channel digital output
DO21 All channels digital outputs
GM67 Network information
HT99 heart beat
All channels counters
CT32

Single channel counter


CT48

LB66 LBS information (MCC,MNC,LAC,CID)


RG80 Single channel modbus register
RG81 All channels modbus registers
PW00 Power up data (include: arm/disarm status, power
supply, signal, DI, DO)

RS45 Hardware version:


IMEI、SIMID、OPERATOR
PVer、FVer、HdVer、DevTp

Page: 2 CWT JSON-MQTT Protocol \\\ Version: V1.0


深圳市盈科互动科技有限公司 CWT CO., LIMITED
TEL:+86-755-26719954 | www.comwintop.com

II. Description of Json format

1 Power up (PW00/ RP01)

Format: {"ID":" dyf00001","PID":"PW00","TIME":"2021-07-02 14:58:19"}

Content Explanation

"ID":"dyf00001" Client ID (set in device)

"PID":"PW00" Pw00 is flag of data type, represent power up

"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS

Note: device upload such type data when power up

2 Digital input

2.1 Single channel (flag: DI02)


Format:{"ID":"dyf00001","CH":1,"PID":"DI02","TIME":"2021-07-02 14:58:59","DI1":0}

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)

2.2 All channels digital input (flag: DI20)

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)

Page: 3 CWT JSON-MQTT Protocol \\\ Version: V1.0


深圳市盈科互动科技有限公司 CWT CO., LIMITED
TEL:+86-755-26719954 | www.comwintop.com

3 Analog input

3.1 Single channel (flag: AD10)

Format:{"ID":"dyf00001","CH":0,"PID":"AD10","TIME":"2021-07-02

14:58:59","AIV0":0.000,"AIS0":2}

Content Explanation

"ID":"dyf00001" Client ID (set in device)

"CH":0 Index of channel, 0 represent AI0

"PID":"AD10" AD10 is flag of data type, represent single channel

"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS

"AIV0":0.000 Channel 0 value, AIV0 represent AI0

Channel 0 status (0: normal, 1: alarm, 2: disconnect, 3: output


"AIS0":2
measure range)

3.2 All channels analog input (flag: AD22)

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)

Page: 4 CWT JSON-MQTT Protocol \\\ Version: V1.0


深圳市盈科互动科技有限公司 CWT CO., LIMITED
TEL:+86-755-26719954 | www.comwintop.com

4 Digital output

4.1 Single channel (flag: DO22)


Format:{"ID":"dyf00001","CH":1,"PID":"DO22","TIME":"2021-07-02 14:58:59","DO1":0}

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)

4.2 All channels digital output (flag: DO21)


Format:{"ID":"dyf00001","PID":"DO21","CH":2,"START":0,"TIME":"2021-07-02

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)

Page: 5 CWT JSON-MQTT Protocol \\\ Version: V1.0


深圳市盈科互动科技有限公司 CWT CO., LIMITED
TEL:+86-755-26719954 | www.comwintop.com

5.2 All channel (flag: RG81)

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

"ID":"dyf00001" Client ID (set in device)

"PID":"RG81" RG81 is flag of data type, represent all channels

"CH":4 All 4 channels data

"START":0 Start from register 0

"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS

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)

Page: 6 CWT JSON-MQTT Protocol \\\ Version: V1.0


深圳市盈科互动科技有限公司 CWT CO., LIMITED
TEL:+86-755-26719954 | www.comwintop.com

6.2 Single channel (flag: CT48)


Format:{"ID":"dyf00001","CH":0,"PID":"CT48","TIME":"2021-07-02

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)

7 Heartbeat (flag: HT99)

Format:{"ID":"dyf00001","PID":"HT99","TIME":"2021-07-02 14:59:19","HT":""}

Content Explanation

"ID":"dyf00001" Client ID (set in device)

"PID":"HT99" HT99 is flag of data type, represent heart beat

"TIME":"2021-07-02 14:58:59" Time format: YY-MM-DD HH:MM:SS

"HT":"" Heartbeat content can be null or set via config software

8 Power supply (flag: DC03)

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)

Page: 7 CWT JSON-MQTT Protocol \\\ Version: V1.0


深圳市盈科互动科技有限公司 CWT CO., LIMITED
TEL:+86-755-26719954 | www.comwintop.com

9 Hardware version information (flag: RS45)

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

"ID":"dyf00001" Client ID (set in device)

"PID":"RS45" RS45 is flag of data type, represent hardware version info

"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

"PVer":"CwtIO 1.413" CWTIO protocol version

"FVer":"1.56" Firmware Version

"HdVer":"1.1" Hardware version

"DevTp":"STM32" Hardware type

"LIVED":"1" Hardware online time

Note: device upload such type data when power up

10 Network information(Flog: GM67)


Format:{"ID":"dyf00001","PID":"GM67","TIME":"2021-07-02
14:58:25","IMEI":"868142043541268","SIMID":"898600121755771","OPERATOR":"CHINA
MOBILE","GPRSIP":"10.89.58.235","MCC":"460","MNC":"0","SIGNAL":"15","GPRSTX":"431","GPRS
RX":"48","LIVED":"1"}

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

Page: 8 CWT JSON-MQTT Protocol \\\ Version: V1.0


深圳市盈科互动科技有限公司 CWT CO., LIMITED
TEL:+86-755-26719954 | www.comwintop.com

"MCC":"460" Mobile Country Code


"MNC":"0" Mobile Network Code
"SIGNAL":"15" Network signal, 0-31
"GPRSTX":"431" Sending data byte over GPRS
"GPRSRX":"48" Receiving data byte over GPRS
"LIVED":"1" Hardware online time

Note: device upload such type data when power up

11 LBS information (Location Based Service) (flag: LB66)

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

12 Send command format

$%% CMD $
head command (multiple command can be connected by #, end
such as command1#command2#command3)

For example:$%%IOOH0#IOOH1$ // turn on output0 and output1

Page: 9 CWT JSON-MQTT Protocol \\\ Version: V1.0

You might also like