Project Name: Millworker

Just the code, please...

Project Site:
https://github.com/tomkersten/millworker
Repository:
https://github.com/tomkersten/millworker

What is it?

A Ruby gem which takes the pain of continuously reading data from a serial port away and lets you focus on dealing with the data received.

This was written specifically for reading in data from an ID-20 RFID card reader and running custom scripts to automatically perform various tasks when patrons scanned their badge at the MN Mill (logging attendance, etc).

Custom scripts are loaded from ENV["HOME"]/millworker/tasks and are executed in alphabetical order. Each script is executed with the ID of the badge passed in as an argument. For example, a script called tweet_id.rb existed in the afformentioned directory, it would be executed as if you had opened up a command terminal and typed tweet_id.rb RFID_TAG_ID_HERE.

Thoughts/Learnings

  1. I like the simplicity of what the gem is...it listens to a serial input and you just add executables to a directory which will act on the input you have received. It's nice & easy to add new functionality without dealing with the serial port/gem at all...so a user who is more comfortable grabbing a script they find online can still customize what happens when they, say, scan an RFID card.
  2. The gem doens't have any tests. I don't really like this, but there is so little code I haven't put the effort into fixing it. I'm not sure how I feel about that...
  3. Ruby on Windows is still a pain. Some of the serial port initialization parameters necessary on Windows do not appear to be necessary on Mac OS or Linux (Ubuntu, anyway)...which made some debugging more difficult than it needed to be (Note the tests comment above. I like pain, apparently.).
  4. Having people use your code in a "real world scenario" is still extremely rewarding to me. Even though this is used by only one (small) company, it is enabling them to have an RFID scanner that talks to Salesforce to log when members "check in" and will be automating all kinds of interesting things soon (like potentially playing entrance music when people scan their badge, et cetera). Whatever they want...and I love that they have that freedom because of something I made. Super-rewarding.