Информация |
---|
You need to make sure that the scans folder exists in /home/promobot/ folder. If it is not, then you need to create it under promobot user. |
Working with the Regula passport scanner is carried out via websocket.
After connecting via ws, a message like this will appear (if device is correctly connected): Блок кода |
---|
| {status = -51, description = "Document not detected"} |
How to scan and recognize documentsscan - starts scanning on the device. If the device is working properly and connected, then the method sequentially returns the following statuses: Блок кода |
---|
| {status = 1, description = "Scanner successfully enabled"} |
Блок кода |
---|
| {status = 2, description = "Starting scanning"} |
Блок кода |
---|
| {status = 3, description = "Scanning finish"} |
Блок кода |
---|
| {status = 4, description = "Trustability checking started"} |
Блок кода |
---|
| {status = 5, description = "Trustability checking finish"} |
Upon completion of all stages of scanning and document recognition, you will receive a message like this: Блок кода |
---|
| {
"Scan_White":"/home/promobot/scans/Scan_1.jpg",
"Scan_Photo":"/home/promobot/scans/Scan_Photo.jpg",
"ft_Issuing_State_Code_VISUAL":"RUS",
"ft_Document_Number_VISUAL":"5555555555",
"ft_Date_of_Birth_VISUAL":"01.01.1990",
"ft_Place_of_Birth(1049)_VISUAL":"ГОР. ПЕРМЬ",
"ft_Place_of_Birth_VISUAL":"GOR.PERM",
"ft_Surname(1049)_VISUAL":"ЛАЛЕТИН",
"ft_Surname_VISUAL":"LALETIN",
"ft_Given_Names(1049)_VISUAL":"ДМИТРИЙ",
"ft_Given_Names_VISUAL":"DMITRII",
"ft_Nationality_VISUAL":"Russian Federation",
"ft_Sex(1049)_VISUAL":"МУЖ",
"ft_Sex_VISUAL":"M",
"ft_Surname_And_Given_Names(1049)_VISUAL":"ЛАЛЕТИН ДМИТРИЙ АНДРЕЕВИЧ",
"ft_Surname_And_Given_Names_VISUAL":"LALETIN DMITRII ANDREEVICH",
"ft_Nationality_Code_VISUAL":"RUS",
"ft_Issuing_State_Name_VISUAL":"Russian Federation",
"ft_Document_Series_VISUAL":"5555",
"ft_Fathers_Name(1049)_VISUAL":"АНДРЕЕВИЧ",
"ft_Fathers_Name_VISUAL":"ANDREEVICH",
"ft_Authority_RUS(1049)_VISUAL":"Пермский край",
"ft_Booklet_Number_VISUAL":"555555",
"ft_Age_VISUAL":"26",
"status":100,
"status_description":"finish",
"Doc_Name":"Russian Federation - Passport (2006)",
"Processing_Time":"03.962",
"UV_Luminescence":"ch_Check_Error"
} |
where: "Scan_White" - path to image with white scan ,
"Scan_Photo" - path to the photo of passport holder ,
"ft_Issuing_State_Code_VISUAL" - country in which the passport was issued ,
"ft_Document_Number_VISUAL" ,
"ft_Date_of_Birth_VISUAL" ,
"ft_Place_of_Birth(1049)_VISUAL" ,
"ft_Place_of_Birth_VISUAL" ,
"ft_Surname(1049)_VISUAL" ,
"ft_Surname_VISUAL" ,
"ft_Given_Names(1049)_VISUAL" ,
"ft_Given_Names_VISUAL" ,
"ft_Nationality_VISUAL" ,
"ft_Sex(1049)_VISUAL" ,
"ft_Sex_VISUAL" ,
"ft_Surname_And_Given_Names(1049)_VISUAL" ,
"ft_Surname_And_Given_Names_VISUAL" ,
"ft_Nationality_Code_VISUAL" - code of the country ,
"ft_Issuing_State_Name_VISUAL" - name of the country that issued the document ,
"ft_Document_Series_VISUAL" ,
"ft_Fathers_Name(1049)_VISUAL" ,
"ft_Fathers_Name_VISUAL" ,
"ft_Authority_RUS(1049)_VISUAL" - region ,
"ft_Booklet_Number_VISUAL" - доподлинно неизвестно ,
"ft_Age_VISUAL" ,
"status" - status as a result of scanning and recognition (100 - success, -100 - fail) ,
"status_description" ,
"Doc_Name" - document type ,
"Processing_Time" - time spent on scanning and recognition (in seconds) ,
"UV_Luminescence" - authentication status UV
Информация |
---|
Returned fields can have 2 types of postfix: _VISUAL - these are the fields that were recognized in the visual area of the document _MRZ - these are the fields that were recognized in the machine-readable zone of the document |
killThreads - forced termination of recognition threads. This method is useful in order to terminate recognition threads which are not responding. Implemented in order to restore the software after such error as scanner power failure . This kind of error occurs occasionally and shows up as scanning takes a long time and diodes of illumination of the document area constantly switched on. In software implementation, this behavior can be easily discovered by scan statuses. If the status does not change within ~ 3 seconds, then it is necessary to reboot the scanner by power supply. After successful execution, you will receive a message similar to the following:
Блок кода |
---|
| {status = 311, description = "Zombie thread finished"} |
deleteScans - deletes received scans from the file system. Upon successful execution, it will return following kind of message: Блок кода |
---|
| {status = 303, description = "Files deleted"} |
powerReset - reboot the scanner by power supply (via USB board). At the moment, there are 2 options for reboot. First, via separate controller board that connects to the Windows motherboard, and second by turning off / on the power of Windows Main-board hub. If successful, it will return sequentially: Блок кода |
---|
| {"status":614,"description":"Power disabled -> 00 00 55 \r\n<- 01 A0 A0 \r\n"} |
Блок кода |
---|
| {"status":615,"description":"Power enabled -> 01 00 55 \r\n<- 01 A0 A0 \r\n"} |
Status descriptionJSON Status | JSON Description | Message | Description |
---|
1 | Scanner successfully enabled | {status = 1, description = "Scanner successfully enabled"} | Scanner initialized successfully | -1 | Scanner not connected | {status = -1, description = "Scanner not connected"} | Scanner not connected | 311 | Zombie thread finished | {status = 311, description = "Zombie thread finished"} | Not-responding threads have been successfully destroyed (status is returned when killThreads was called) | -71 | Device is inaccessible | {status = -71, description = "Device is inaccessible"} | Device is inaccessible. Returns when scanning is performed after a power failure. | 303 | Files deleted | {status = 303, description = "Files deleted"} | Files deleted | 51 | Document detected | {status = 51, description = "Document detected"} | The document is on the scanner | -51 | Document not detected | {status = -51, description = "Document not detected"} | No document on scanner | 2 | Starting scanning | {status = 2, description = "Starting scanning"} | Starting scanning | 3 | Scanning finish | {status = 3, description = "Scanning finish"} | Scanning finish | 4 | Trustability checking started | {status = 4, description = "Trustability checking started"} | Trustability checking started | 5 | Trustability checking finish | {status = 5, description = "Trustability checking finish"} | Trustability checking finish | 100 | finish | Will be contained in the general final message (see How to scan and recognize documents) | Scanning and document recognition completed successfully | -100 | Can't recognize fields | Will be contained in the general final message | Could not recognize document and its fields | 614 | Power disabled -> 00 00 55 \r\n<- 01 A0 A0 \r\n | {"status":614,"description":"Power disabled -> 00 00 55 \r\n<- 01 A0 A0 \r\n"} | Power off | 615 | Power enabled -> 01 00 55 \r\n<- 01 A0 A0 \r\n | {"status":615,"description":"Power enabled -> 01 00 55 \r\n<- 01 A0 A0 \r\n"} | Power on |
Checking the operation of the scanner on the robot Информация |
---|
You can test the operation of the connected scanner via Chrome browser plugin (Websocket Test Client) https://chrome.google.com/webstore/detail/websocket-test-client/fgponpodhbmadfljofbimhhlengambbn?hl=ru or using a console client wsdump.py Test algorithm via wsdump.py1. Place wsdump.py into home repository of promobot user on robot 2. Connect to robot via ssh 3. Run following command in terminal: Блок кода |
---|
sudo pip3 install websocket-client |
4. Run following command in terminal: Блок кода |
---|
python3 wsdump.py ws://192.168.250.91:5680 |
5. Send the scan command 6. The successful execution of the command when scanning without a document on the scanner is shown in the screenshot below Image Added sudo pip3 4install websocket-clientsudo pip3 install websocket-client |
Информация |
---|
An extended description of the fields returned when scanning various types of documents is available in the attached file (p. 114). RUS. View file |
---|
name | Programmers Guide (ru).pdf |
---|
height | 150 |
---|
|
|
Информация |
---|
The scanner can be connected in three ways: 1. Relay 2. Separate USB board 3. Windows Main-board hub
Each type of connection uses its own JS-scanning module. |
|