Open jamoore5 opened 4 years ago
After instance initialization, the reset pin you selected (BCM25) should be in HIGH OUT, and the voltage should be detectable using a multimeter.
I suggest that you read MFRC522 version first, to ensure the SPI communication is fine.
r = MFRC522.new(25)
puts r.send(:read_spi, 0x37)
To see what the library send and receive to/from MFRC522, set the ENV variable DEBUG=1
, it'll print the content in STDOUT.
Thanks for the response
require 'mfrc522'
r = MFRC522.new(25)
puts r.send(:read_spi, 0x37) # 146
What is read_spi? The above command work with the rst pin unplugged. edit: looked at the code I see it says 0x37 => shows the software version
The read_spi
, which is the communication wrapper in the library, is currently a private method, send
is needed to access it.
Looks like your configuration is working with rst unplugged. Let me know if your had other problems.
Looks like your configuration is working with rst unplugged.
Sorry if I was unclear, I was just commenting that the check for version works with both the rst pin plugged in or unplugged.
That's strange. According to datasheet, NRSTPD is the pin control whether MFRC522 is powered on or off.
This is the configuration I am using
The grey cable does not seem to affect the puts r.send(:read_spi, 0x37)
statement
The purple and red are controlling the power.
I have confirmed 3v in the rst pin when it is on.
python code works so it must be a configuration issue.
If your r.send(:read_spi, 0x37)
works, then set environment variable DEBUG=1 and run the following:
r = MFRC522.new(25)
puts r.send(:communicate_with_picc, MFRC522::PCD_Transceive, MFRC522::PICC_WUPA, 0x07)
This will send wake up command to RFID card to power it up. You'll receive confirmation from the card in normal cases.
Plus, be sure to remove/place RFID card between each test, this will reset the card activation state.
@jamoore5 I've increased the overall stability by rewritten the SPI communication part of the library. If you would like to try, enable SPI linux driver and use mfrc522 3.0.0.
Not sure if this project is still active, stuck how to troubleshoot timeout error.
Setup is working with python code and setup
I did figure out to update
nrstpd
to 25 based on above setup.Error I am seeing when running
Error communicating PICC: status_picc_timeout