HOWTO Program A Key

From i3Detroit
(Redirected from 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 HelloClub in custom fields. Members must have an active membership in the CRM in order for their fob to be on the access list.

Updating The Doors

There is a script that runs at midnight each night that should sync the HelloClub data to the doors. If it doesn't work, you can visit the management UI at doors.i3.lc and manually start the update.

The code for this system is hosted on GitHub.

Getting A Key's ID

The number is printed on the key itself. If you have an RFID reader like a Flipper Zero, use that if you prefer (so long as you're aware of the relevant key formats)! Or, you can get it from the doors themselves by swiping and checking the logs through the management site.

RFID Key Formats

There are three formats for the data in our flavour of RFID:

  1. 1 26 bit decimal number, just a number (this is what is written on the keyfobs)
  2. 2 16 bit decimal numbers, <5 digits>:<5 digits> (this is what is written on the cards)
  3. 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'
    • 0x is 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 a blog post and Google Sheet about this.