HOWTO Program a key
Jump to navigation
Jump to search
RFID Tags
Our RFID entry system uses EM4100 125khz RFID tags.
Data Source
Key and fob data is stored in hello club in custom fields
getting the ID of a new key
- Get a key from where we store them.
- Go to one of our doors and swipe it and press enter.
- Open a terminal and SSH into mcclellan.
- Enter
tail /var/log/mqtt-door.logwhich will show you the list of door swipes. The last row in that output is the key you just swiped. Copy the uuid. - Alternatively, the number printed on the key should be the uuid.
- Put the key fob id and the fob pin in hello club
You could also use a reader, but then you have to be aware of the relevant key formats
RFID Key Formats
There are three formats for the data in our flavour of RFID:
- 1 26 bit decimal number, just a number (this is what is written on the keyfobs)
- 2 16 bit decimal numbers,
<5 digits>:<5 digits>(this is what is written on the cards) - the number but as hex, I don't think we use this *currently*, we have in the past and I want to again
Converting formats
- To go from hex to decimal:
echo 0x05094D8 | perl -nle 'print hex'0xis optional
- To go from 2 16 bit to decimal:
echo 80:38104 | perl -laF/:/ -e 'print (($F[0] << 16) + $F[1])' - To go from decimal to 2 16 bit:
echo 5280984 | perl -ne 'printf "%03d:%05d\n", $_ >> 16, $_ & 0xFFFF' - Decimal to hex:
echo 5280984 | perl -nle 'printf "0x%X\n", $_'
There is also ablog post and Google Sheet about this.
updating the doors
There is a nightly cron job that *should* sync hello club to the doors but it doesn't work sometimes.
The code is at github.com/i3detroit/door-management.
To manually update the doors:
- ssh into mcclellan and run this command:
/opt/door-management/setAccess.jsYou can add a space and "a" or "b" to the end of the command. The "a" option means "only update A side", "b" means "only update B side", and neither option means to set both.- if it stops printing status from one of the doors, (like says it logged in but nothing else, or it parsed page 1 of 19 but no others) reboot that door and try that one again.
- To reboot a door run (for example b)
/opt/door-management/rebootdoor b - Then try programming the failed door again
/opt/door-management/setAccess.js b
- To reboot a door run (for example b)
- if it stops printing status from one of the doors, (like says it logged in but nothing else, or it parsed page 1 of 19 but no others) reboot that door and try that one again.