Basic idea: ESP32-C3 + RC522 module, plugged into USB, and it just sends card scan events as JSON over serial. Your host (whatever it is -- Python script, Node, a Rust binary, doesn't matter) is the one that decides if the card gets access or not. The firmware doesn't know and doesn't care about your access list.
So when someone taps a card you get:
Code: Select all
{"event": "card", "uid": "HE:LL:O6:67"}You reply with:
Code: Select all
{"method": "POST", "resource": "access", "data": {"access": true}}There's also a handful of other endpoints -- GET /status, PUT /config for tweaking debounce and timeouts at runtime, PUT /led if you want to drive the LED yourself, POST /reset, etc. All single-line JSON over USB CDC at 115200.
Hardware side is pretty cheap. ESP32-C3 Super Mini is like $2 shipped, RC522 is another $1-2. Five SPI (+one more for 3.3v) wires plus one LED pin and you're done.
Built with PlatformIO. GitHub Actions handles CI and spits out a merged .bin (bootloader + partitions + firmware all in one) so if you just want to flash and not deal with the build toolchain, grab it from Releases and use esptool or the browser-based esptool-js.
Repo: https://github.com/lenzarchive/esp-rfid-bridge
Let me know if anything's broken or if the protocol is missing something obvious.