Runbook:The Door

From SoMakeIt
Jump to: navigation, search


This runbook describes how to administer the door at the makerspace, that is the NFC card reader and strike, not the space open button or anything else.

The source code for the door is here

You will need to be able to log into Kong and run sudo do administer this.

Contents

Checking if it's working

If the software is running, the LED on the reader will blink one in a while.

To remotely tell if the service is running:

systemctl status doord

To tell if the service is really working

tail -n100 /var/log/syslog

The door will log successful and failed authentications. Failures are often seen when people hold their tag up for too short a time for example. The log is pretty much English, check the source if you want more details.

Manually opening the door

The gpio controls in /sys/class/gpio/... do not work!

This python script will open the door:

#!/usr/bin/env python2

import RPi.GPIO as gpio
import time
import signal

DOOR_IO = 7

def open_door():
    gpio.setmode(gpio.BOARD)
    gpio.setup(DOOR_IO, gpio.OUT)
    gpio.output(DOOR_IO, gpio.HIGH)
    print "Door is open, ctrl-c to close."

def close_door(signum, frame):
    gpio.output(DOOR_IO, gpio.LOW)
    print "Door is closed."

signal.signal(signal.SIGINT, close_door)
signal.signal(signal.SIGTERM, close_door)
open_door()
time.sleep(60)
close_door(None, None)

Registering a new tag

There is a brown envelope in the letterbox for this, scan it on the reader than HOLD a blank tag STILL on the reader until the light is no longer solid. Now there is a new tag listed in [settings/rfid-tags the members area], just assign it to the member who needs the tag.

If the tag does not appear in the list, write the time and date on an envelope and put it inside it. The tag may have been partially locked, but in the event of failures, the keys intended to be used for the tag are written to the syslog, so the tag can be erased and re-used.

If the tag doesn't work after being assigned, check that the member is a keyholder, then try "Forcing a refresh from the members area" below.

Unregistering a tag

Tags cannot be un-programmed, they may be re-assignable in the members area in future. To revoke access, remove the registered user's keyholder role.

Forcing a refresh from the members area

This is done if you want to force the door to read the members and tags from the members area. It does so periodically, but the process can fail sometimes, failures are logged.

Scan the other brown envelope in the letterbox and wait a few seconds.

Installing or updating the software

The software is a check-out of the git repo in /opt/somakeit/door-controller2/, the example systemd service is extracted to the correct location in /etc/ and filled in. I typically only install the most recent "release" on github. If I update the door at So Make It, I tag a new release. :-)

The SD card is read only, before altering you will need to:

mount -o remount,rw /

and afterward you should

mount -o remount,ro /

There is a config file called /opt/somakeit/door-controller2/dooorc that currently contains:

{
    "api_key": "GET_THIS_FROM_THE_MEMBERS_AREA",
    "server_url": "https://members.somakeit.org.uk/rfid-tags",
    "init_tag_id": "88046609",
    "pull_db_tag_id": "88046509",
    "keyholder_role_id": 5,
    "member_role_id": 4,
    "location_name": "DOOR1"
}
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
Donate