Hackmeetup on Javascript mini-report: RFID on Rhino

This past Tuesday, we ran another Hackmeetup. Same great location, same great time.

Mark ran a talk about Typography on the Web for an audience of three.

For the hardware experimentation session, Carl had left, so it was Mark, me, and David, and we all worked on the same project. Mark had brought a USB-connected RFID reader of the Phidgets brand, and the idea: Use Rhino to wrap the Phidgets Java API to the RFID reader in a JavaScript, so we could… script the thing.

Update: Physical.js is the software we wrote, now published under MIT license.

We printed out the Javadocs for the API, and began laughing at some of the names: getLEDOn(), getAntennaOn(). Then we whiteboard-sessioned up some simpler, JS-idiomatic names, and had our wishlist. Almost cheating: Rhino has __defineGetter__ and __defineSetter__. Then we scrambled to find out how Rhino’s Java-adapting mechanism really worked. Great fun! Mark was the only one with the Phidgets hardware and software platform installed, so he was typing what me and David sent to him.

Prototyping with Rhino is quick. Soon, we were able to read the RFID card that Mark brought, and also a keychain fob I had with me. When we had 30 minutes until the trains went, Mark said: Let’s also hook it up to chat Jabber! He installed an OpenFire XMPP server on his machine, created a “rfid” account, and had it send a message onTagEnter and onTagLeave (enter/leave sounds better than gain/loss: we’re web developers…). Then he took an extra step and made chat commands to enable/disable the LED and antenna.

We cheered. We’d done it all.

Conclusion: Working on the same project is very productive. This was the first time we had a theme, two speakers, a dropped talk, and gotten stuff Done and Ready and the end of the night. Also: snacks. Healthier snacks are better, so next time, let’s up the ante.

Published by olleolleolle

Olle is a programmer, enjoying sunny Malmö in Sweden.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.