Difference between revisions of "Omegix/USB Auth 1.7"
From Makers Local 256
(→Overview: added materials for project) |
(→Materials: added more materials) |
||
Line 19: | Line 19: | ||
* USB Power Supply | * USB Power Supply | ||
* Ethernet Cable | * Ethernet Cable | ||
+ | * Authetication Devices | ||
+ | ** NFC Badge (for positive identification testing) | ||
+ | ** NFC Badge (for negative identification testing) | ||
+ | ** USB Memory Stick Badge (for positive identification testing) | ||
+ | ** USB Memory Stick (for negative identification testing) | ||
= Setup = | = Setup = |
Revision as of 21:49, 14 September 2013
Creator: |
Contents
[hide]Overview
- RaspberryPi
- Running Rasbpian
- ssh raspberrypi.local
- Running Rasbpian
Materials
- Raspberry Pi
- 16GB SD Memory Card
- GPIO Breakout board
- Jumper Wire (For bringing a direct connection from the pre-regulated 5V rail to the GPIO breakout board for powering the NFC and Relay board.)
- Relay board
- NFC \ RFID Board
- USB Power Supply
- Ethernet Cable
- Authetication Devices
- NFC Badge (for positive identification testing)
- NFC Badge (for negative identification testing)
- USB Memory Stick Badge (for positive identification testing)
- USB Memory Stick (for negative identification testing)
Setup
Steps Taken
- Installed Raspbian on a 16GB SD memory card
- Followed this guide to get I2C available
- Used this article to determine that I had a 256MB Model B RaspberryPi. This is important, because when checking i2cdetect I have to use "-y 0" instead of the "-y 1".
- This article is good too, it mentions to add the pi user to the i2c group so you don't have to run sudo all the time.
- http://www.skpang.co.uk/blog/archives/575
- sudo adduser pi i2c
- Wiring
- The raspberry pi has a voltage regulator that limits amperage consumption to 700ma. This was not enough to power the NFC reader and relay board from the GPIO, as well as have a USB inserted in the raspberry pi at the same time. To solve this problem I put a jumper wire from the high side of the regulator on the raspberry pi to the daughter board where the relay board and NFC reader board are connected for power.
Troubleshooting
- Was getting some bad errors "journal" errors when plugging in the usb stick. Power supply couldn't power the NFC reader, relays, and read usb at the same time. 800ma Was not enough. Need to figure out what the amp limits are on the traces for the raspberry pi
- Ran into this error when running DannyO's (hubcitylabs) poll.py script:
quick2wire/i2c.py", line 72, in transaction
ioctl(self.fd, I2C_RDWR, addressof(ioctl_arg))
- Problem Description: hubcitylab's poll.py script works on Rev1 RasbPi, doesn't work on Rev2
- Solution: py532.i2c.py is hard coded to use "0" as the i2c_channel. This needs to be updated to "1" for Rev2 boards, or better yet, have it check which bus is in place and use the correct I2C bus location via detection.
- Better Solution: the libraries downloaded with the git clone of the hikaru-gatekeeper are not the latest. make sure to download the latest libraries (quick2wire, py532, possibly others) independently to get code that will work on Rev2 raspberry pi boards
- Rooted Galaxy S3, NFC reader still does not see phone. Mog suggested that an application might have to be running that will broadcast the NFC ID. --Omegix (talk) 21:13, 31 July 2013 (CDT)
- When running NDEF Tools on my rooted (may not matter) GS3, the NFC ID was broadcast.
- The Galaxy S4 (Four) writes a different NFC tag each scan.
Resources
- http://hubcitylabs.org/nfc-on-raspberrypi-with-pn532-py532lib-and-i2c/
- http://www.ebay.de/itm/Cooqrobot-PN532-NFC-RFID-Reader-Writer-Module-starter-kits-with-tags-For-Arduino-/161010274918?pt=Wissenschaftliche_Ger%C3%A4te&hash=item257cf5d266
- http://www.hobbytronics.co.uk/raspberry-pi-raspbian-distro
- this article goes over how to use the internal pullup\pulldown resistors on the pi: https://github.com/quick2wire/quick2wire-gpio-admin/blob/master/README.md
- this could be useful if we want to put a local LDAP on the raspberry pi vs. a whitelist:
Python Approach
- usbScan.py
- Script will continuously scan for new USB devices, and call ldap Check. If ldap check successful, call DoorUnlock.
- nfcScan.py
- same as usbScan.py, except for NFC (and RFID)
- ldapCheck.py
- Take in value, see if it's in the LDAP
- DoorUnlock.py
- Throw pins high and low on the GPIO to trigger relays that will be tied to a powerbolt1000.
- Monitor pins wired to reed switches to ensure door is closed before re-locking.
- Pin Assignments
- Relay for Door Unlock (IN1 on Keyes Relay Board): #23 on GPIO
- Relay for Door Lock (IN2 on Keyes Relay Board): #24 on GPIO
- ScanReedSwitch
- Pin Assignments: #25 on GPIO
- Willie IRC Bot Framework
- install from github, tarball may not be latest
- Install Dependencies: sudo apt-get install python-lxml python-mysqldb python-tweepy python-feedparser python-enchant; sudo pip install pytz praw
- run sudo ./setup install to install modules
- install from github, tarball may not be latest
Perl Approach
- Would have to write an PN532 driver in perl
- Alternatively have perl call python scripts, python already has a PN532 driver written
- Write a new ackis module for NFC monitoring