You are on page 1of 69

Facial Recognition Terminal

MQTT integration
CONTENTS

* Modify records.................................................. 4

1 Overview ........................................................ 6

2 Functional detailed design ...................................... 6

3 Environment and client setup.................................... 6

3.1 windows mqtt platform services ............................. 6

3.2 mqtt client tools .......................................... 7

4 data transmission.............................................. 12

4.1 Add and modify personnel list interface .................... 12

4.2 Query personnel list information ........................... 15

4.3 Delete individual person list .............................. 17

4.4 Add / modify / delete / return confirmation information from personnel


18

4.5 Delete all people list ..................................... 18

5 Certification and identification personnel information upload.. 20

6 Upload of stranger information ................................. 22

7 Upgrade version and get version information remotely ........... 23

7.1 Issue upgrade instructions ................................. 23

7.2 Upgrade confirmation message reply ......................... 23

7.3 Get the current software version ........................... 24

8 Open the door remotely......................................... 25

8.1 Open the door remotely ..................................... 25

8.2 Open door confirmation message reply ....................... 26

9. Parameter configuration ........................................ 26

9.1 System parameters .......................................... 26


9.2 Sound and interface display parameters ..................... 30

9.3 Door opening conditions and output control ................. 34

9.4 http subscription push...................................... 39

9.5 Temperature parameter ...................................... 44

9.6 mqtt report parameters...................................... 46

10 Device online and offline notification ........................ 49

10.1 Device online notification ................................ 49

10.2 Device receives online notification response .............. 49

10.3 Device offline notification ............................... 50


* Modify records
version date Change type Modifie Summ Reviewe Note
number (A*M*D) d by ary r
V1-0.1 2019-11-27 A CaiFF New
V1-0.2 2019-11-28 M CaiFF Modification 5 Upload of
authentication and
identification personnel
information
Modify 6 upload of
stranger information
V1-0.3 2019-12-05 M CaiFF Add 4.5 delete all
personnel list
Increase 7.3 Get current
software version
Increase 9. Parameter
configuration
V1-0.4 2019-12-17 M CaiFF Added 9.2 sound and
interface display
parameters
Added 9.3 door opening
conditions and output
control
V1-0.4 2020-01-17 M CaiFF Increase 9.4 http
subscription push
V1-0.5 2020-01-18 M CaiFF Added 9.4.3 Setting HTTP
Subscription Push
Parameters
Added 9.4.4 Setting HTTP
Subscription Push
Parameter return
V1-0.6 2020-02-17 M CaiFF Increase real-time
inspection of Mosheng and
certified personnel
Report temperature
measurement
V1-0.7 2020-02-18 M CaiFF Modified 3.2.2 Screenshot
of Post Topic Page
V1-0.7 2020-02-29 M CaiFF Modification 5 Upload of
authentication and
identification personnel
information
Modify 6 upload of
stranger information
Added 9.5 temperature
parameter
V1-0.8 2020-03-03 M CaiFF Added 9.5 temperature
parameter
Test mode

V1-0.8 2020-03-06 M CaiFF Added 5 similarity report


for authentication and
identification personnel
information upload
Added 9.5 Temperature
parameter Distance word
segment
V1-0.9 2020-03-09 M CaiFF Added 10 device online and
offline notifications
V1-0.9 2020-03-10 M CaiFF Modification 4.1 Add and
modify personnel list
Interface example
V1-10 2020-03-11 M CaiFF Modified the topic of 10
device online and offline
notification push to mqtt
/ face / basic
Added 9.6mqtt report
parameters
V1-11 2020-03-21 M CaiFF Modify 9.3 door opening
conditions and output
control door opening
verification method
Remove 9.5 temperature
parameter mask temperature
detection mode
Modification 5 Description
of uploading and verifying
information of
authentication and
identification personnel
Modify 6 stranger person
information upload form
grid
1 Overview
This document is mainly used for the mqtt protocol document of
the face recognition integrated machine and server-side interaction
data, which is suitable for system development and maintenance
personnel.

2 Functional detailed design


Data exchange format:

1. Data exchange is basically based on json format.

2. Image content is Base64 encoded or picture URI address.

3 Environment and client setup

3.1 windows mqtt platform services


1. Install jdk

2. Download apache-apollo-1.7.1-windows version, provide a link here


http://archive.apache.org/dist/activemq/activemq-apollo/1.7.1/

3. Open cmd as administrator and enter the bin directory in the


decompressed file

4. Execute command: create a directory (the following path is an


example)

apollo create myapollo C:\apache-apollo\broker

5. After successful creation, enter the broker \ bin directory and


execute the apollo-broker.cmd run command to start the service
6. Just log in to http://127.0.0.1:61680. The default account is
admin and the password is password. Note that the port of this
webpage is 61680, but the port of mqtt service is 61613.

3.2 mqtt client tools

Recommend using mqttbox or mqtt.fx

3.2.1 mqtt Connect steps


Make sure the system firewall is turned off, first add a connection to
open the connection settings
Mainly fill in the mqtt service host address and port (port default
61613) account and password

Shows green to indicate a successful connection


3.2.2 Post topic
1. First confirm the version of the face recognition machine is
suitable for this document, and check the MQTT settings of the face
recognition machine.The gate cloud ID number is generally filled in
the machine ID of the face recognition machine, and the cloud
address is created in the previous step. Mqtt service host address,
cloud port is the mqtt service host port created in the previous
step, the user name and password are the same as those created in
the previous step, and fill in the cloud topic Topic, which is the
topic that the facial recognition machine will subscribe to (the
server publishing topic Topic, Topic issued by the server).

Version information and local id (the local id is unique):

mqtt settings:
2. After mqttbox adds the publisher, fill in the publication topic, and
fill in the topic (topic) that needs to be published, for example: mqtt /
face / ID. To identify the machine ID of the all-in-one machine (unique and
different from other machines), please fill in the following data content.

3.2.3 Subscribe to topic


