2018-03-03 21:28:55 +00:00
|
|
|
# Chimera Doorlock
|
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
## TODO
|
2018-03-03 21:59:07 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
- [ ] Update list of cards every few minutes
|
|
|
|
- [ ] Push up logs/checkins to management app
|
|
|
|
- [ ] Handle error message
|
2018-03-04 22:35:02 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
## Configuring Raspberry Pi
|
2018-03-04 22:37:03 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
On the RPI:
|
2018-03-04 22:35:02 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
```bash
|
|
|
|
# Install nvm
|
|
|
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
|
2018-03-03 21:28:55 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
# Install the USB relay driver
|
|
|
|
# sudo apt-get install usbrelay
|
2018-03-03 21:28:55 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
# Install forever
|
|
|
|
npm i -g forever
|
2018-03-03 21:28:55 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
# Clone the project and install dependencies
|
|
|
|
cd ~
|
|
|
|
git clone https://github.com/chimera/doorlock.git
|
|
|
|
cd doorlock
|
2018-03-03 21:30:38 +00:00
|
|
|
nvm install
|
|
|
|
nvm use
|
|
|
|
npm install
|
2018-03-03 21:28:55 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
# Setup environment variables
|
|
|
|
cp .env.example .env
|
|
|
|
vi .env
|
|
|
|
# Add missing environment variables
|
2018-03-03 21:28:55 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
# Start app
|
|
|
|
forever start src/server.js
|
2018-03-03 21:28:55 +00:00
|
|
|
```
|
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
You should now be able to view the app at
|
2018-03-03 21:30:38 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
Place this at the bottom of your `~/.bashrc` file:
|
2018-03-03 21:28:55 +00:00
|
|
|
|
|
|
|
```bash
|
2018-08-12 20:53:40 +00:00
|
|
|
forever start ~/doorlock/src/server.js
|
|
|
|
chromium-browser --kiosk localhost:3000
|
2018-03-03 21:28:55 +00:00
|
|
|
```
|
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
## Further reading
|
2018-03-03 21:28:55 +00:00
|
|
|
|
2018-08-12 20:53:40 +00:00
|
|
|
- [USB Relay librar](https://github.com/darrylb123/usbrelay)
|
|
|
|
- https://obrienlabs.net/setup-raspberry-pi-kiosk-chromium/
|
2018-03-03 21:28:55 +00:00
|
|
|
|
2018-03-04 22:54:11 +00:00
|
|
|
## 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][dana] © 2018.
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
MIT
|
|
|
|
|
2018-03-04 22:44:40 +00:00
|
|
|
[cobot]: https://www.cobot.me/
|
2018-03-04 22:54:11 +00:00
|
|
|
[dana]: http://danawoodman.com
|
2018-03-03 21:30:38 +00:00
|
|
|
[jest]: https://facebook.github.io/jest
|
2018-03-04 22:46:24 +00:00
|
|
|
[latch]: https://www.amazon.com/gp/product/B00V45GWTI
|
2018-03-03 21:28:55 +00:00
|
|
|
[start]: http://tessel.github.io/t2-start
|