ATrappmann / PN5180-Library

PN5180 library for Arduino
GNU Lesser General Public License v2.1
104 stars 92 forks source link

Support for ISO 14443A/B #6

Closed stormwin closed 2 years ago

stormwin commented 5 years ago

Do this device and this plugin have support for ISO 14443A/B NFC Standard? I have this device and a tons of Mifare Classic/Ultralight cards and Ntags. How can i use this plugin to read from them?

Thanks

ATrappmann commented 5 years ago

Hi, thank you for your interest in the library. The device does have support for ISO14443 but I did not implement it in my library because I only had the demand for ISO15693 tags. Since there was no library available, I posted my implementation to Github. Feel free to add your code for ISO 14443 support and we can integrate it. The best way would to make another subclass of the PN5180 class. --Andreas.

-----Original-Nachricht----- Betreff: [ATrappmann/PN5180-Library] Support for ISO 14443A/B (#6) Datum: 2019-01-13T19:52:22+0100 Von: "Vlado Velichkovski" notifications@github.com An: "ATrappmann/PN5180-Library" PN5180-Library@noreply.github.com

Do this device and this plugin have support for ISO 14443A/B NFC Standard? I have this device and a tons of Mifare Classic/Ultralight cards and Ntags. How can i use this plugin to read from them? Thanks — 

stormwin commented 5 years ago

Thanks for reply. As i can see from PN5180 docs, there is some docs how to configure setupRF function to work for ISO 14443. Also found in docs about Mifare Authentication process and how to implement, but i do not found a way how to read and write to Mifare and ntags. That is my biggest problem now. Definitely i will fork this project today and start to work on implementation of ISO 14443, as i need it for my project.

ATrappmann commented 5 years ago

Hi Vlado,

try google "iso14443 pdf". Part 3 & 4 of the ISO should be the documents you are looking for.

2nd guess: try google "arduino iso14443 library" and see what other have implemented on other boards. The ISO protocol is the same. You could use that with the basic transmission functions from the PN5180 class.

Cheers, --Andreas.

-----Original-Nachricht----- Betreff: Re: [ATrappmann/PN5180-Library] Support for ISO 14443A/B (#6) Datum: 2019-01-14T13:27:10+0100 Von: "Vlado Velichkovski" notifications@github.com An: "ATrappmann/PN5180-Library" PN5180-Library@noreply.github.com

Thanks for reply. As i can see from PN5180 docs, there is some docs how to configure setupRF function to work for ISO 14443. Also found in docs about Mifare Authentication process and how to implement, but i do not found a way how to read and write to Mifare and ntags. That is my biggest problem now. Definitely i will fork this project today and start to work on implementation of ISO 14443, as i need it for my project. — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ATrappmann/PN5180-Library/issues/6#issuecomment-453988310 , or mute the thread https://github.com/notifications/unsubscribe-auth/ASrpHuhm1rzx42dy7UEHOP5_mPVHepF2ks5vDHebgaJpZM4Z9UN- . 

tueddy commented 4 years ago

Feel free to test my branch: https://github.com/tueddy/PN5180-Library/tree/ISO14443

tueddy commented 4 years ago

Found this document "Using the PN5180 without (NXP) library": AN12650.pdf

It explains the SPI command sequence both for detecting ISO14443 & ISO15693 cards in detail...

ATrappmann commented 4 years ago

Great!! Thank you. —Andreas

Am 08.02.2020 um 21:32 schrieb tueddy notifications@github.com:

Found this document "Using the PN5180 without (NXP) library": AN12650.pdf

It explains the SPI command sequence both for detecting ISO14443 & ISO15693 cards in detail...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

freemont-mike commented 3 years ago

https://github.com/tueddy/PN5180-Library used this library, works perfect for the mifare classic cards. Here's my sketch:

**`
#include <PN5180.h>
#include <PN5180ISO14443.h>
#define PN5180_NSS  10
#define PN5180_BUSY 9
#define PN5180_RST  7
PN5180ISO14443 nfc14443(PN5180_NSS, PN5180_BUSY, PN5180_RST);

void setup() {
  Serial.begin(115200);
  nfc14443.begin();
  nfc14443.reset();
  uint8_t productVersion[2];
  nfc14443.readEEprom(PRODUCT_VERSION, productVersion, sizeof(productVersion));
  if (0xff == productVersion[1]) { // if product version 255, the initialization failed
    Serial.println(F("Initialization failed!?"));
  }
  uint8_t firmwareVersion[2];
  nfc14443.readEEprom(FIRMWARE_VERSION, firmwareVersion, sizeof(firmwareVersion));
  uint8_t eepromVersion[2];
  nfc14443.readEEprom(EEPROM_VERSION, eepromVersion, sizeof(eepromVersion));
  nfc14443.setupRF();
}

void loop() {
  Serial.print(F("Loop #"));
  #if defined(ARDUINO_ARCH_ESP32)  
    Serial.println("Free heap: " + String(ESP.getFreeHeap())); 
  #endif
  uint8_t uid[10];
  // check for ISO-14443 card
  nfc14443.reset();
  nfc14443.setupRF();
  if (nfc14443.isCardPresent()) {
    uint8_t uidLength = nfc14443.readCardSerial(uid);
    if (uidLength > 0) {
      Serial.print(F("ISO14443 card found, UID="));
      for (int i=0; i<uidLength; i++) {
        Serial.print(uid[i] < 0x10 ? " 0" : " ");
        Serial.print(uid[i], HEX);
      }
      Serial.println(F("----------------------------------"));
      delay(1000); 
      return;
    }
  } 
  Serial.println(F("*** No card detected!"));
}
`**
KoenPaas commented 3 years ago

@tueddy any idea how to implement APDU commands?

tueddy commented 3 years ago

@KoenPaas, sorry, can not help here. I have just implemented reading the card UID and some basic commands.

ATrappmann commented 2 years ago

Fixed.