After setting the corresponding Topic topic (mqtt / face / ID, where
ID refers to the local ID, such as 1305433), the face recognition
integrated machine will send the face recognition results and stranger
snapshot results to the corresponding corresponding topics by default,
authentication The recognition result is sent to the topic mqtt / face /
ID / Rec (where ID refers to the local ID, such as 1305433); the stranger
captures and sends to the topic mqtt / face / ID / Snap (where ID refers
to the local ID, such as 1305433); reply The server sends the command
information result to the topic mqtt / face / ID / Ack (where ID refers
to the local ID, such as 1305433).
After adding subscribers, subscribe to the topics required above;
for example, the subscriber identification results topic is as
follows:

Example of pushing authentication identification information:

Example of a stranger snapshot information push:


4 data transmission
The instructions sent by the cloud platform (server) to the
facial recognition all-in-one device are all sent to the topic
(mqtt / face / ID, where ID refers to the local ID, such as
1305433). The result of the operation of the all-in-one responding
to the corresponding instruction is to
(mqtt/face/ID/Ack (Where id refers to the native id, such as 1305433)
topic push.

4.1 Add and modify personnel list


interface

para meaning Is required


mete
r
operator Operation flag Yes

personId ID on the all-in-one machine to distinguish no


each person
customId The id generated by the platform, which Yes
uniquely identifies different
people, it is recommended to use an
ID number, 48 characters in length
(including the terminator)

nation Ethnic (1-57) no

gender Sex 0: Male 1: Female no

idCard ID number no

tempCardType 0 Permanent 1 Temporary card type 1 (time Yes


period) 2 Temporary card type
2 (daily time period) 3 temporary card type
3 (counts)
EffectNumber Temporary Card Type 3 No, required if the
type is
temporary
card 3

cardValidBegin Temporary list start time No, type is


temporary card 1 or
2
Required
cardValidEnd End of temporary list No, type is
temporary card 1 or
2
Required

cardType2 Wigan card number generation method 0: no


Public card number 1: Automatic generation
2:
Manual input 3: Do not use access control
cardNum2 Wigan access card number (int type on the no
gate)
RFIDCard ID card number, maximum length is 18 no
characters, for built-in card swipe models
(including terminator); if you just re-
edit the list without changing the card
number, you do not need to pass in the
RFIDCard parameter

personType Character Category: 0: Whitelist 1: Yes


Blacklisty
cardType Document type: 0 ID card, no

pic Person picture (base64 encoded, no more You can choose


than 1M), and choose 1 between pic and
for picURI 2 picURI when adding
the list. It is not
necessary to modify
the list without
replacing the
picture.

picURI Person picture (URI address), and pic 2 When adding a list,
choose 1 choose one of picURI
and pic. Modifying
the list does not
have to replace the
picture.

messageId Message id, distinguishing each message Yes

The same interface is used for adding and modifying the list of
people. Note that the image data corresponding to the list of
people sent can be sent to the base64 data of the picture by the
key "pic", or the cloud URI address where the picture is sent by
the key "picURI". The face recognition all-in-one machine is used
to obtain the picture data; choose 2 of the two. If you are
modifying the list of people, it does not involve the replacement
of pictures. You do not need to pass in the key values "pic" and
"picURI".

1. List of issued personnel (the picture uses base64 data)


{
"messageId":"ID:localhost-637050272518414388:79346:87:5",
"operator":"EditPerson",
"info":
{
"personId":"",
"customId":"063c81e0fce184c696cdb7e049230f5e",
"name":"张三",
"nation":1,
"gender":0,
"birthday":"1995-06-12",
"address":"",
"idCard":"421381199504030001",
"tempCardType":0,
"EffectNumber":3,
"cardValidBegin":"2019-10-10 10:00:00",
"cardValidEnd":"2019-10-10 16:00:00",
"telnum1":"18888888888",
"native": "Shenzhen, Guangdong",
"cardType2":0,
"cardNum2":"",
"notes":"","personType":0,
"isWy":0,
"cardType":0,
"dwidentity":0,
"pic":"data:image/jpeg;base64 ....... (Fill in the base64 encoded data of the
picture, it cannot exceed 1M) "
}

2.Delivery list (pictures use uri, all-in-one to get pictures)

"messageId":"ID:localhost-637050272518414388:79346:87:5",
"operator":"EditPerson",
"info":
{
"personId":"",
"customId":"063c81e0fce184c696cdb7e049230f5e",
"name":"张三",
"nation":1,
"gender":0,
"birthday":"1995-06-12",
"address":"",
"idCard":"421381199504030001",
"tempCardType":0,
"EffectNumber":3,
"cardValidBegin":"2019-10-10 10:00:00",
"cardValidEnd":"2020-10-10 16:00:00",
"telnum1":"18888888888",
"native": "Shenzhen, Guangdong",
"cardType2":0,
"cardNum2":"",
"notes":"","personType":0,
"isWy":0,
"cardType":0,
"dwidentity":0,
"picURI":"https://btgoss.oss-cn-beijing.aliyuncs.com/image/xxx.jpg"

}
}

4.2 Query personnel list information


There are two query interfaces, one is to query detailed information,
and the other is to query all personnel customid in the device.

4.2.1 Query the customid of all personnel in the


device

parameter meaning Is
required
operator Operation Yes
flag
messageId Message id, Yes
distinguish
ing each
message

facesluiceId Gate return


equipment value
number id

{
"operator":"QueryPerson",
"info":
{
},
"messageId":"ID:localhost-637046811507388956:23952:65:48"
}

Confirmation message returned:


{
"messageId":"ID:localhost-637046811507388956:23952:65:48",
"operator": "QueryPerson-Ack",
"info": {
"facesluiceId":"5d0848e581c3e6f1938a035f",
"customId":",03c81e0fce1846c696cdb7e049230f11,03c81e0fce1846c696cdb7e049230f11",
"result":"ok"}
}

CustomId is separated by. May have duplicate id

4.2.2 Querying Details of a Single Person List

paramete meaning Is
r required
operator Operation flag Yes

