A usb interface to a particular rfid reader / writer


This is a top-level interface to an rfid reader and writer that happens to double as a very nice glowy thing. The library itself have been written to support multiple skyportals on the one machine allowing you do so some pretty neat things when you have a few usb ports spare :)

This module does just the bare bones required to communicate with the device, but does make interfacing with a skyportal pretty accessible. The follow example demonstrates opening a portal and setting it's color to green.

var skyportal = require('skyportal');
var commands = skyportal.commands;
skyportal.init(function(errportal) {
  skyportal.send(commands.color(0, 255, 0), portal);

NOTE: Running the examples (at least on my machine required root user privileges to open the device, so you may need to sudo the examples).

At this stage this has only been tested with the USB version of the portal (Xbox 360) on Linux. It has been coded in such a way that compatibility with other portal models is quite easy to implement, so feel to send through a pull request :)

You may need to apply some system updates to get it working though, see the following url for more info:

Look for a skyportal within the current usb devices.

The init function of the skyportal module is best way to get yourself a correctly open initialized portal. In short, you should pretty much always use it.

Open the portal using the portal data that has been retrieved from a find operation.

Read data from the portal.

Send a chunk of bytes to the portal. If required the device appropriate command prefix will be prepended to the bytes before sending.

Release the portal device bindings.

These are command generators for commands supported on the device.

The activate command is sent to the device after a reset.

[0x41, 0x01]

Update the color of the glowing thing by providing rgb values. This function also supports providing a three element array as the first argument for rgb.

[0x43, 0xRR, 0xGG, 0xBB]

Query a tag that is currently on the portal. Data is returned in blocks, so use the blockIdx to target a specific block of data.

[0x51, 0x20 + tagIdx, blockIdx]
### reset
Reset the device ready for use.


## License(s)
### MIT
Copyright (c) 2014 Damon Oehlman <>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.