HOWTO Program a key
We use EM4100 125khz RFID tags.
There are three formats for the data in our flavour of RFID:
- 1 26 bit decimal number, just a number, written on keyfobs
- 2 16 bit decimal numbers,
<5 digits>:<5 digits>, currently (2022-07-29) in the CRM and written on the cards.
- the number but as hex It's what is in the spreadsheet right now.
- To go from hex to decimal:
echo 0x05094D8 | perl -nle 'print hex'
- To go from 2 16 bit to decimal:
echo 80:38104 | perl -laF/:/ -e 'print (($F << 16) + $F)'
- 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", $_'
Since April 2020 adding new keys and changing the status of existing ones is handled through a remote interface on McClellan.
Debugging new keys
mosquitto_sub -h 10.13.0.22 -v -t "#" | grep door
- The current door code doesn't acknowledge new keys, so you're just looking to be sure the door is online.
- Then test the key, and see if it says unknown user or not.
- I *think* a key that is not programmed will act differently than a wrong pin but I'm not 100% sure if that's the current door firmware or mainline esp-rfid.
Adding a new key
1. SSH into mcclellan
Look at the help:
You're actually going to run something like
/opt/door-management/old-doors.sh add <key> <name> <pin>
Please remember that if the name has a space to quote it so it's not two separate arguments.
Removing a key
Not currently supported, sorry.