customId Personnel in Yes


cloud platform
id
messageId Message id, Yes
distinguish
ing each
message

{
"operator":"SearchPerson",
"info":
{
"customId":"063c81e0fce184c696cdb7e049230f5e"
},
"messageId":"ID:localhost-637046811507388956:23952:65:48"
}

Confirmation message returned:

{
"messageId":"ID:localhost-637046811507388956:23952:65:48",
"operator": "SearchPerson-Ack",
"info": {
"facesluiceId":"5d0848e581c3e6f1938a035f",
"personId":"5",
"customId":"063c81e0fce184c696cdb7e049230f5e",
"name":"张三",
"gender":"0",
"idCard":"421381199504030014",
"address":" ",
"creatTime":"2019-09-30T09:13:48",
"telnum1":" ",
"personType":"0",
"cardNum2":"0",
"result":"ok"}
}

4.3 Delete individual person list


paramete meaning Is
r required
operator Operation flag Yes

customId Personnel in cloud Yes


platform id
messageId Message id, Yes
distinguish
ing each
message

{
"operator":"DelPerson",
"info":
{
"customId":"063c81e0fce184c696cdb7e049230f5e"
},
"messageId":"ID:localhost-637046811507388956:23952:65:48"
}
4.4 Add / modify / delete / return
confirmation information
(Platform reception)
parameter meaning

messageId Message id, distinguishing each


message
operator "EditPerson-Ack"
or "DelPerson-
Ack"

facesluiceId Gate id

personId ID on the all-in-one machine


to distinguish each person
customId Platform-generated id

result ok or fail

detail Fill in error message when


error

{
"messageId": "ID:hqvtsw013-45030-636591533573927379-1:3:1:1:1"
"operator": "EditPerson-Ack",
"info":
{
"facesluiceId":"0001",
"personId":"0001",
"customId":"063c81e0fce184c696cdb7e049230f5e", "result":"ok",
"detail":””
}
}

4.5 Delete all people list

4.5.1 Send and delete all personnel lists


Deleting the list of all personnel will delete the list of all personnel
corresponding to the face recognition integrated machine, as well as the
control record, unrecoverable operation, and use with caution. The
interface is successfully issued, and the face recognition integrated
machine will automatically restart.
parameter meaning Is
required
operator Operation flag Yes

customId Personnel in cloud Yes


platform id
messageId Message id, Yes
distinguish
ing each
message

deleteall Whether to delete all Yes


personnel lists

{
"operator":"DeleteAllPerson",
"info":
{
"deleteall":"1"
},
"messageId":"ID:localhost-637046811507388956:23952:65:48"
}

4.5.2 Delete all people list confirmation message


reply

parameter meaning

operator Operation flag

facesluiceId Device cloud id

messageId Message id,


distinguishi
ng each
message
{
"messageId":"ID:localhost-637046811507388956:23952:65:48",
"operator": "DeleteAllPerson-Ack",
"info":
{
"facesluiceId":"1305433",
"result":"ok"
}
}
5 Certification and
identification personnel
information upload
The information of the authentication and identification

personnel is pushed by the face recognition machine to the

corresponding topic of identification and authentication in

the 3.2.2 release topic.

Key Type Values Description


