├── .gitignore
├── LICENSE
├── README.md
├── forge.config.js
├── package.json
├── src
├── main
│ ├── index.js
│ ├── modules
│ │ └── recognition.js
│ └── sensor
│ │ └── recognition.py
└── renderer
│ ├── images
│ ├── revregistration.png
│ └── wrongfinger.png
│ ├── index.html
│ ├── index.js
│ ├── locales
│ ├── en.js
│ └── pl.js
│ ├── modules
│ └── recognition.js
│ ├── preload.js
│ └── style.css
├── webpack.main.config.js
├── webpack.renderer.config.js
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | out
3 | .webpack
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Filip Drozd
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Registration of presence using fingerprints.
4 |
5 |
6 | ## Table Of Contents
7 | - [Hardware](#hardware)
8 | - [Installation](#installation)
9 | - [XServer](#xserver)
10 | - [LCD screen](#lcd-screen)
11 | - [Fingerprint sensor](#fingerprint-sensor)
12 | - [RevRegistration](#revregistration)
13 | - [Configuration](#configuration)
14 | - [Server api](#server-api)
15 |
16 | ## Hardware
17 | 
18 | #### Components that you need to create a device:
19 | - Raspberry Pi 3 B+
20 | - Fingerprint sensor
21 | - USB - UART converter
22 | - 3.5 inch TFT LCD display
23 |
24 | ## Installation
25 | First you need to [install Raspbian Lite](https://www.raspberrypi.org/documentation/installation/installing-images/) and update it.
26 | ### XServer
27 | Then set up your Raspberry Pi as a Kiosk. [This](https://www.youtube.com/watch?v=I2laR5G5FFo) video explains how to do it exactly and below are the commands:
28 | ##### Install [xserver](https://en.wikipedia.org/wiki/X.Org_Server) so that Raspbian can display graphical interface:
29 | ```
30 | ~$ sudo apt install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox
31 | ```
32 | ##### Run xserver at system startup - add to the file: **/home/pi/.profile**
33 | ```
34 | [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor
35 | ```
36 | ##### Add the following lines to the **/etc/xdg/openbox/autostart** file to disable the screensaver.
37 |
38 | ```
39 | xset s off
40 | xset s noblank
41 | xset -dpms
42 | ```
43 | ### LCD screen
44 | For the screen we advise you to use the [LCD-show](https://github.com/goodtft/LCD-show) driver developed by goodtft. For more details visit the github repo. For the 3.5" display the commands are as follows:
45 | ```
46 | ~$ git clone https://github.com/goodtft/LCD-show.git
47 | ~$ chmod -R 755 LCD-show
48 | ~$ cd LCD-show/
49 | ~$ sudo ./LCD35-show
50 | ```
51 | ##### To make the xserver work on the display you need to install the following driver:
52 | ```
53 | ~$ sudo apt install xserver-xorg-video-fbturbo
54 | ```
55 | And change it's config file: **/usr/share/X11/xorg.conf.d/99-fbturbo.conf** by setting the **fbdev** option to **/dev/fb1** (second frame buffer - your TFT display).
56 | ```
57 | Option "fbdev" "/dev/fb1"
58 | ```
59 | By default it is set to **/dev/fb0** (first frame buffer - HDMI).
60 | ### Fingerprint sensor
61 | To operate the fingerprint sensor RevRegistration uses the Python library called [pyfingerprint](https://github.com/bastianraschke/pyfingerprint) developed by Bastian Raschke. Check it out for more details on how to set it up. Also make sure to install the Python 3 version. Here are the commands:
62 | ```
63 | ~$ sudo apt-get install git devscripts equivs
64 | ~$ git clone https://github.com/bastianraschke/pyfingerprint.git
65 | ~$ cd ./pyfingerprint/src/
66 | ~$ sudo mk-build-deps -i debian/control
67 | ~$ dpkg-buildpackage -uc -us
68 | ```
69 | ```
70 | ~$ sudo dpkg -i ../python3-fingerprint*.deb
71 | ~$ sudo apt-get -f install
72 | ```
73 | ```
74 | ~$ sudo usermod -a -G dialout pi
75 | ~$ sudo reboot
76 | ```
77 | For now, if you want to enroll a new finger you have to do it manually by running the **example_enroll.py** script.
78 | ### RevRegistration
79 | Now you are ready to install the RevRegistration app. First you have to build it using node.js and yarn (we recommend doing this on your desktop). You can download node.js with npm [here](https://nodejs.org/en/download/) and optionally yarn [here](https://yarnpkg.com/en/docs/getting-started).
80 | ##### Clone the repository:
81 | ```
82 | ~$ git clone https://github.com/fpdrozd/revregistration-raspberry.git
83 | ```
84 | ##### Install dependencies
85 | ```
86 | ~$ cd revregistration
87 | ~$ yarn
88 | ```
89 | ##### Build the package
90 | ```
91 | ~$ yarn make
92 | ```
93 | This might take a few minutes.
94 |
95 | ##### When it's done you need to copy the Debian package to your Raspberry Pi:
96 | ```
97 | ~$ scp out/make/revregistration*.deb pi@192.168.0.100:/home/pi/
98 | ```
99 |
100 | ##### Then install the package:
101 | ```
102 | ~$ sudo dpkg -i revregistration*.deb
103 | ```
104 | ##### Install missing dependencies:
105 | ```
106 | ~$ sudo apt -f install
107 | ```
108 | And the installation is completed.
109 |
110 | ## Configuration
111 | The application is accessible in the system by the following command:
112 |
113 | ```
114 | ~$ revregistration
115 | ```
116 | You need to add it to the **/etc/xdg/openbox/autostart** file with the proper parameters. For example:
117 | ```
118 | revregistration --lang en --api_host https://example.com --api_path /registration --raspberry_pwd !@#$%^& --sensor_id UNIQUE-USB-DEVICE-ID
119 | ```
120 | #### Here is a description of all parameters:
121 |
122 |
123 |
124 |
Option
125 |
Default
126 |
Description
127 |
128 |
129 |
130 |
lang
131 |
en
132 |
Interface language. Possible values are: en, pl
133 |
134 |
135 |
api_host
136 |
none
137 |
The hostname of your api.
138 |
139 |
140 |
api_path
141 |
none
142 |
A path to your api.
143 |
144 |
145 |
raspberry_pwd
146 |
none
147 |
A password that will be used to authenticate your Raspberry Pi against the server.
148 |
149 |
150 |
sensor_id
151 |
none
152 |
A unique id of your uart converter that can be fined under the /dev/serial/by-id/ directory.
153 |
154 |
155 |
156 | ## Server api
157 | For the system to work correctly you need a server with some kind of database that will store and manage all the presences. Lets suppose that your server is running under the **https://example.com/registration**.
158 | ### Requests
159 | When the application starts up it's first trying to fetch all the users by requesting the **https://example.com/registration/api/raspberry/fetch**. In response it expects a JSON data in the following form:
160 | ```
161 | {
162 | data: [
163 | { email: 'peter@gmail.com', firstName: 'Peter', lastName: 'Griffin', department: 'sales', fingerprintIds: [0, 1] },
164 | { email: 'brian@gmail.com', firstName: 'Brian', lastName: 'Griffin', department: 'accounting', fingerprintIds: [2, 3] }
165 | ...
166 | ]
167 | }
168 | ```
169 | ### Socket.io
170 | Then it's trying to connect to the Socket.io server under the **https://example.com/registration/api/socket.io**.
171 | #### Here is the comprehensive list of all the Socket.io events:
172 |
173 |
174 |
175 |
176 |
Event name
177 |
Description
178 |
179 |
180 |
181 |
newPresence
182 |
It's triggered when the person places a finger and the fingerprint is recognized. It comes with the JSON object in the following form: { email: 'peter@gmail.com', department: 'sales' }