2022-04-02 18:14:21 +00:00
|
|
|
# GoDoor
|
|
|
|
|
2023-08-26 18:20:37 +00:00
|
|
|
Go rewrite of [kdoorpi](https://git.k-space.ee/arti/kdoorpi). Uses
|
|
|
|
[libgpiod](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/)
|
|
|
|
native Go library to access the general purpose pins in cross platform way.
|
2022-04-02 18:14:21 +00:00
|
|
|
|
2023-08-26 18:20:37 +00:00
|
|
|
# Developing
|
2022-04-02 18:14:21 +00:00
|
|
|
|
2023-08-26 18:20:37 +00:00
|
|
|
Either build directly on Raspberry Pi or build locally and copy the binary
|
2022-04-02 18:14:21 +00:00
|
|
|
|
2023-08-26 18:20:37 +00:00
|
|
|
```
|
|
|
|
GOOS=linux GOARCH=arm64 go build
|
|
|
|
scp godoor rpi4b:
|
|
|
|
```
|
2022-04-02 18:14:21 +00:00
|
|
|
|
2023-08-26 18:20:37 +00:00
|
|
|
# Deployment
|
2022-04-02 18:14:21 +00:00
|
|
|
|
2023-08-26 18:20:37 +00:00
|
|
|
The CI system should automatically build docker image and push it to [Harbor](https://harbor.k-space.ee)
|
|
|
|
|
|
|
|
Refer to
|
|
|
|
[Ansible playbook](https://git.k-space.ee/k-space/kube/src/branch/master/ansible-doors.yml)
|
|
|
|
on how to deploy on all door controllers
|
|
|
|
|
|
|
|
# Usage
|
|
|
|
|
|
|
|
For end users door can be opened by:
|
|
|
|
|
|
|
|
* [Web interface](https://inventory.k-space.ee/m/doorboy)
|
|
|
|
* Push button
|
|
|
|
* Enrolling keyfob and swiping keyfob at door cardreader
|
|
|
|
* Issuing `/open-...-door` command in #members channel
|
|
|
|
|
|
|
|
For emergency cases:
|
|
|
|
|
|
|
|
* Log into door controller via SSH and issue `killall -sUSR1 godoor`
|
2024-08-29 10:05:38 +00:00
|
|
|
|
|
|
|
# Door system architecture
|
|
|
|
|
|
|
|
* Web UI / Slack commands - https://git.k-space.ee/k-space/inventory-app
|
|
|
|
* Card List provider - https://git.k-space.ee/k-space/doorboy-proxy
|
|
|
|
|
|
|
|
```
|
|
|
|
┌──────────────┐
|
|
|
|
┌──────────────────┐ │ Card Reader │ ...
|
|
|
|
│ Slack /open-door │ └───────┬──────┘
|
|
|
|
└─────────────────┬┘ │
|
|
|
|
│ ┌──────────────┐
|
|
|
|
┌──────────────┐ │ ┌────│ RPI/w godoor │ ...
|
|
|
|
│ Web Open door│ │ │ └──────────────┘
|
|
|
|
└─────────┬────┘ │ │Swipe ▲
|
|
|
|
│ │ │Event │ Open event
|
|
|
|
▼ ▼ ▼ │ Card list
|
|
|
|
┌───────────────┐ ┌─────────┴─────┐
|
|
|
|
│ inventory-app │ │ doorboy-proxy │
|
|
|
|
│ doorboy.py │ └───────────────┘
|
|
|
|
└───────────────┘ ▲
|
|
|
|
│ │
|
|
|
|
│ │
|
|
|
|
│ ▼
|
|
|
|
│ ┌───────────┐
|
|
|
|
└──────────►│ MongoDB │
|
|
|
|
└───────────┘
|
|
|
|
```
|
|
|
|
|
|
|
|
https://asciiflow.com/ diagram
|