operator Operation flag, Authentication recognition
RecPush result push (char)
customId char Platform-generated personnel id
to distinguish each person
personid char The id on the all-in-one
machine to distinguish each
person,
Machine generated, platform
uncontrollable
facesluiceId One machine id,
distinguishing each machine
facesluiceName All-in-one name
similarity1 float 0~100 Black and white list
comparison similarity
similarity2 float 0~100 ID card comparison
similarity
pic Base64 encoding of the image
(less than 1M)
time char Recognition time
otype int Basic authentication 1: Normal neutral machine: 1 ~
type, (decimal 3 or 21 ~ 22 or
representation). 24~25 or 27;
1: whitelist 2: Support mask or temperature
verification measuring machine:
2: ID verification Support mask detection or (|)
3: white list + ID operation 0x100 means pass
verification with mask detection;
21: rf card Support body temperature
verification (built- detection or (|) operation
in credit card 0x200 means pass with body
model) temperature detection;
22: rf card Support mask + temperature
verification + detection or (|) operation
0x300
white list
Means pass with mask + body
verification
temperature detection; for
(built-in card
example:
swipe model) 24:
Masks pass (256 = 0x100)
Wigan card
Mask + whitelist verification
verification
(257 = 0x101) Body
25: Wiganka +
temperature pass (512 =
whitelist
0x200)
verification
Body temperature + white list
27: http Open the
door remotely verification (513 = 0x201)
Mask + body temperature (768
= 0x300)
Mask + body temperature + Wigan
credit card + whitelist
verification
(793=0x319)
cardNum2 unsigned Wigan access card number (int
int type on the gate)
RFIDCard char id card number, maximum length
is 18 characters, for built-in
credit card models (including
end
symbol)
idCard char identity number
telnum char telephone number
direction char Entrance and exit directions
Import: "entr" , Out
Mouth: "exit", no direction:
"unknow"
temperature float Real-time detection of human
face temperature. The
temperature will be returned to
the detection temperature only
when the door opening
verification method set in 9.3
Door Opening Conditions and
Output Control
(Temperature detection
machine version support)
temperatureAlarm int Real-time detection of
whether the face temperature
exceeds the threshold, 0: not
exceeded; 1: exceeded
(temperature detection
(Machine version
support)

eg1, push and report the authentication and identification results:

{
"operator": "RecPush",
"info":
{
"customId":"063c81e0fce184c696cdb7e049230f5e ",
"personId":"41",
"direction":"entr",
"otype":"1",
"persionName":" 张 三 ",
"facesluiceId":"1305433",
"facesluiceName":"Face1",
"cardNum2":"2",
"time":"2018-03-07 14:01:01",
""pic":"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2w ........... ",
"otype":"1",
"temperature":"36.53",
"temperatureAlarm":"0"

}
6 Strange Person Information
Upload
Turn on the stranger snapshot upload mode in the stranger snapshot
upload mode.
3.2.3 Subscribe to topics.

Key Type Values Description


operator Operation flag, Stranger snap shot (char)
StrSnapPush
facesluiceId One machine id,
distinguishing each machine
facesluiceName All-in-one name
time Stranger capture time
direction Import: "entr" One machine import and
Exit: "exit", export direction
Directionless: "unknow"
temperature Real-time detection of human
face temperature. The
temperature will be returned
to the detection temperature
only when the door opening
verification method set in 9.3
Door Opening Conditions and
Output Control
(Temperature detection
machine version support)
temperatureAlar Real-time detection of
m whether the face temperature
exceeds the threshold, 0: not
exceeded; 1: exceeded
(temperature detection
(Machine version
support)
pic Base64 encoding of the image
(less than 1M)

eg1, the stranger snaps and reports:


{
"operator": "StrSnapPush",
"info":
{
"facesluiceId":"1305433",
"facesluiceName":"Face1",
"direction":"exit",
"time":"2019-11-28 11:26:40",
"pic":
"data:image/jpeg;base64,Qk3m5QAAAAAAADYAAAAoAAAAjAAAAIwAAAABABgAAAA
AAAAAAAASCwAAEg..... ",
"temperature":"36.53",
"temperatureAlarm":"0"
}
}
7 Upgrade version and get
version information remotely

7.1 Issue upgrade instructions


The remote upgrade instruction is sent by the server to the
face recognition machine, and the confirmation information is sent
by the face recognition machine to the server.

paramete meaning Is
r required
operator Operation flag Yes

name Version name, not used yet, no


feel free to fill in
path Download path for upgrade Yes
files
messageId Message id Yes

{
"operator":"Upgrade",
"info":
{
"name": "Latest Version",

"path":"https://mqttxxxx.oss-cn-shenzhen.aliyuncs.com/face/ba30fcbe-4758-4e1c-a287-5ab448a4
75ed.swx"
},
"messageId":"ID:localhost-637050900934386959:42763:53:1"
}

7.2 Upgrade confirmation message reply


parameter meaning

operator Operation
flag
facesluiceId Device cloud
id
name The name
passed
messageId Message id
{
"messageId":"ID:localhost-637050900934386959:42763:53:1",
"operator": "Upgrade-Ack",
"info": {
"facesluiceId": "5d0848e581c3e6f1938a035f",
"name": "Latest version",
"result":"ok"}
}

7.3 Get the current software version


7.3.1 Issue instructions for obtaining the
current software version

parameter meaning

operator Operation
flag
facesluiceId Device cloud
id
messageId Message id

name Software
version
number
buildtime Software
compilation
time

{
"operator": "Versions",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{
}
}
7.3.2 Back to get the current software version
information

{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"operator": "Versions-Ack",
"info":
{ "facesluiceId":"1305433",
"name":"v12.5.6L3M1-1.0.6.9 Beta",
"buildtime":"2019-12-02/10:46:05",
"result":"ok"
}
}

8 Open the door remotely

8.1 Open the door remotely


The remote door opening instruction is sent by the server to the face
recognition integrated machine, and the confirmation information is sent to
the server by the face recognition integrated machine.

parameter meaning mean


ing
operator Operatio Yes
n flag
uid Temporar no
ily
useless
messageId Message Yes
id

{
"operator": "Unlock",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{
"uid":"00001"
}
}

8.2 Open door confirmation message


reply

paramet meaning
er

messageId Message id

operator Unlock-Ack

facesluiceId Gate id

result ok or fail

detail Fill in error


message when error

{
"messageId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"operator": "Unlock-Ack",
info:{
"uid":"00001",
"facesluiceId":"0001",
"result":"ok"
}
}

9. Parameter configuration

9.1 System parameters


The system parameters are mainly related to the system operating
parameters of the face recognition integrated machine.
parameter meaning Description
operator Getconfig/Upconfig Get / set system
parameters
facesluiceId Gate id (char)
Language Device language, 0: (int) Change the device
English 1: Chinese language and
Simplified the machine
2: Traditional Chinese will restart
3:
Portuguese
4: Korean
DataBaseEnable Record snapshot + record (int) Default: 1, if not
ID + record enabled, snapshot, ID,
authentication (0 and authentication
No 1 Yes) picture data will not be
saved
IDcardType ID card reader (int) Use with ID
type, 0: card to use
Zhongkong, default: 0
Tengyan, Huashi;
1: Jinglun
CardReaderType IC card reader type (int) default: 0

CardOpenDoorWay Swipe to open the door (int) default: 0


0: human face + card 1:
human face or card
FaceDisplay Whether to show the face (int) Default: 1
frame
0: No 1: yes
LiveDetectType Vital detection mode 0: (int) Default: 1
Vital detection is always
on, 1: Vital detection is
turned off, 2: Vital is
turned on by time
Detection
LiveDetectTimeBeg Vital detection daily (char) LiveDetectType = 2
start time Required
Fill, eg, 07:00:00
LiveDetectTimeEnd Biopsy end of day (char) LiveDetectType = 2
Required
Fill, eg, 19:00:00
LiveThreshold Double live detection (double)e.g.,90.000000
threshold
LiveFrameNum Number of consecutive (int) The larger the
frames for live detection number of frames, the
recognition occupied time
Increase, eg, 2

LedLightType Enable white light type 0: (int)


Never 1: Time control 2:
Photosensitive control 3:
Face sensing 4: Face or
time 5 people
Face or light
LedBrightness White light brightness (int) Used when white
light is enabled
LedTimeBeg White light starts at the (char) When LedLightType =
start time every day 1,4
(With white light time) Required, eg, 19:00:00
LedTimeEnd White light enable end (char) When LedLightType =
time every day (off 1 or 4
(White light off time) Required, eg, 07:00:00
LedDisableAfterSec Turn off the white light (int) When LedLightType =
after many seconds 3,4,5
(Face sensing) Required
LcdBLDisable Whether to turn off the (int)
screen when no one is 0:
from
No, 1: Turn off screen
backlight when
no face is
detected
LcdBLDisableAfterSec Turn off the screen after (int) Required when
many seconds without one LcdBLDisable = 1
ScreenBrightness Screen brightness (int) Default: 50
reboot Whether the machine 0: Not restarted 1:
restarts Restarted
result Operation result, success:
"ok" / failure:
“fail”
detail Return reason on failure

9.1.1 Get system parameters


{
"operator": "Getconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{

}
}
9.1.2 Get system parameters and return
{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator": "Getconfig-Ack",
"info":
{
"facesluiceId":"1305433",
"Language":"1",
"DataBaseEnable":"1",
"IDcardType":"1",
"CardReaderType":"1",
"CardOpenDoorWay":"0",
"FaceDisplay":"1",
"LiveDetectType":"0",
"LiveDetectTimeBeg":"07:00:00",
"LiveDetectTimeEnd":"19:00:00",
"LiveThreshold":"90.340000",
"LiveFrameNum":"2",
"LedLightType":"0",
"LedTimeBeg":"07:00:00",
"LedTimeEnd":"19:00:00",
"LedBrightness":"50",
"LedDisableAfterSec":"30",
"LcdBLDisable":"0",
"LcdBLDisableAfterSec":"30",
"ScreenBrightness":"50",
"result":"ok"
}
}

9.1.3 Setting system parameters


If you need to set the corresponding options of the system parameters,
you need to pass in the corresponding parameters. For detailed
parameter descriptions, see
9.1 System parametersNote: The machine language is changed successfully,
and the facial recognition all-in-one will restart.

eg1, change the white light enable type and time period:
{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator": "Upconfig",
"info":
{
"LedLightType":"1",
"LedTimeBeg":"20:00:00",
"LedTimeEnd":"08:00:00",
"LedBrightness":"60"
}
}

9.1.4 Set system parameters

{
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"operator": "Upconfig-Ack",
"info":
{
"facesluiceId":"1305433",
"reboot":"0",
"result":"ok"
}
}

9.2 Sound and interface display


parameters
Parameter information (Note: optional is optional)

Key Type Values Description


operator GetSoundconfig/ Get / set sound and interface
UpSoundconfig display parametersGet / set
GetSoundconfig-Ack/ sound and interface display
UpSoundconfig-Ack parameters
info specific contents
facesluiceId char Face recognition machine id
VerifySuccAudio int 0~1 Whether the authentication
(optional) succeeds
0: Do not broadcast
1: broadcast
VerifyFailAudio int 0~1 Whether authentication fails
(optional) 0: Do not broadcast
1: broadcast
Volume int 0~100 Volume value
(optional)
VerifySuccGuiTip int 0~1 Whether the authentication
(optional) success interface prompts
0: no prompt
1: tip
VerifyFailGuiTip int 0~1 Whether the authentication
(optional) failure interface prompts
0: no prompt
1: tip
UnregisteredGuiTip int 0~1 Is the list unregistered prompt
(optional) 0: no prompt
1: tip
DisplayPicture int 0~1 Image interface type
(optional) 0: Snapshot image
1: register image
RemoteCtrlAudio int 0~1 Remote control playback sound
(optional) 0: Do not play sound
1: play sound
IPHide int 0~1 Whether the interface ip is
(optional) hidden
0: not hidden
1: hide
IsShowName int 0~1 If the comparison is
(optional) successful, whether the name
prompt is displayed
0: Not displayed
1: display
IsShowTitle int 0~1 Whether the interface title
(optional) prompt is displayed
0: Not displayed
1: display
IsShowVersion int 0~1 Whether the interface version
(optional) number prompt is displayed
0: Not displayed
1: display
IsShowDate int 0~1 Whether the date prompt is
(optional) displayed on the interface
0: Not displayed
1: display
IsShowTime int 0~1 Whether the interface time
(optional) prompt is displayed
0: Not displayed
1: display
IDCardNumHide int 0~1 Whether the interface card
number is hidden (built-in card
type)
(optional) 0: not hidden
1: hide
ICCardNumHide int 0~1 Whether the
(optional) interface ic card
number is hidden
0: not hidden
1: hide
result Operation result,
success: "ok" /
Failure: "fail"
detail Return reason on
failure

9.2.1 Get sound and interface display parameters


e.g.,

{
"operator": "GetSoundconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{

}
}

9.2.2 Get sound and interface display parameters


e.g.,

{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator": "GetSoundconfig-Ack",
"info":
{
"facesluiceId":"1305433",
"VerifySuccAudio":"1",
"VerifyFailAudio":"1",
"Volume":"90",
"VerifySuccGuiTip":"1",
"VerifyFailGuiTip":"1",
"UnregisteredGuiTip":"1",
"DisplayPicture":"1",
"RemoteCtrlAudio":"0",
"IPHide":"0",
"IsShowName":"1",
"IsShowTitle":"0",
"IsShowVersion":"0",
"IsShowDate":"1",
"IsShowTime":"1",
"ICCardNumHide":"0",
"result":"ok"
}
}

9.2.3 Setting sound and interface display


parameters
e.g.,

{
"operator": "UpSoundconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{
"VerifySuccAudio":"1",
"VerifyFailAudio":"0",
"Volume":"80",
"VerifySuccGuiTip":"1",
"VerifyFailGuiTip":"0",
"UnregisteredGuiTip":"1",
"DisplayPicture":"0",
"RemoteCtrlAudio":"0",
"IPHide":"0",
"IsShowName":"1",
"IsShowTitle":"0",
"IsShowVersion":"0",
"IsShowDate":"1",
"IsShowTime":"1",
"ICCardNumHide":"0"
}
}
9.2.4 Setting sound and interface display parameters

e.g.,

{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"operator": "UpSoundconfig-Ack",
"info":
{
"facesluiceId":"1305433",
"result":"ok"
}
}

9.3 Door opening conditions and output


control
Parameter information (Note: optional is optional)

Key Type Values Description


operator GetDoorconfig/ Get / set door opening
UpDoorconfig conditions and output control
GetSoundconfig-Ack/
UpSoundconfig-Ack Get / set door opening
conditions and output control
return
info specific contents
facesluiceId char Face recognition machine
id
OpendoorWay int 0~2 Door opening method
(optional) 0: Face opening mode, 1: Remote
door opening mode,
2: remote door opening or face
mode
FaceThreshold int 50~100 Black / white list match
(optional) threshold
IDCardThreshold int 50~100 ID card comparison
(optional) threshold
VerifyMode int 1: Normal neutral Basic open door verification
(optional) machine: 1 ~ 4 or method (the following basic
21~26 types are decimal)
2: Support for 1: whitelist verification
masks or 2: ID verification
temperature 3: Whitelist + ID
measuring machines: 4: Whitelist or ID
Whether mask
detection or
temperature
detection or (|)
operation based
door opening
verification method
is required.
Support mask 5: Mask alone or temperature
detection or (|) alone or mask alone
operation 0x100 + Body temperature (requires
means with mask whether to include mask detection
or temperature detection, mask or
detection
temperature measurement model)
verification;
21: rf card verification (built-
Support body
in card swipe model)
temperature
22: rf card
detection or (|)
verification + white
operation 0x200
list verification
means with body (built-in card type)
temperature 23: rf card verification or
detection white list verification (built-
verification; in card model)
Support mask + 24: Wegenka verification
temperature 25: Wiganka + whitelist
detection or (|) verification
operation 0x300 26: Wiganka or whitelist
means with mask + verification

temperature
detection
verification; for
example:
1: ordinary neutral
machine
1) Whitelist
verification: 1
2) Wegenka +
whitelist
verification: 25
2: mask or
temperature measuring
machine
1) Individual mask
verification pass
(261 = 0x105 =
0x100 & 5)
2) Mask + whitelist
verification (257 =
0x101 = 0x100 & 1)
3) Individual
temperature passage
(517 = 0x205 =
0x200 & 5)
4) Body temperature
+ white list
verification (513 =
0x201 = 0x200 & 1)
5) Individual mask
+ body temperature
(773 = 0x305 = 0x300
& 5)
6) Mask + body
temperature + Wigan
credit card + white
list verification
(793 = 0x319 = 0x300
& 25
)

