A Tessel powered RFID doorlock for the space, interfacing with Cobot
Go to file
2018-09-01 17:28:56 -07:00
public old logger was blocking indefinitely. made new logger. 2018-09-01 15:59:11 -07:00
scripts Add some helper scripts 2018-08-12 14:19:31 -07:00
src less logging 2018-09-01 17:25:09 -07:00
.editorconfig A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
.env.example Update .env.example 2018-08-12 13:52:00 -07:00
.eslintignore A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
.eslintrc.yml Add start of doorlock server 2018-07-10 14:47:07 -07:00
.gitignore old logger was blocking indefinitely. made new logger. 2018-09-01 15:59:11 -07:00
.npmrc A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
.nvmrc Add start of doorlock server 2018-07-10 14:47:07 -07:00
.prettierignore A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
.prettierrc A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
autostart add autostart and documentation 2018-09-01 17:28:56 -07:00
cobot.js Simplify code, get scanning working 2018-06-16 20:37:46 -07:00
cobot.test.js Simplify code, get scanning working 2018-06-16 20:37:46 -07:00
constants.js Cleanup constants 2018-08-12 13:51:14 -07:00
doorlock.js Fetch cards from Cobot, log access 2018-07-10 16:25:05 -07:00
doorlock.test.js Simplify code, get scanning working 2018-06-16 20:37:46 -07:00
jest.config.js A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
nexudus.js Simplify code, get scanning working 2018-06-16 20:37:46 -07:00
nodemon.json Ignore .json files in nodemon 2018-08-12 13:51:48 -07:00
package-lock.json use real timeouts (10s) 2018-09-01 16:43:26 -07:00
package.json use real timeouts (10s) 2018-09-01 16:43:26 -07:00
readme.md add autostart and documentation 2018-09-01 17:28:56 -07:00
start.sh fine tuning ajax timing, naming, and start script 2018-09-01 12:56:22 -07:00

Chimera Doorlock

Overview

  • Cards are synced with Cobot
  • Cards are stored in cards.json in the root of the project (should be ~/doorlock/cards.json on the RaspberryPi)
  • Logs are stored in logs.json in the root of the project (should be ~/doorlock/logs.json on the RaspberryPi)

TODO

  • Update list of cards every few minutes
  • Push up logs/checkins to management app
  • Get working with Nexedus
  • Handle error message

Configuring Raspberry Pi

On the RPI:

# Change to "sudo" user
sudo su

# Install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

# Install forever
npm i -g forever

# Clone the project and install dependencies
cd ~
git clone https://github.com/chimera/doorlock.git
cd doorlock
nvm install
nvm use
npm install

# Setup environment variables
cp .env.example .env
vi .env
# Add missing environment variables

# Start app
forever start src/server.js

Follow the install from source guide for node-hid becuase there is no pre-built binary for RaspberryPi

npm install -g node-gyp
apt install build-essential git libudev-dev gcc-4.8 g++-4.8 libusb-1.0-0 libusb-1.0-0-dev
export CXX=g++-4.8
npm install node-hid --build-from-source

You should now be able to view the app at http://localhost:3000

Autostart

On a RasPi, copy the contents of the autostart file into: ~/.config/lxsession/LXDE-pi/autostart (presuming you've downloaded this repo to /home/pi/doorlock)

Optionally, to help users with debugging, run ln -s /home/pi/doorlock/start.sh ~/Desktop/start-doorlock.sh to give them a link on the desktop.

Or generally, find some way to run ./start.sh in this folder

Further reading

Contributing

Contributions welcome!

Want to contribute? Submit a Pull Request with your changes!

Using this in your own project? Let us know by creating an issue in Github!

Credits

Developed by Dana Woodman © 2018.

License

MIT