RFID with the imp

Hello

I have an RFID reader that I picked up on ebay cheaply, and I’m trying to interface it with my imp - http://is.gd/Bh8S7W

The onboard chip is the MFRC522, which has spi, uart, and i2c, although the board is wired so that spi is selected.

I write a bit of code to listen for spi data, but it doesn’t seem to do much, occasionally I’ll get some data through, but it seems to appear randomly, and contain random data:

FF FF FF FF FF FF FF FF
80 00 00 00 00 00 00 00

I’ve tried translating Arduino code over (http://is.gd/Bikfjd) but that hasn’t given me any success either.

For now all I’m trying to achieve is reading the data from the RFID card, so I can uniquely identify it.

Does anyone have any experience with this reader, this chip, or RFID generally

Thanks!

Richard

Here is my current basic code, that appears to do nothing!

`
// RFID Reader

local select = hardware.pin8;
select.configure(DIGITAL_OUT);

local irq = hardware.pin9;
irq.configure(DIGITAL_IN_PULLUP);

local reset = hardware.pin1;
reset.configure(DIGITAL_OUT);

local spi = hardware.spi257;
spi.configure(CLOCK_IDLE_LOW, 4000);

function readRFID(){

select.write(1);
//trying different spi code here
//local data = hardware.spi257.writeread("\\x08");
local data = spi.readblob(8);
select.write(0); 

if (data[0] != 00){
    server.log(format("%02x %02x %02x %02x %02x %02x %02x %02x", data[0], data[1], data[2], data[3],data[4], data[5], data[6], data[7]));
}

imp.wakeup(0, readRFID);

}

// Register with the server
imp.configure(“RFID Reader”, [], []);

readRFID();

// End of code.
`

It would be a good thing to know if the RFID reader you bought off of ebay actually works. Is there a way you can test it on something else (other than the imp)? You could be going insane troubleshooting this only to find out the RFID reader has never worked to begin with.

(and a preposition is a bad thing to end a sentence with.)