VerifyResetTime int 1~10(s) Verify reset time


(optional)
Wiegand int 0~1 or 4~7 Wigan protocol type.
(optional) 0: 26 bits
1: 34 bits
4:26 digits (8 + 16): facility
code + userid (equipment
code + card number);
5:34 bits (8 + 24);
6:26 (fill in 8 + 16
separately);
7:34 digits (8 + 24 separate
entry)
PublicMjCardNo int Public access card number
(optional)
AutoMjCardBgnNo int Automatically generate the
(optional) start card number of the
access card number
AutoMjCardEndNo int Automatically generate the
end card number of the
access card number
(optional)
ControlType int 0~2 Control the door opening
(optional) interface mode.
0: Wiegand interface
1: switching value
2: Wiegand interface + switch
IOType int 0~1 The door opening action is
(optional) controlled when the door
opening interface mode is
controlled.
0: closed
1: disconnect
IOStayTime int 200 (ms) by Hold time (ms)
(optional) default
Endian int 0~1 Card number end reading mode
(optional) 0: big-endian mode
1: little-endian mode
CardMode int 0~1 Card number method
(optional) 0: Decimal
1: hex
result Operation result, success: "ok"
/ failure: "fail"
detail Reason to return on failure

9.3.1 Obtain door opening conditions and output


