I have RFID-RC522 and I want to use it together with my ESP8266. I had some ideas, like reading a GPIO pin, but api_gpio.js only reads 0 or 1, but I need more information. How can I get information from a GPIO pin so that when RC522 reads a card, I can check if it’s valid or not, or is there a better way to do it (like a library)?
I connected everything and I use SPI api. When I look at output, all I see are “\x00\x00…” and when I put a card near RD522, the output doesn’t change. How to check if my SPI connection is good?
But there is SPI API, so surely you can communicate with RC522 with that? This is my setup:
3.3V → 3V
RST → RST
GND → GND
IRQ → not connected
MISO → MISO (12)
MOSI → MOSI (13)
SCK → 15
SDA → 16
let spi = SPI.get();
let param = {
cs: 0,
mode: 0,
freq: 2000000,
hd: {
rx_len: 100,
},
};
let someOutput = SPI.runTransaction(spi, param);
print(someOutput);
To my understanding I initalized module with SPI.get() (right?), I send command by putting my card in front of RC522 I read data using runTransaction. I looked at the output and it’s 0. Did I misunderstood you?