Skip to content

Latest commit

 

History

History
65 lines (48 loc) · 1.5 KB

README.md

File metadata and controls

65 lines (48 loc) · 1.5 KB

Access control app with a visual 8X8 Led display written in golang and Raspberry PI

alt tag

consist of a scanner reader and udp server listener

  • The scanner scans an image and send the raw ASCII to an access control server for a check
  • The opener is an UDP server listener which will trigger a pin output based on a string received on the socket

Install binaries so that the systemd service manager runs them as a service

GOBIN=/usr/local/bin go install opener.go
GOBIN=/usr/local/bin go install scanner.go

Restart the services to run the latest installed files

systemctl restart opener
systemctl restart scanner

Service config files

/lib/systemd/system/scanner.service

[Unit]
  Description=Scanner Reader

  [Service]
  ExecStart=/usr/local/bin/scanner 127.0.0.1:2002
  ExecStartPre=/bin/sleep 5
  Restart=always
  RestartSec=10

  [Install]
  WantedBy=multi-user.target

/lib/systemd/system/opener.service

[Unit]
  Description=Door Control listener

  [Service]
  ExecStart=/usr/local/bin/opener 2001
  Restart=always
  RestartSec=1

  [Install]
  WantedBy=multi-user.target

Service start on boot

systemctl enable opener
systemctl enable scanner

Check the service logs

journalctl -u scanner -u opener -f --since "2017-06-01 17:15:00"
-u unit name(service) , -f follow

log rotating and log size is all handled automaticaly by journald

Prerequisites

The 8X8 Led display is connected to the SPI port so this must be enabled using the `raspi-config`