wendlers / micropython-mfrc522

(Micro)Python class to access the MFRC522 RFID reader
MIT License
162 stars 111 forks source link

Pins for Wemos D1 mini #2

Open hickford opened 7 years ago

hickford commented 7 years ago

Hi. Thanks for sharing. You wouldn't happen to know which pins to use with an Wemos D1 mini (esp8266)?

https://micropython-on-wemos-d1-mini.readthedocs.io/en/latest/setup.html#development-board

image

image

hickford commented 7 years ago

Following the diagram above, I tried

Signal GPIO ESP8266 Wemos D1 mini
sck 0 D3
mosi 2 D4
miso 4 D2
rst 5 D1
cs (sda) 14 D5

but haven't got it to work yet

cefn commented 7 years ago

You mention you tried those pins, but what code did you run? what did you expect to happen? what did happen?

First of all you need to describe your configuration. Imagine you needed someone else to recreate your circuit and software configuration and see the same error. Ideally you should provide enough information for them to do this.

Second of all you need to describe the error compared to what you are trying to achieve. "haven't got it to work yet" does not describe either what actually happens, or what you think should happen.

See https://www.chiark.greenend.org.uk/~sgtatham/bugs.html for a good guide how to report bugs so people can help you effectively.

hickford commented 7 years ago

Hi. Thanks for your reply. My configuration:

  1. Wemos D1 Mini and RoboDyn MFRC522
  2. Connected pins above (plus 5V and GND)
  3. A green LED shines on MFRC522
  4. Copied mfrc522.py and read.py from this repo to microcontroller
  5. In micropython terminal, ran code import read; read.do_read()
  6. Text is printed "Place card before reader to read from address 0x08"
  7. Held 125Khz RFID tag by sensor
  8. Nothing happens

Any ideas?

hickford commented 7 years ago

Aha. The tags I have are the wrong frequency for the MFRC522 module.

This RFID modules base on MFRC522 IC and that can read and write Mifare's tags. The microcontroller and card reader uses SPI or 12C for communication. The card reader and the tags communicate using a 13.56MHz electromagnetic field.

https://www.aliexpress.com/store/product/Compact-RFID-Reader-Writer-and-NFC-module-MFRC522-13-56MHz-Power-5V-3-3V-For-Arduino/1950989_32667518116.html