control
e.g.,

{
"operator": "GetDoorconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{

}
}

9.3.2 Get door open conditions and output control


return
e.g.,
{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator":
"GetDoorconfig-Ack",
"info":
{
"facesluiceId":"1305433",
"OpendoorWay":"0",
"FaceThreshold":"90",
"IDCardThreshold":"50",
"VerifyMode":"1",
"VerifyResetTime":"2",
"Wiegand":"0",
"PublicMjCardNo":"2",
"AutoMjCardBgnNo":"3",
"AutoMjCardEndNo":"4",
"ControlType":"1",
"IOType":"1",
"IOStayTime":"200",
"Endian":"0",
"CardMode":"0",
"result":"ok"
}
}

9.3.3 Set door opening conditions and output


control
e.g.1,

{
"operator": "UpDoorconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{
"OpendoorWay":"0",
"FaceThreshold":"90",
"IDCardThreshold":"50",
"VerifyMode":"1",
"VerifyResetTime":"2",
"Wiegand":"0",
"PublicMjCardNo":"2",
"AutoMjCardBgnNo":"3",
"AutoMjCardEndNo":"4",
"ControlType":"1",
"IOType":"1",
"IOStayTime":"200",
"Endian":"0",
"CardMode":"0"
}
}

eg2, change the black and white list verification threshold

{
"operator": "UpDoorconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{
"FaceThreshold":"91"
}
}

eg3, support mask detection version, change the door opening


verification method to separate mask verification pass
{
"operator": "UpDoorconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{
"VerifyMode":"261"
}
}

eg4, support mask + temperature detection version, change the door


opening verification method to mask + temperature + white list
verification
{
"operator": "UpDoorconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{
"VerifyMode":"769"
}
}
9.3.4 Set door opening conditions and output
control return
e.g.,

{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator": "UpDoorconfig-Ack",
"info":
{
"facesluiceId":"1305433",
"result":"ok"
}
}

9.4 http subscription push


http subscription push is mainly about the parameter settings of
http subscription push, set the corresponding subscriber server
address, port and subscription content, and the facial recognition
integrated machine will upload the corresponding data to the
corresponding server. The types of http subscription push include:
authentication results Information subscription, stranger snapshot
subscription, etc. When the breakpoint resume transmission function
is enabled, the pushed stranger snapshot information and
authentication information need to be returned by the server
{"code": 200, "desc": "OK",}.

