Difference between revisions of "Omegix/USB Auth 1.7"
From Makers Local 256
m (→Troubleshooting: added notes) |
(→Troubleshooting: added next i2c troubleshooting attempt idea) |
||
Line 25: | Line 25: | ||
ioctl(self.fd, I2C_RDWR, addressof(ioctl_arg)) | ioctl(self.fd, I2C_RDWR, addressof(ioctl_arg)) | ||
** Reason for issue: https://groups.google.com/forum/#!msg/quick2wire-users/BQ6mZRWaxgo/VFB6LUXuabMJ | ** Reason for issue: https://groups.google.com/forum/#!msg/quick2wire-users/BQ6mZRWaxgo/VFB6LUXuabMJ | ||
− | * | + | * Problem Description: hubcitylab's poll.py script works on Rev1 RasbPi, doesn't work on Rev2 |
+ | ** Attempted solutions: | ||
+ | **# Tried rolling back to an earlier Rasbian image. Did not solve. | ||
+ | **# Need to Try: Looks like in the py532lib when calling quick2wire's I2CMASTER class, the py532.i2c initalization method is passing an initialization variable of "0x00" or "0x01" While the quick2wire.i2c's I2CMASTER initialization method is expecting "0" or "1" (basically the character and not the hex version of the character). Suspicion is that the code always worked on the Rev1 board because even though the default being passed is 0x01, the I2CMASTER class always receives "0". | ||
== Resources == | == Resources == |
Revision as of 14:42, 29 May 2013
Creator: |
Contents
[hide]Overview
- RaspberryPi
- Running Rasbpian
- ssh raspberrypi.local
- Running Rasbpian
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
Troubleshooting
- 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
- Attempted solutions:
- Tried rolling back to an earlier Rasbian image. Did not solve.
- Need to Try: Looks like in the py532lib when calling quick2wire's I2CMASTER class, the py532.i2c initalization method is passing an initialization variable of "0x00" or "0x01" While the quick2wire.i2c's I2CMASTER initialization method is expecting "0" or "1" (basically the character and not the hex version of the character). Suspicion is that the code always worked on the Rev1 board because even though the default being passed is 0x01, the I2CMASTER class always receives "0".
- Attempted solutions:
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
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
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