I'm trying to communicate a Raspberry Pi and a Smartphone (Samsung Galaxy S8) through NFC. I'm using a card reader RFID-RC522, and I connected correctly with the Raspberry (I can detect NFC tags). But when I try to detect the smartphone, I can detect the NFC but I have auth error. I'm using the script Read.py in this repository: https://github.com/mxgxw/MFRC522-python
1 Answer
If you are capable of detecting NFC cards then there are a few things you'll need to look into. As an Android developer by trade I can tell you Samsung always seems to break the mould (and I do not mean this in a good way) when it comes to hardware specifications.
According to radio electronics there are four basic types of NFC tags:
- Tag 1 Type: The Tag 1 Type is based on the ISO14443A standard. These NFC tags are read and re-write capable and users can configure the tag to become read-only. Memory availability is 96 bytes which is more than sufficient to store a website URL or other small amount of data. However the memory size is expandable up to 2 kbyte. The communication speed of this NFC tag is 106 kbit/s. As a result of its simplicity this tag type is cost effective and ideal for many NFC applications.
- Tag 2 Type: The NFC Tag 2 Type is also based on ISO14443A. These NFC tags are read and re-write capable and users can configure the tag to become read-only. The basic memory size of this tag type is only 48 bytes although this can be expanded to 2 kbyte. Again the communication speed is 106 kbit/s.
- Tag 3 Type: The NFC Tag 3 Type is based on the Sony FeliCa system. It currently has a 2 kbyte memory capacity and the data communications speed is 212 kbit/s. Accordingly this NFC tag type is more applicable for more complex applications, although there is a higher cost per tag.
- Tag 4 Type: The NFC Tag 4 Type is defined to be compatible with ISO14443A and B standards. These NFC tags are pre-configured at manufacture and they can be either read / re-writable, or read-only. The memory capacity can be up to 32 kbytes and the communication speed is between 106 kbit/s and 424 kbit/s.
Knowing this we need to see what your hardware supports. According to the documentation:
The MFRC522’s internal transmitter is able to drive a reader/writer antenna designed to communicate with ISO/IEC 14443 A/MIFARE cards and transponders without additional active circuitry. The receiver module provides a robust and efficient implementation for demodulating and decoding signals from ISO/IEC 14443 A/MIFARE compatible cards and transponders. The digital module manages the complete ISO/IEC 14443 A framing and error detection (parity and CRC) functionality.
It's unlikely that your phone would adhere to a Sony standard, so type 3 is not really worth considering. But you need to remember that the NFC reader is looking for a Tag to read from or write. So the question is, are you just tapping your phone hoping it will read / write something, or are you emulating or transmitting a "tag" for your hardware to read? I would recommend researching Host Card Emulation. Or you can use vsmartcard's solution to test, just make sure about the protocol and tag types.
I think you should also install NFC tools and check that your phone is capable of reading the same tags as your hardware. Remember your phone can be both "tag" and "reader" so there will be some setup involved in getting it right. Perhaps Android Beam would be the best way to be in a "tag" like state.