Tag: twisted

Twisted RFID

It’s been a while since I worked with Twisted in Python and I forgot how easy and fun it is to create a robust network server with it.

I’m working on a prototype rfid card reader for use at work. We need to track various types of people who come into the facility – volunteers, faculty, youth, Create members, etc and giving them an id card that they can just swipe when they walk in the building would be a boon to help know who’s here and if they should be doing whatever it is that they’re doing.

The folks over at SparkFun have a simple USB based rfid reader that looks like it’ll do just what’s needed. Plug it in to a USB port and the card looks like an old fashion serial port. On my Mac, it comes up as /dev/tty.usbserial-A900UCVB.

The code does two things. First it reads the rfid, verifies that it’s a valid number and then drops it into a holding tank. Second is that it serves up the rfid from the holding tank (along with some supporting data) as json data through an HTTP server. And because its Twisted asynchronous network code, it can basically do both at the same time.

The next step will be to munge this into the existing timecard system and then we can start beta testing it. That’s going to be a bit more challenging. For now, the prototype code is available at https://github.com/pkropf/rfidcard. Have a look and let me know what you think.

Tags : , ,