Intelligent Terminal MQTT Protocol Docking Manual v1.4
Intelligent Terminal MQTT Protocol Docking Manual v1.4
Chapter 1: Notes
Parameter Description
mqtt_cmd: Only 1 and 2 can be filled in.
1: The platform obtains the device system parameters.
2: The platform configuration device system parameters.
device_id: Device serial number. gets parameters from the specified device.
This field parameter is an optional entry. If there is no field,
all devices under the same topic will respond
tag: Message tag, platform custom, device will return the same tag,
the platform can use the tag to distinguish between the type of
operation and the type of data returned by the device
device_token: Protocol communication token. The platform binds the device
and the communication token returned by the device to the
platform For binding please read the binding instructions
Parameter Description
mqtt_cmd: Only 1 and 2 can be filled in.
1: The platform obtains the device system parameters.
2: The platform configuration device system parameters.
device_id: Device serial number. gets parameters from the specified device.
This field parameter is an optional entry. If there is no field, all
devices under the same topic will respond
tag: Message tag, platform custom, device will return the same tag, the platform
can use the tag to distinguish between the type of operation and the type of
data returned by the device
device_token: Protocol communication token. The platform binds the device
and the communication token returned by the device to the
platform For binding please read the binding instructions
module_name:
Please refer to chapter 4 for the parameter configuration of each module
{
"code":0,
"msg":"return success",
"device_id":"7101389947744",
"dev_cur_pts":1583985927,
"tag":"platfrom define",
"datas":""
}
Parameter Description
tag: Message tag, platform custom, device will return the same tag,
the platform can use the tag to distinguish between the type
of operation and the type of data returned by the device
datas: The platform requests the device's data. The data returned by
the device will be stored in this field.
There are common objects and array objects. For specific data,
please check the data return status of each function
When the device returns any data to the platform, the first 6 fields are certainly returned.
Only the datas: objects will change.
When any kind of platform software needs to control the device, you must create
a binding relationship before you can configure and obtain the device.
This device_token is for debugging device, please use the actual device_token after binding
2. The device will return the following information (returns all parameters of the device)
{
"code":0,
"msg":"get param success",
"device_id":"7101389947744",
"dev_cur_pts":1585151687,
"tag":"platfrom define",
"datas":
{
"basic_parameters":{ //Basic data
"dev_pwd":"YWRtaW4=", //Devide password base64 encode string
"dev_name":"FRD" //Device name
},
"network_cofnig":{ //network Configuration
"ip_addr":"172.18.195.66", //IP address
"net_mask":"255.255.248.0",//subnet mask
"gateway":"172.18.192.1", //default gateway
"DDNS1":"211.136.192.6", //dns1
"DDNS2":"8.8.8.8", //dns2
"DHCP":false //dhcp
},
"face_recognition_cfg":{
"dec_face_num_cur":1, //Current number of captured faces
"dec_interval_cur":1, //the current same person identifies
the time interval again
"dec_face_num_min":1, //minimum number of faces to capture
"dec_face_num_max":4, //Maximum number of faces to capture
"dec_interval_min":1, //At least the same person recognizes
the time interval again
"dec_interval_max":5 //the maximum time interval can be
recognized by the same person again
},
"remote_config":{
"light_supplementary":false, //Fill light setting
"volume_cur":12, //the current volume
}
}
Chapter 5: Platform Configuration and system parameters
Device Back
Success
{
"code":0,
"msg":"basic param set success",
"device_id":"7101389947744",
"dev_cur_pts":1583985600,
"tag":"platfrom define",
"datas":"no data"
}
Failure
{
"code":-1,
"msg":"mqtt param erro!",
"device_id":"7101389947744",
"dev_cur_pts":1583986146,
"tag":"platfrom define",
"datas":"no data"
}
Parameter Description
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":2,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"network_cofnig":
{
"ip_addr":"172.18.195.67",
"net_mask":"255.255.248.0",
"gateway":"172.18.192.1",
"DDNS1":"211.136.192.6",
"DDNS2":"8.8.8.8",
"DHCP":false
}
}
Device Back
Success
{
"code":0,
"msg":"network param set success",
"device_id":"7101389947744",
"dev_cur_pts":1583985600,
"tag":"platfrom define",
"datas":"no data"
}
Failure
{
"code":-1,
"msg":"mqtt param erro!",
"device_id":"7101389947744",
"dev_cur_pts":1583986146,
"tag":"platfrom define",
"datas":"no data"
}
Parameter Description
ip_addr:
net_mask: Device ip address
gateway: Subnet mask
DDNS1: Default gateway
DDNS2: dns
DHCP: dns
DHCP true: turn on false: turn off
Note that modifying the network parameters to configure the MQTT service will restart
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":3,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"face_config":
{
"dec_face_num":3,
"dec_interval":3
}
}
Device Back
{
"code":0,
"msg":"The interface has changed and is no longer supported",
"device_id":"7101016972903",
"dev_cur_pts":1589996147,
"tag":"platfrom define",
"datas":"no data"
}
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":4,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"remote_config":
{
"volume":12,
"screen_brightness":80,
"light_supplementary":true
"wiegand_dir":0,
"wiegand_write_bit":26
}
}
Device Back
Success
{
"code":0,
"msg":"remote config set success",
"device_id":"7101389947744",
"dev_cur_pts":1583987250,
"tag":"platfrom define",
"datas":"no data"
}
Failure
{
"code":-1,
"msg":"mqtt param erro!",
"device_id":"7101389947744",
"dev_cur_pts":1583987940,
"tag":"platfrom define",
"datas":"no data"
}
Parameter Description
volume:
volume range 0-24 Please refer to the minimum and
screen_brightness: maximum values of device back brightness range 45-
100 Please refer to the minimum and maximum
light_supplementary: values of device back fill light true: turn on false:
turn off
wiegand_write_bit:
Wiegand output bit 26 or 34
4. ID 5 is version information. can get but can not config
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":6,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"temperature_fun":
{
"temp_dec_en":false,
"stranger_pass_en":false,
"make_check_en":false,
"alarm_temp":37.4,
"temp_comp":1.1,
"record_save_time":24,
"save_record":true,
"save_jpeg":true
}
}
Device Back
Success
{
"code":0,
"msg":"funtable param set success",
"device_id":"7101389947744",
"dev_cur_pts":1583987966,
"tag":"platfrom define",
"datas":"no data"
}
Failure
{
"code":-1,
"msg":"mqtt param erro!",
"device_id":"7101389947744",
"dev_cur_pts":1583987981,
"tag":"platfrom define",
"datas":"no data"
}
Parameter Description
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":7,
"device_token":"1514348271",
"device_id":"7101389947744",
"tag":"platfrom define",
"piclib_manage":0,
"param":
{
"lib_name":"Smart Park",
"lib_id":"8",
"server_ip":"172.18.195.61",
"server_port":80,
"pictures":
[{
"active_time":"2020/01/1 00:00:01",
"user_id":"11",
"user_name":"Zhang San",
"end_time":"2020/12/30 23:59:59",
"p_id":"null",
"picture":"/192952.JPG"
},
{
"active_time":"2020/01/1 00:00:01",
"user_id":"22",
"user_name":"LI SI",
"end_time":"2020/12/30 23:59:59",
"p_id":"null",
"picture":"/linxiaofei.jpg"
}]
}
}
Device Back
{
"code":0,
"msg":"download PicLib status",
"device_id":"7101389947744",
"dev_cur_pts":1583986208,
"tag":"platfrom define",
"datas":
[{
"pic_url":"/192952.JPG",
"picture_statues":10, //Download picture status
10: download succeed 20: download failed
"user_id":"11"
},
{
"pic_url":"/linxiaofei.jpg",
"picture_statues":10,
"user_id":"22"
}]
}
Parameter Description
Take the http image server address listed in the document as an example:
http://72.18.195.61/192952.JPG
Enter the above address in the browser to preview the
picture.Based on above format, can download the picture
Among pictures, Data can be a set of data, or it can be multiple sets of data,
A single measurement of 2000 groups is also available
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":7,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"piclib_manage":1
}
Device Back
Success
{
"code":0,
"msg":"delete all piclib success!",
"device_id":"7101389947744",
"dev_cur_pts":1583986800,
"tag":"platfrom define",
"datas":"no data"
}
Failure
{
"code":-1,
"msg":"mqtt param erro!",
"device_id":"7101389947744",
"dev_cur_pts":1583987981,
"tag":"platfrom define",
"datas":"no data"
}
Parameter Description: no
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":7,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"piclib_manage":2,
"param":{
"lib":[
{
"lib_id":"8"
},
{
"lib_id":"9"
}
]
}
}
Device Back
Success
{
"code":0,
"msg":"delete lib piclib success",
"device_id":"7101389947744",
"dev_cur_pts":1583985794,
"tag":"platfrom define",
"datas":"no data"
}
Failure
{
"code":-1,
"msg":"mqtt param erro!",
"device_id":"7101389947744",
"dev_cur_pts":1583987981,
"tag":"platfrom define",
"datas":"no data"
}
Parameter Description
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":7,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"piclib_manage":3,
"param":{
"users":[
{
"user_id":"11"
},
{
"user_id":"22"
}
]
}
}
Device Back
{
"code":0,
"msg":"delete users piclib success",
"device_id":"7101389947744",
"dev_cur_pts":1584092989,
"tag":"platfrom define",
"datas":[
{
"user_id":"11",
"status":0
},
{
"user_id":"22",
"status":0
}
]
}
Parameter Description
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":7,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"piclib_manage":4,
"page":0
}
page ":-1 queries the total number of face databases and returns as
follows {
"code":0,
"msg":"mqtt query success!",
"device_id":"7101016972903",
"dev_cur_pts":1590480998,
"tag":"platfrom define",
"datas":{
"total_num":30102
}
}
"page":n the data corresponding to n pages of n query is returned as follows {
"code":0,
"msg":"mqtt query success!",
"device_id":"7101389947744",
"dev_cur_pts":1583987504,
"tag":"platfrom define",
"datas":[
{
"lib_id":"8",
"lib_name":"Smart Park",
"user_id":"1",
"user_name":"Zhang San",
"active_time":"2020/01/1 00:00:01",
"end_time":"2020/12/30 23:59:59",
},
{
"lib_id":"9",
"lib_name":"Smart Park",
"user_id":"2",
"user_name":"Li Si",
"active_time":"2020/01/1 00:00:01",
"end_time":"2020/12/30 23:59:59",
}
]
}
Parameter Description: no
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":7,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"piclib_manage":5,
"param":{
"lib":[
{
"lib_id":"8"
},
{
"lib_id":"9"
}
]
}
}
Device Back
{
"code":0,
"msg":"mqtt query success!",
"device_id":"7101389947744",
"dev_cur_pts":1583987504,
"tag":"platfrom define",
"datas":[
{
"lib_id":"8",
"lib_name":"Smart Park",
"user_id":"1",
"user_name":"Zhang San",
"active_time":"2020/01/1 00:00:01",
"end_time":"2020/12/30 23:59:59",
},
{
"lib_id":"9",
"lib_name":"Smart Park",
"user_id":"2",
"user_name":"Li Si",
"active_time":"2020/01/1 00:00:01",
"end_time":"2020/12/30 23:59:59",
}
]
}
Parameter Description: no
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":7,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"piclib_manage":6,
"param":{
"users":[
{
"user_id":"1"
},
{
"user_id":"2"
}
]
}
}
Device Back
{
"code":0,
"msg":"mqtt query success!",
"device_id":"7101389947744",
"dev_cur_pts":1583987504,
"tag":"platfrom define",
"datas":[
{
"lib_id":"8",
"lib_name":"intelligent park",
"user_id":"1",
"user_name":"Zhang San",
"active_time":"2020/01/1 00:00:01",
"end_time":"2020/12/30 23:59:59",
},
{
"lib_id":"9",
"lib_name":"intelligent park",
"user_id":"2",
"user_name":"Li Si",
"active_time":"2020/01/1 00:00:01",
"end_time":"2020/12/30 23:59:59",
}
]
}
Parameter Description: no
8. mqtt protocol parameter configuration
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":8,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"mqtt_protocol_set":
{
"enable":1,
"retain":0,
"pqos":0,
"sqos":0,
"port":1883,
"server":"",
"username":"",
"passwd":"YWRtaW4",
"topic2pulish":"PublishTest123",
"topic2subscribe":"SubscribeTest123",
"heartbeat":0 //Device and platform heartbeat parameters
}
}
Device Back
Success
{
"code":0,
"msg":"mqtt protocol set success",
"device_id":"7101389947744",
"dev_cur_pts":1583985840,
"tag":"platfrom define",
"datas":"no data"
}
Failure
{
"code":-1,
"msg":"mqtt param erro!",
"device_id":"7101389947744",
"dev_cur_pts":1583987981,
"tag":"platfrom define",
"datas":"no data"
}
Parameter Description
The MQTT parameters are reconfigured and the device MQTT client is restarted
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":9,
"device_token":"1057628122",
"device_id":"7101389947744",
"tag":"platfrom define",
"sys_maintain":
{
"reboot":1,
"reset":0
}
}
Device Back
Success
{
"code":0,
"msg":"systime maintain set success",
"device_id":"7101389947744",
"dev_cur_pts":1583985840,
"tag":"platfrom define",
"datas":"no data"
}
Failure
{
"code":-1,
"msg":"mqtt param erro!",
"device_id":"7101389947744",
"dev_cur_pts":1583987981,
"tag":"platfrom define",
"datas":"no data"
}
Parameter Description
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":10,
"device_id":"7101389947741",
"tag":"platfrom define",
"bind_ctrl":1
}
Device Back
Success
{
"code":0,
"msg":"mqtt bind ctrl success",
"device_id":"7101389947744",
"dev_cur_pts":1584053128,
"tag":"platfrom define",
"datas":{
"device_token":"1057628122"
}
}
"code":-1,
"msg":"The device has been bound! ip:192.168.1.88 platfrom:2",
"device_id":"7101389947744",
"dev_cur_pts":1583988351,
"tag":"platfrom define",
"datas":"nodata"
}
Platform send
{
"mqtt_cmd":1,
"mqtt_operate_id":10,
"device_token":"1514348271",
"device_id":"7101389947744",
"tag":"platfrom define",
"bind_ctrl":0
}
Device Back
Success
{
"code":0,
"msg":"mqtt unbind ctrl success",
"device_id":"7101389947744",
"dev_cur_pts":1583986540,
"tag":"platfrom define",
"datas":"no data"
}
Failure
{
"code":-1,
"msg":"device_token erro!",
"device_id":"7101389947744",
"dev_cur_pts":1584053102,
"tag":"platfrom define",
"datas":"no data"
}
Device Back
{
"code":0,
"msg":"Upload Person Info!",
"device_id":"7101389947744",
"dev_cur_pts":1583996959,
"tag":"UploadPersonInfo",
"datas":
{
"msgType":"1", //Message type, Not yet defined, you can let the
device returns the specified value