Door Access Pi

From Leeds Hackspace Wiki
Revision as of 18:42, 6 August 2017 by Alex (talk | contribs) (Add details)
Jump to navigation Jump to search

The door access Pi interfaces with the Arduino that controls the main entrance door, allowing membership card data to be synced onto it.

Purpose

Store a list of valid membership cards and syncs them onto the door access Arduino (documented in Marvin P Droid).

Usage/maintenance

Only committee members may access the door Pi due to it containing membership data.

It is accessible on the network as the DNS entry door-pi.lan. SSH credentials are known by committee.

Common Tasks

Edit the list of cards

The cards list is located at /opt/notdoord/cards.dat. Use the text editor of your choice to make changes; be sure to adhere to the file format accurately.

nano /opt/notdoord/cards.dat

sudo systemctl restart notdoord

Restart the notdoord daemon

Restarting the daemon may fix issues if the door appears to be acting weirdly.

sudo systemctl restart notdoord

View notdoord's logs

Since notdoord runs as a systemd unit, the logs are available in the journal:

sudo journalctl -fu notdoord.service

Update notdoord's code

The codebase is checked out as a git repo, so pulling any changes and restarting the daemon should suffice:

cd /opt/notdoord

git pull

sudo systemctl restart notdoord

Reload systemd after changing the notdoord service definition

This should only be necessary if you modify /etc/systemd/system/notdoord.service; there should be very few reasons why this is necessary.

sudo systemctl daemon-reload

sudo systemctl restart notdoord

Software

The door Pi is running a Python 3 daemon notdoord which interfaces with the door Arduino via a USB-to-serial adapter. See the GitHub repo README for more information on how it works.

Setup

The Pi is running Raspbian Lite based on Debian Jessie, and just runs the notdoord daemon, the code for which is checked out as a git repo at /opt/notdoord.

The daemon is configured to run by a systemd service, running under the user/group notdoord. The notdoord user has no login shell, a random password, and no other permissions.

The definition of the systemd service is at /etc/systemd/system/notdoord.service.