Mr. Kim. Wu
No.: mrkimwu
QQ: 1315371422
In the previous article "Raspberry Pi's Application in ID card verification", I briefly introduced and implemented the function of Raspberry Pi's reading with ID card. However, reading the local machine is far from enough.
The retrieved ID card information is sent to the remote backend server over the network for data query, judgment, and storage.
The following describes how to send the ID card information to a remote backend server over the network and query the ID card storage records through the background management software.
Physical connection diagram:
This article uses the MySQL database
(1) creating databases and data tables
Open MySQL query browser from the MySQL sub-menu in the Start menu, and enter the logon password root.
Right-click Create new schema or press Ctrl + n to create a database. The database name is kimtest.
Run the table creation script to create an idcard table and store the text and photo information of the ID card:
Drop table if exists 'kimtest'. 'idcard ';
Create Table 'kimtest'. 'idcard '(
'Id' int (10) unsigned not null auto_increment,
'Name' varchar (45) not null,
'Addr 'varchar (80) not null,
'Sex 'varchar (10) Not null,
'Idcode' varchar (50) not null,
'Nation' varchar (10) Not null,
'Part' varchar (45) not null,
'Birth' varchar (20) not null,
'Vldf' varchar (20) not null,
'Vldt' varchar (20) not null,
'Photo' blob not null,
Primary Key ('id ')
) Engine = InnoDB auto_increment = 52 defaultcharset = GBK;
CTRL + press enter to execute the above script.
(2) run the access control application server program
Execute the myserver.exe program on the application server, and a DOS-like service window pops up. The service program form is always enabled and minimized. Do not close it. This program is installed on the same computer as the database server. This server adopts the high-performance Concurrency Control Design of iocp and supports concurrent access control over 1000. This program uses the default connection information: Database address: "localhost", account: "root", password: "root", database: "kimtest", Port: 3306
(3) background database query Software
Execute the data library query program pidcard.exe. Click query to display all the latest ID card reading information. Click the relevant record, and a photo of the corresponding person is displayed below.
I. Front-end Controller Software
2.1 view the IP address assigned by the Access Control Panel
If the access control panel is not connected to the monitor, you may not know the IP address automatically assigned to the access control panel Nic or the logon location. Follow these steps to solve the problem.
CIDR Block Scanning
This is the recommended method. There are many network segment scanning tools. We recommend an advanced IP address scanner,ipscan22.exe. : Http://pan.baidu.com/share/link? Consumer id = 3434443053 & UK = 605377859
The software automatically detects the network segment of the computer and determines the scanning range. (For example, if the IP address of the computer is 192.168.1.101 and the scan range is 192.168.1 .*)
Start scanning to view the list of all computers in the same network segment.
The MAC address of this access control card is B8: 27: EB: DD: DF: AA. Find the corresponding IP address based on the MAC address.
Router Query Method
If you have the permission to log on to a vro (such as a home network), you can directly query the IP address assigned by the vro to the access control card on the vro management interface.
2.2 front-end controller card reading display and uploading
Log on to the front-end access control panel. The IP address of the access control panel is the IP address (192.168.20.106 in this example) found in the preceding method. The default logon password is raspberry.
After the front-end control panel is powered on, it automatically runs the ID card reading program interface form, as shown in. When you run the ID card reading software for the first time, set the correct IP address of the access control application server. The default IP address of the server is 192.168.0.9. If the access control application server is successfully connected, the card reading indicator of the front-end ID card reader keeps flashing (from power-on to start reading the ID card takes about one minute, provided that the application server is started and is waiting for the connection status. Please be patient), put your ID card in the sensor area of the reader, the program automatically reads the ID card information, and packs the text and photo information of the ID card, and then automatically sends it to the access control application server through the network, the access control application server then parses the received ID card information according to the corresponding data packet format and maintains it in the idcard data table of the local MySQL database.
The desktop and reading software interfaces of the access control panel are displayed. When you place your ID card, the local reading interface displays the ID card information. The ID card information is sent to the access control application server and database server at the same time.
2.3 On the access control panel, set the IP address of the Access Control Application Server:
Click the first button next to "start" in the status bar, open the "File Manager" of the Access Controller, go to the/home/PI/Kim/exec/directory, double-click the ip.txt file, add a line of IP address at the bottom of the file: 192.168.0.9. Save and exit. Restart the access controller.