Tuesday, August 25, 2015

Repurpose your Rock Werchter NFC chips

This year at Rock Werchter they used NFC (Near Field Communication) tags to let people check in at the main entrance just by tapping a big black box with a light on top. If the light flashed green it meant your tag was registered and you paid your entrance money. It was a good way to reduce congestion at the entrance, and try some cool things such as link your Facebook to your NFC tag and automagically update your status to where you were when you tapped one of the NFC kiosks on the terrain.

Rock Werchter NFC chip
So what do you do with the tag after the festival is over? You can just throw it away of course, it's not expensive. Or you can make it do some interesting stuff, since it's not write protected.

Yes, you can write data to this chip and read it with an NFC-enabled smartphone. This post also isn't just about the Rock Werchter tags, it works with any writable NFC tag.

You can do interesting stuff with NFC tags you can't write data to as well, but in that case you're using it more like a trigger for your smartphone to do some work. For example, you could buy some Wi-Fi connected Philips Hue lights, install the app, attach the NFC-tag somewhere on the wall and use an app like Tasker or IFTTT to activate or change the lights in your house when you touch the tag with your smartphone. As you probably noticed, that's just a shortcut to not have to unlock your phone and open the app or tap a widget. In this case it doesn't really matter what data is on the NFC tag.

With writable NFC tags however, you can store something on them, which opens up other possibilities. With a google search I found an app called NFC TagWriter by NPX, a very simple and clean looking app to read, write, copy and protect NFC tags. I'm not going to write out how to use the app because that can change, and the app does a great job at explaining itself. The app allows you to write the following datasets to an NFC tag (taken directly from the app description):
  • Contact (vCard) to import data into the address book (Contacts)
  • Bookmarks (URL) to open a given web address
  • Plain text to display simple messages directly on the screen
  • SMS (SMS URI) to create a new message
  • Mail (Mail URI) to create a new mail message
  • Telephone number (TEL URI) to start a call
  • Bluetooth to pair and connect devices
  • WiFi to connect to WiFi Networks
  • Geo location to open a given destination
  • File URI to open a file on the device, including file picker UI
  • URI to create any kind of URI, also those not directly supported by the NXP TagWriter
Obviously you're not going to fit a lot of data on the chip in the Rock Werchter NFC tags. You can already see how incredibly small it is by pointing it at a light source and looking trough it. When using TagWriter to read the tag it will show you the size of 46 bytes. That's not a lot to work with, but it will do for some options. I tried to load our Wi-Fi authentication credentials on the tag, but that was too much. Some datatypes already need more than 46 bytes without containing any information.

For simple datatypes such as a message or url the app seems to use an encoding that uses one byte (8 bits) per character. This means you can store simple data up to 41 characters.

Opening website with NFC tag
Touching the back of my phone with the
Rock Werchter NFC tag
I used my Rock Werchter tag to store the url of our motorcycle driving school. Now I can put it on our window inside of a note saying "Tap here for website". If people tap it with their smartphone, it will receive the url and (most probably) open it in a browser.

Another option would be to embed this in a poster about our driving school with geolocation data on the chip. This way you could make it "Tap here for location".

Or you could hang one at your place to give people access to your Wi-Fi without telling them the password.

Or... Whatever you can think of.