Door Access Pi: Difference between revisions

From Leeds Hackspace Wiki
Jump to navigation Jump to search
No edit summary
(Add instructions to see if the daemon is running)
Line 21: Line 21:


sudo systemctl restart notdoord
sudo systemctl restart notdoord
</code>
==== See if the daemon is running ====
If the daemon is running, the output of this command will include the text "Active: active (running)"
<code>
systemctl status notdoord
</code>
</code>


Line 63: Line 70:
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 <code>/opt/notdoord</code>.
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 <code>/opt/notdoord</code>.


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 daemon is configured to run by a systemd service, called "notdoord", 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 <code>/etc/systemd/system/notdoord.service</code>.
The definition of the systemd service is at <code>/etc/systemd/system/notdoord.service</code>.

Revision as of 19:39, 6 August 2017

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).

The intent is that eventually this Pi won't be responsible for storing the membership cards access list, and that it will obtain that list from another server/service.

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

See if the daemon is running

If the daemon is running, the output of this command will include the text "Active: active (running)"

systemctl status 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, called "notdoord", 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.