Project:Door Entry System

The door entry system is based around the idea of individual blocks connected via a central bus. The bus in this case is the MQTT publish/subscribe mechanism (powered by the excellent Mosquitto server) and each "client" on the system having it's own namespace to publish/subscribe to.

Hardware
The system is built on Arduino ethernets. The back door uses an SM130 module and shield, the front door uses an RDM880 based board.

The pin assignments for the back door are:

Arduino Side
The Arduino code can be found on Launchpad but needs some better comments in order to make it more accessible.

The code connects to the MQTT server and the serial interface of the SM130 chip. It then works in a loop of asking the SM130 to scan for a card and running the MQTT main loop.

The Arduino subscribes to the following MQTT topics:
 * /hackspace/authorisation/fail
 * /hackspace/{front/back}door/lock

When it receives a message on the authorisation/fail topic, it fires of the authorisation fail blink code. If the Arduino receives the character "0" (ASCII 48) on the topic {front/back}door/lock it will unlock the door for 5 seconds and bring the LED on full.

Server Side
The server side code is written in python and is available on Launchpad.

The code currently relies on a MySQL database running on a server in the space. This will be sync-ed up to the VPS every few hours or so.

LED Blink Codes
There are 3 blink codes that you need to be aware of.

Logging
The door system is currently logging to a MicroSD card that is plugged into the door reader. The log is a CSV file that is laid out in the following manner:

The Number of milliseconds since the arduino started (or since the last rollover period), the amount of free memory (in bytes), a number indicating the position in the program

Position 0 is in the setup routine, and this can be treated as the arduino being restarted.

Should the door lock fail, once the system has been restared, please email this log file to Matt (compressed preferably!) so we can troubleshoot the issue.