Parameter information (Note:

optional is optional)

Key Type Values Description


operator GetHTTPconfig/ Get / set http subscription
UpHTTPconfig push
GetHTTPconfig-Ack/
UpHTTPconfig-Ack Get / set HTTP subscription
push return information

info specific contents


facesluiceId char Face recognition machine
id
ServerAddr char Server address, eg,
192.168.2.11
ServerPort int Server port, eg, 80
Verify int 0~4 Certification Results
Subscription
0: No subscription
1: Report on subscription
authentication
results (only
with snap
pictures)
2: Report on subscription
authentication
results (with
registration
image only)
3: Report on subscription
authentication
results (snapshot
+ registered
picture)
4: Report the subscription
certification results (without
pictures)
VerifyURL char Authentication result
subscription URL, silent
Confirm: / Subscribe / Verify
Snap int 0~1 Mo Life Snapshot Subscription
0: No subscription
1: subscribe to a stranger to
capture a report
SnapURL char Mo Life snapped subscription
URL, silent
Acknowledge: / Subscribe / Snap
QRCode int 0~1 QR code report subscription
0: No subscription
1: Subscribe to QR code to
report
QRCodeURL char Report QR code subscription
URL, silent
Recognize: / Subscribe / QRCode
IDCard int 0~1 ID information report
subscription
0: No subscription
1: Subscribe to report identity
card information
IDCardURL char ID card information report
subscription URL, silent
ID: / Subscribe / IDCard
BeatInterval int 30 Heartbeat interval
BeatURL char Heartbeat URL, default: /
Subscribe / heartbeat
TimedPush int 0~1 Timed push
0: Disable
1: enable
PushInterval int Timed push interval (seconds)
Auth int 0~1 Whether to authenticate when
submitting the report
information
0: No authentication is
required
1: post basic authentication
User char User name, up to 64 characters
(optional) (With terminator)
Required if Auth = 1
Pwd char Password with a maximum length
(optional) of 64 characters (including
terminator)
Required if Auth = 1
ResumefromBreakpoi int 0~1 Whether HTTP subscription push
nt breakpoint resume
(Enable stranger snapshot
subscription or certification
subscription
(In the reading mode), 0:
Disable 1: Enable. Do not
enable the resume resume
function. Only the push data
is guaranteed. There may be
lost data and the server does
not need to return. If the
function is enabled, the
pushed stranger capture
information and authentication
information need The server
returned the following json
packet: {"code": 200, "desc":
"OK",}
The all-in-one does not
receive the server correctly
after 10 seconds
Packet, continue to push this
information.
RFBPTimeBegin char yyyy-mm-dd space The default start time of
(optional) hh:mm:ss resuming a breakpoint can be
omitted. The default is to set
the time for the stranger
snap-up subscription or
authentication subscription
and the time to resume the
breakpoint. When the push of
the stranger snapshot and
authentication snapshot
information before the
breakpoint is completed, ,
This time will become the
completion of the breakpoint
resume transmission push
Time.eg, 2018-03-12 09:10:00
detail Reason to return on
failure

9.4.1 Get http subscription push parameters


e.g.,
{
"operator": "GetHTTPconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{

}
}

9.4.2 Get http subscription push parameter return


e.g.,
{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator": "GetHTTPconfig-Ack",
"info":
{
"facesluiceId":"1306612",
"ServerAddr":"172.168.2.89",
"ServerPort":"80",
"Verify":"1",
"VerifyURL":"/Subscribe/Verify",
"Snap":"1",
"SnapURL":"/Subscribe/Snap",
"QRCode":"1",
"QRCodeURL":"/Subscribe/QRCode",
"IDCard":"1",
"IDCardURL":"/Subscribe/IDCard",
"BeatInterval":"30",
"BeatURL":"/Subscribe/HeartBeat",
"TimedPush":"0",
"PushInterval":"30",
"Auth":"0",
"UserName":"admin",
"PassWord":"admin",
"ResumefromBreakpoint":"1",
"RFBPTimeBegin":"2020-1-3 18:11:40",
"result":"ok"
}
}

9.4.3 Set http subscription push parameters


eg1, set HTTP subscription push authentication comparison (with snapshot picture)
+ report of stranger snapshot result + open resume resume

{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator": "UpHTTPconfig",
"info":
{ "ServerAddr":"172.168.2.89
",
"ServerPort":"80",
"Verify":"1",
"VerifyURL":"/Subscribe/Verify",
"Snap":"1",
"SnapURL":"/Subscribe/Snap",
"QRCode":"0",
"QRCodeURL":"/Subscribe/QRCode",
"IDCard":"0",
"IDCardURL":"/Subscribe/IDCard",
"BeatInterval":"30",
"BeatURL":"/Subscribe/HeartBeat",
"TimedPush":"0",
"PushInterval":"30",
"Auth":"0",
"UserName":"admin",
"PassWord":"admin",
"ResumefromBreakpoint":"1"
}
}

eg2, cancel all HTTP push subscriptions


{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator": "UpHTTPconfig",
"info":
{ "ServerAddr":"172.168.2.89
",
"ServerPort":"80",
"Verify":"0",
"VerifyURL":"/Subscribe/Verify",
"Snap":"0",
"SnapURL":"/Subscribe/Snap",
"QRCode":"0",
"QRCodeURL":"/Subscribe/QRCode",
"IDCard":"0",
"IDCardURL":"/Subscribe/IDCard",
"BeatInterval":"30",
"BeatURL":"/Subscribe/HeartBeat",
"TimedPush":"0",
"PushInterval":"30",
"Auth":"0",
"UserName":"admin",
"PassWord":"admin",
"ResumefromBreakpoint":"1"
}
}

9.4.4 Set http subscription push parameters to


return
{
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"operator": "UpHTTPconfig-Ack",
"info":
{
"facesluiceId":"1306612",
"result":"ok"
}
}

