Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfid_door_system [2016/02/29 21:04]
John Benedetto
rfid_door_system [2016/05/23 03:42] (current)
Adric Menning [System Schematic]
Line 3: Line 3:
 ===== Overview ===== ===== Overview =====
  
-Quelab now has an electronic sign-in system for members. There's a hom^H^H^H Quelab-made system with an RFID reader in the window to the left of the front door, and we'll be giving everybody RFID keys. +Quelab now has an electronic sign-in system for members. There's a hom^H^H^H Quelab-made system with an RFID reader in the window to the left of the front door, and we'll be giving everybody RFID keys.
  
 ===== Signing In ===== ===== Signing In =====
Line 14: Line 14:
  
 Besides logging electronic sign-ins, the system also logs when the door is locked and unlocked (using the door code, the knob inside, or the RFID system) and opened and closed. It also has a network connection, so we can get daily reports of sign-ins for accurate accounting of Quelab member traffic, set it to make noises or email the facilities manager if the door is left open or remains unlocked after 10pm, etc. Besides logging electronic sign-ins, the system also logs when the door is locked and unlocked (using the door code, the knob inside, or the RFID system) and opened and closed. It also has a network connection, so we can get daily reports of sign-ins for accurate accounting of Quelab member traffic, set it to make noises or email the facilities manager if the door is left open or remains unlocked after 10pm, etc.
- 
  
 ---- ----
  
-Technical information can be found on the [[officers:rfid_access_system | RFID Access System ]] page, only accessible by Officers.+===== Maintenance ===== 
 + 
 +==== Member Maintenance ==== 
 + 
 +For Geoff, or whoever registers new members: 
 + 
 +    * The system automatically records every RFID key it reads. 
 +    * When new members sign up, give them keys, then edit the database to assign their names to the keys and mark the keys as authorized for entry. 
 +    * When members fail to pay their monthly fees, mark their keys as unauthorized. When members lose their keys, mark the keys as unauthorized, and issue new ones. 
 + 
 +==== Registering a New Key ==== 
 + 
 +    * Hold the key in front of the reader. You'll get a red light. 
 +    * On the sign-in laptop, press ctrl-alt-F7. 
 +    * Log in with username doorctrl. There's a database editor already running. 
 +    * Select the RFID_tags table, and select the row with the tag number that matches what's printed on the key. 
 +    * Enter the member's name in the username field 
 +    * change the authorized field from 0 to 1 
 +    * Select the Events_24hrs table, then Press the WRITE CHANGES button near the top. 
 +    * Move the mouse to the terminal window at the bottom, press the keyboard up arrow to select the xscreensaver lock command from the command history, and press enter to lock the console for doorctrl. 
 +    * Press ctr-alt-F5 to switch back to the display of sign-ins during the past 24 hours (it runs under username quelab, and remains unlocked even when you lock doorctrl). 
 +    * Have the member try the key, and make sure he gets a green light and his name appears on the display. 
 + 
 +<WRAP round important>**VERY IMPORTANT** 
 + 
 +    * after making any edits, you MUST press WRITE CHANGES in the database editor. 
 +    * All RFID keys are disabled while you're editing the database until you write the changes. 
 +    * If you get a flashing yellow light but no red or green light when you try a key, check whether the WRITE CHANGES button is enabled, which means you have unwritten changes. 
 + 
 +</WRAP> 
 + 
 +If you need to register multiple keys, you can hold them all in front of the reader one at a time, then authorize them all and enter all the usernames, then write all the changes at once, to save time. You can also log in to the laptop on the network with username doorctrl and edit Quelab_entrance_public.db using whatever editor you want. Do that also if you want to automate revocation of authorization for lack of payment. 
 + 
 +===== Technical Details ===== 
 + 
 +The obsolete Thinkpad T43 by the door was buried under junk and had a thick layer of dust on it when I found it in the shop last week. It now serves several useful functions: 
 + 
 +    * A display to replace the paper sign-in sheets, so everybody can still see who signed in during the past 24 hours 
 +    * A battery back-up for the RFID entry system 
 +    * The access control database 
 +    * A database editing terminal 
 +    * The network interface 
 + 
 +It's configured to allow public read-only access to the database. Log in to the laptop((hostname is Quelabdoor)) , and read the Sqlite3 database file /home/doorctrl/rfid_iface_arduino/Quelab_entrance_public.db using sqlitebrowser or whatever else. Editing requires logging in with username doorctrl and a password that I'm giving to Geoff.  ((This password will need to be added to the SYSTEMS password spreadsheet on the Google Drive)) 
 + 
 +In addition to the ID that's printed on the key and transmitted to the RFID readereach key also has a code that's transmitted to the reader but //not//   printed on the key. Our system stores the code in Quelab_entrance_secret.db, which is readable only under username doorctrl, and verifies the code when reading a tag. This means if you try to clone a key just from the printed ID, you won't have the right code, and the system will detect that the key is counterfeit. The table Counterfeits_read records what its name says, and presumably we'll want the system to email the facilities manager if anything ever appears in it. 
 + 
 +Source code for the Arduino firmware, the host computer's control program, and the display program are in /home/doorctrl/rfid_iface_arduino/ and are publicly readable. I'll draw a schematic for the hardware, maybe later today. I jerry-rigged a temporary contact switch last night for detecting when the door is open, but Anders is going to replace it with something less embarrassing. However, the scotch tape on the circuit board is intended to be permanent because scotch tape is awesome. Every Arduino I've ever built into anything, including my keyboard, is still held in place with scotch tape. Scotch tape is in fact far better than Arduinos, though that isn't saying much.
  
 +==== System Schematic ====
 +{{:quelab_rfid_entry_system_schematic.jpg?200|}}