From cd5bca80ad181be9051b6b29b862023cc8ec9442 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Mon, 22 Feb 2016 19:53:48 +0100 Subject: [PATCH 1/3] upd example multireader - comments - reader info after init - serial speed --- .../ReadUidMultiReader/ReadUidMultiReader.ino | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/ReadUidMultiReader/ReadUidMultiReader.ino b/examples/ReadUidMultiReader/ReadUidMultiReader.ino index e81d657..bff028e 100644 --- a/examples/ReadUidMultiReader/ReadUidMultiReader.ino +++ b/examples/ReadUidMultiReader/ReadUidMultiReader.ino @@ -20,8 +20,8 @@ * Signal Pin Pin Pin Pin Pin Pin * ----------------------------------------------------------------------------------------- * RST/Reset RST 9 5 D9 RESET/ICSP-5 RST - * SPI SS 1 SDA(SS) 10 53 D10 10 10 - * SPI SS 2 SDA(SS) 2 53 D10 10 10 + * SPI SS 1 SDA(SS) ** custom, take a unused pin, only HIGH/LOW required ** + * SPI SS 2 SDA(SS) ** custom, take a unused pin, only HIGH/LOW required ** * SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16 * SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14 * SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15 @@ -31,9 +31,9 @@ #include #include -#define RST_PIN 10 // Configurable, see typical pin layout above -#define SS_1_PIN 5 // Configurable, see typical pin layout above -#define SS_2_PIN 3 // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_1_PIN 10 // Configurable, take a unused pin, only HIGH/LOW required, must be diffrent to SS 2 +#define SS_2_PIN 8 // Configurable, take a unused pin, only HIGH/LOW required, must be diffrent to SS 1 #define NR_OF_READERS 2 @@ -46,13 +46,17 @@ MFRC522 mfrc522[NR_OF_READERS]; // Create MFRC522 instance. */ void setup() { - Serial.begin(115200); // Initialize serial communications with the PC + Serial.begin(9600); // Initialize serial communications with the PC while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4) SPI.begin(); // Init SPI bus for (uint8_t reader = 0; reader < NR_OF_READERS; reader++) { mfrc522[reader].PCD_Init(ssPins[reader], RST_PIN); // Init each MFRC522 card + Serial.print(F("Reader ")); + Serial.print(reader); + Serial.print(F(": ")); + mfrc522[reader].PCD_DumpVersionToSerial(); } } @@ -61,14 +65,14 @@ void setup() { */ void loop() { - for (uint8_t reader = 0; reader < NR_OF_READERS; reader++) { + for (uint8_t reader = 0; reader < NR_OF_READERS; reader++) { // Look for new cards if (mfrc522[reader].PICC_IsNewCardPresent() && mfrc522[reader].PICC_ReadCardSerial()) { - Serial.print(F("Reader: ")); + Serial.print(F("Reader ")); Serial.print(reader); // Show some details of the PICC (that is: the tag/card) - Serial.print(F(" Card UID:")); + Serial.print(F(": Card UID:")); dump_byte_array(mfrc522[reader].uid.uidByte, mfrc522[reader].uid.size); Serial.println(); Serial.print(F("PICC type: ")); From e90031305f02d457ff94bda519349ebcc519e855 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Sat, 23 Apr 2016 03:44:38 +0200 Subject: [PATCH 2/3] upd readme add note for compatible ide closes #200 closes #204 closes #205 closes #212 upd readme closes #220 closes #36 extend gitignore with ide clion data --- .gitignore | 5 +++++ README.rst | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/.gitignore b/.gitignore index 56b89ad..4f9e484 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ MFRC522.zip + +# ignore IDE files +.idea +cmake +CMakeLists.txt \ No newline at end of file diff --git a/README.rst b/README.rst index 87ec696..96e88c8 100644 --- a/README.rst +++ b/README.rst @@ -12,6 +12,46 @@ Interface (SPI) interface. Set the UID, write to sector 0, and unbrick Chinese UID changeable MIFARE cards. +.. _development: +Development +---------- +**The development by owner miguelbalboa has ended**. Further development will be done by community. This library is still maintained by miguelbalboa, so make pull request if you like some new features or fixes. Support/issues should be solved by community. + +.. _what works and not: +What works and not? +---------- + +* **Works** + + #. Communication (Crypto1) with MIFARE Classic (1k, 4k, Mini). + #. Communication (Crypto1) with MIFARE Classic compatible PICCs. + #. Firmware self check of MFRC522. + +* **Partial** + + #. Communication with MIFARE Ultralight. + +* **Works not** + + #. MIFARE DESFire, MIFARE DESFire EV1/EV2, not supported by software. + #. Communication with DES3 or AES, not supported by software. + #. Peer-to-peer (ISO/IEC 18092), not `supported by hardware`_. + #. Communication with smart phone, not `supported by hardware`_. + #. Card emulation, not `supported by hardware`_. + +* **Need more?** + + #. If software: code it and make a pull request. + #. If hardware: buy a more expensive like PN532 (supports NFC and many more, but costs about $15) + + +.. _compatible ide: +Compatible IDE +---------- +This library works with Arduino IDE 1.6, older versions are **not supported** and will cause compile errors. The built-in library manager is supported. + +If you use your own compiler, you have to enable ``c++11``-support. + .. _compatible boards: Compatible boards @@ -19,6 +59,8 @@ Compatible boards This library is compatible to Teensy and ESP8266, but not all examples are available for every board. Also you have to change pins, see `pin layout`_. +Note that the main target/support of library is still Arduino. + .. _pin layout: Pin Layout @@ -202,3 +244,4 @@ It has been extended with functionality to alter sector 0 on Chinese UID changea .. _iso/iec 14443-3\:2011 part 3: .. _nxp mfrc522: http://www.nxp.com/documents/data_sheet/MFRC522.pdf .. _broken: http://eprint.iacr.org/2008/166 +.. _supported by hardware: https://web.archive.org/web/20151210045625/http://www.nxp.com/documents/leaflet/939775017564.pdf \ No newline at end of file From 76fec6f3811b80b834c0db5decfc056f8606583f Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Wed, 22 Jun 2016 18:15:38 +0200 Subject: [PATCH 3/3] add teensy2 to travis and only show error/warning --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1071bd9..46e21d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,8 @@ script: # short the string comparison - stringContain() { [ -z "${2##*$1*}" ]; } # selectable board tests @Rotzbua - - board="arduino_avr"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=uno --board=megaatmega1280; else echo "skip board test of $board"; fi - - board="arduino_arm"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=due --board=zero; else echo "skip board test of $board"; fi - - board="teensy"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=teensy31; else echo "skip board test of $board"; fi - - board="esp"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=d1_mini; else echo "skip board test of $board"; fi + # prints only warnings and errors, to show all remove "1>/dev/null" + - board="arduino_avr"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=uno --board=megaatmega1280 1>/dev/null; else echo "skip board test of $board"; fi + - board="arduino_arm"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=due --board=zero 1>/dev/null; else echo "skip board test of $board"; fi + - board="teensy"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=teensy20 --board=teensy31 1>/dev/null; else echo "skip board test of $board"; fi + - board="esp"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=d1_mini 1>/dev/null; else echo "skip board test of $board"; fi