9.5 Temperature parameter


The temperature parameter is mainly related to the temperature
operation parameters of the machine model face recognition
integrated machine that supports temperature detection, and this
parameter is only supported.

Parameter information (Note: optional is optional)

Key Type Values Description


operator GetTPTconfig/ Get / Set
UpTPTconfig/ Temperature
GetTPTconfig-Ack/ Parameter Get / Set
UpTPTconfig-Ack Temperature
Parameter Return
info specific contents
facesluiceId char Face recognition machine
id
TemperatureCheck double 0.00 Temperature calibration
TemperatureHigh double 37.30 Temperature alarm threshold
(default: 37.30)
EnvTemperature double Ambient temperature
(optional) (reserved)
EnvTemperatureChec double Ambient temperature
k (optional) calibration value
(reserved)
OpenLaser int 0~1 Whether to turn on the
(optional) laser (reserved)
Distance int 100~500 Minimum face recognition
pixels (default 350)
result Operation result, success: "ok"
/ failure: "fail"
detail Reason to return on
failure

9.5.1 Get temperature parameters


e.g.,

{
"operator": "GetTPTconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{

}
}

9.5.2 Get temperature parameter returned


e.g.,

{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator": "GetTPTconfig-Ack",
"info":
{
"facesluiceId":"1305433",
"TemperatureCheck":"0.00",
"TemperatureHigh":"37.20",
"EnvTemperature":"17.00",
"EnvTemperatureCheck":"0.00",
"OpenLaser":"1",
"Distance":"350",
"result":"ok"
}
}

9.5.3 Set temperature parameters


e.g.,

{
"operator": "UpTPTconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{
"facesluiceId":"1305433",
"TemperatureCheck":"0.00",
"TemperatureHigh":"37.20",
"EnvTemperature":"17.00",
"EnvTemperatureCheck":"0.00",
"OpenLaser":"1",
"Distance":"350"
}
}

9.5.4 Set temperature parameter return


e.g.,

{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator": "UpTPTconfig-Ack",
"info":
{
"facesluiceId":"1305433",
"result":"ok"
}
}

9.6 mqtt report parameters


The mqtt report parameters are mainly related to setting whether
to push the push of stranger snap information and the authentication
identification information.

Parameter information (Note: optional is optional)

Key Type Values Description


operator GetMQTTconfig/ Get / set mqtt report
UpMQTTconfig/ parametersGet / set mqtt
GetMQTTconfig-Ack/ report parametersReturn
UpMQTTconfig-Ack
info specific contents
facesluiceId char Face recognition machine
id
StrangerUploadType int 0~1 Upload of stranger snapshot
information (default: 0)
0: upload
1: do not upload
RecordUploadType int 0~2 Authentication
identification information
upload (default: 1)
0: Do not upload
1: identify record upload
with snap picture
2: Recognize record upload
without snapping pictures
Direction int 0~2 One machine import and export
direction
0: Import
1: exit
2: no direction
ReConnect int 0~1 Whether the machine needs
reconnection service (reserved)
0: Not required
1: required
Reboot int 0~1 Does the machine need to be
restarted (reserved)
0: Not required
1: required
result Operation result, success: "ok"
/ failure: "fail"
detail Reason to return on failure

9.6.1 Get mqtt report parameters


e.g.,

{
"operator": "GetMQTTconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{

}
}

9.6.2 Get mqtt report parameters and return


e.g.,

{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"operator": "GetMQTTconfig-Ack",
"info":
{
"facesluiceId":"1305433",
"StrangerUploadType":"1",
"RecordUploadType":"2",
"Direction":"1",
"result":"ok"
}
}

9.6.3 Set mqtt report parameters


e.g.,

{
"operator": "UpMQTTconfig",
"messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"info":
{
"facesluiceId":"1305433",
"StrangerUploadType":"0",
"RecordUploadType":"1",
"Direction":"1",
}
}

9.6.4 Set mqtt report parameters to return


e.g.,

{ "messageId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X",
"operator": "UpMQTTconfig-Ack",
"info":
{
"facesluiceId":"1305433",
"result":"ok"
}
}
10 Device online and offline
notification
Mainly after the device is connected to the platform, the device
actively sends the device offline notification; after the device is
offline, the device actively sends the device offline notification.
The device will actively push the online and offline notification
message to the topic mqtt / face / basic.

Key Type Values Description


operator Online/ Online: The device is
Online-Ack/ online.Online-Ack: The device
Offline receives the response from the
online platform.
complex
Offline: device
offline
notification
info specific contents
facesluiceId char Face recognition machine
id
time char Online / offline time
result char “ok” The platform sends a
confirmation message that the
receiving device is online.

10.1 Device online notification


On the premise that the device is successfully connected to the
platform, the device sends an online notification message to the
platform. After the platform receives the online notification message,
it needs to reply to the device to receive the device online
notification response, otherwise the device will continuously send
online notification messages to the device within an interval of
about one minute. Platform until platform confirmation is received.
By default, the device pushes the online notification message topic
to mqtt / face / basic.

eg, device sends online notification


{
"operator": "Online",
"info":
{ "facesluiceId":"1305433",
"time":"2020-03-07 14:04:25"
}
}

10.2 Device receives online notification


response
After the platform receives the online notification of the device,
it needs to reply to the device receiving the online notification,
otherwise the device will continuously send the online notification
instruction to the platform within an interval (about one minute)
until it receives the platform confirmation message.

eg, the platform responds to the notification that the receiving device
is online
{
"messageid":10201,
"operator":"Online-Ack",
"info":{ "facesluiceId":"13
05433", "result":"ok",
"detail":""
}
}

10.3 Device offline notification


After the device goes offline, it sends a device offline
notification, and the device actively pushes the message to the
platform server. The device pushes the online notification message by
default.

eg, device sends offline notification

{
"operator": "Offline",
"info":
{ "facesluiceId":"1305433",
"time":"2020-03-07 14:09:47"
}
}

You might also like