A Tessel powered RFID doorlock for the space, interfacing with Cobot
Go to file
Dana Woodman a66f602dc4 Add basic RFID reader scanning code.
Other cleanup and docs.
2018-03-04 14:35:02 -08:00
__mocks__ Add basic RFID reader scanning code. 2018-03-04 14:35:02 -08:00
.vscode A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
src Add basic RFID reader scanning code. 2018-03-04 14:35:02 -08:00
.editorconfig A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
.env.example Add basic RFID reader scanning code. 2018-03-04 14:35:02 -08:00
.eslintignore A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
.eslintrc.yml A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
.gitignore Add Cobot card fetching, cleanup config setup. 2018-03-04 09:17:30 -08:00
.npmrc A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
.nvmrc Add basic RFID reader scanning code. 2018-03-04 14:35:02 -08: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
.tesselinclude Add Cobot card fetching, cleanup config setup. 2018-03-04 09:17:30 -08:00
jest.config.js A happy beginning 🚪🔒 2018-03-03 13:28:55 -08:00
package-lock.json Add basic RFID reader scanning code. 2018-03-04 14:35:02 -08:00
package.json Add basic RFID reader scanning code. 2018-03-04 14:35:02 -08:00
readme.md Add basic RFID reader scanning code. 2018-03-04 14:35:02 -08:00

Chimera Doorlock

A Tessel powered RFID doorlock for the space, interfacing with Cobot

Powered by a Tessel

Technical Overview

The RFID doorlock consists of a few components that allow us to have a offline capable, yet up-to-date list of member's RFID cards.

Currently, we are using Cobot to manage our membership as well as RFID card numbers (checkin tokens in Cobot parlance).

The doorlock consists of a Tessel microcontroller powered by node.js (JavaScript). The doorlock has an attached USB adapter with an SD card to store the member's cards (in json format). A USB powered RFID card reader (125mhz) is plugged into the other Tessel USB port. This reader behaves like a keyboard; when a card is scanned it sends a string of card numbers as keys with a newline character.

The application listens for card scan events and when one if found, it looks the card number up in a local database (the above mentioned json file). If it finds a card, it opens the door, if not it shows an error message.

To open the door, we use a relay (or optionally a TIP120 transistor) which powers a 12v door latch. If no power is sent to the door latch, it remains locked. When it gets a 12v current it opens and allows the member entry.

Whether a success or failure, we should details on an attached OLED display as well as when the card list updates or other unexpected issues.

When the device first turns on it connects to WiFi and then fetches all the member RFID cards from the Cobot checkin token API and then updates the json card file. It completely overwrites the existing list of cards. If there is a failure getting the cards, we keep the original card list as a fallback.

Eventually, we can remove Cobot and swap it with our own service if we desire.

Development

First, follow the start guide on Tessel.io.

Next, install the correct version of node using nvm:

nvm install
nvm use
npm install

Now install t2-cli globally:

npm install -g t2-cli

Plug your Tessel in.

Now you can deploy to your connected Tessel device:

npm run deploy

For local development, you can run npm start which will run the application locally as well as run the test suite, watching for changes.

Testing

We use Jest to do testing of the core code in the library. Make sure to write tests for new code or update tests on existing code as needed. Test files are next to their source file named with a .test.js extension.

Run tests once: npm test

Run tests watching for changes: npm run watch-test

RFID Cards

Read cards from Cobot:

https://www.cobot.me/api-docs/check-ins#list-check-in-tokens

Useful Commands

# List devices
t2 list

# Update Tessel
t2 update

# Deploy code
t2 push index.js

# Clear code
t2 erase

# Connect to WiFi
t2 wifi -n network-name -p "some password"

# Create access point and server
t2 ap -n doorlock

Networking

To find the IP address of your Tessel, download the iOS app Fing and look for a device on your network called doorlock.

USB Storage

  • Make sure to format micro SD to be FAT32!