As I just mentioned on the discuss list:
We now have elevator access control.
The main changes are:
doorman.py and portal.html now has code to enable the downstairs elevator call button. it does so for 20 seconds if you use the "unlock elevator" button and for 40 seconds if you do "open outside door" (it of course still opens the outside door).
opendoor.py now sends an https request to
door.sudoroom.org to unlock the elevator button for 40 seconds after the 5 second outer door unlock sequence. This means that all code depending on opendoor.py should now also unlock the elevator for 40 seconds.
Here's how it works:
A relay is hooked to the elevator call button on the ground floor. It is inside of the wall. I spliced the relay into the intercom cable, since there were some wires in that cable that weren't being used anyway. Two of those wires now connect the relay to a 12 volt power supply in the bottom left of the server/bio closet upstairs and via a mosfet to the raspberry pi (tamale). It is also connected to a manual override just outsider of the sudo room main door.
When GPIO pin 11 is set to high on tamale, then if the switch outside the space is set to "access control enabled", the relay is triggered and the elevator call button on the ground floor will be _disabled_.
If GPIO pin 11 is set to low, or the manual override is toggled to "access control disabled", or the raspberri pi is off, or something gets disconnected, then the call button will function as normal.
Again: The relay is default closed, so if no power is applied the elevator works as normal.
The mosfet is screwed into the wall to the left of tamale.
A couple of things that need changing:
I had to change the /etc/init.d/doorman script to run the doorman.py webserver as root since the python GPIO library wouldn't work otherwise. If someone has a good idea for how to fix this, please do so!
I hardcoded a password in opendoor.py in the sudodoor project (don't
worry i didn't commit it with a correct password). It's late and I want
to go home. Sorry.
Thank you and good night.
--
Marc Juul