├── README.md ├── package.json ├── rfid.js ├── rfid.png └── rfid2.html /README.md: -------------------------------------------------------------------------------- 1 | # RaspberryPi-RFID-WebLogin 2 | Super simple RFID web login interface using Raspberry Pi and RC522. 3 | 4 | 5 | [Sample Video](https://www.youtube.com/watch?v=v9dAYPJD44M)
6 | [Tutorial](https://www.youtube.com/watch?v=PtKuQf8z7HI) 7 | 8 | License 9 | ------- 10 | The MIT License (MIT) 11 | 12 | Copyright (c) 2015 Luigi Freitas Cruz 13 | 14 | Permission is hereby granted, free of charge, to any person obtaining a copy 15 | of this software and associated documentation files (the "Software"), to deal 16 | in the Software without restriction, including without limitation the rights 17 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | copies of the Software, and to permit persons to whom the Software is 19 | furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in all 22 | copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | SOFTWARE. 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "raspberrypi-rfid-reader", 3 | "version": "1.0.0", 4 | "description": "A HTTP RFID reader for Raspberry Pi.", 5 | "main": "rfid.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node rfid.js", 9 | "preinstall": "wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.35.tar.gz; tar -zxf bcm2835-1.35.tar.gz; cd bcm2835-1.35; ./configure; sudo make install" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/luigifreitas/Raspberry-Pi-RFID.git" 14 | }, 15 | "author": "Luigi Freitas", 16 | "license": "MIT", 17 | "bugs": { 18 | "url": "https://github.com/luigifreitas/Raspberry-Pi-RFID/issues" 19 | }, 20 | "homepage": "https://github.com/luigifreitas/Raspberry-Pi-RFID#readme", 21 | "dependencies": { 22 | "express": "^4.13.4", 23 | "rc522-rfid": "^14.1.10", 24 | "socket.io": "^1.4.5" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rfid.js: -------------------------------------------------------------------------------- 1 | var express = require('express'), 2 | app = express(); 3 | io = require('socket.io').listen("8500"); 4 | var rc522 = require("rc522-rfid"); 5 | 6 | console.log("App successfully launched!"); 7 | 8 | // Create a sample login page @ http://localhost:8000 9 | app.get('/', function(req, res){ 10 | res.sendFile(__dirname + '/rfid2.html'); 11 | }); 12 | 13 | // Everytime you tag in this will be triggered. 14 | rc522(function(rfidSerialNumber){ 15 | io.sockets.emit("rfid", rfidSerialNumber); // Sends the RFID Serial Number through Socket.IO 16 | console.log(rfidSerialNumber); 17 | }); 18 | 19 | app.use('/rfid.png', express.static(__dirname + '/rfid.png')); 20 | 21 | app.listen(8000); // Setup your server port. 22 | -------------------------------------------------------------------------------- /rfid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luigifcruz/Raspberry-Pi-RFID/35b4a280b3a4941c62a0cbdd8fb688c3d4fcfb0b/rfid.png -------------------------------------------------------------------------------- /rfid2.html: -------------------------------------------------------------------------------- 1 | RFID 2 | 3 | 4 | 5 | 6 | 7 | 8 | 70 | 71 | 72 | 73 |
74 |
75 |
76 | Scan your NFC Card. 77 |
78 |
79 | 80 | 81 | 102 | --------------------------------------------------------------------------------