Reading tag from Ionic NFC plugin gives different information than if I use reader - ionic-framework

I am developing an Ionic 2+ application using the NFC plugin.
The issue I run into is how the tag is read differently by a simple USB reader and by the device. The tag IDs are different.
In Ionic I use:
this.nfc.bytesToHexString(event.tag.id)
It is read correctly and I log the result:
From USB reader I get:
On the left is the software for the RFID reader, and on the right are reads with different settings.
What I need is to get the same information for both, the USB reader and the NFC plugin. I don't care about the format.

The IDs that you read are the same except that your USB RFID reader seems to only reads 4 bytes of the 7 byte UID. Since your USB reader doesn't seem to support any other formats, you won't be able to infer the remaining 3 bytes from nowhere. However, you can easily chop off the last three bytes of the UID in your ionic application:
this.nfc.bytesToHexString(event.tag.id.slice(0, 4))
You would then get the same value as for format "8 no. in HEX reverse".

Related

I dump my Nfc Mifare classic 1k card but i can't emulate it with an android redmi note 11s phone

I just dump my Nfc Mifare classic 1k card and I want to emulate it with my phone (Redmi note 11S, with nfc).
As you can see, only the first sector of this card is write
I find an app name "Ndef tag emulator" for emulate card. I try to emulate with only the UID (D4ECCFCC) but it didn't work.
Have you an idea for writing this on "NDEF syntaxe", oh just khnow a better way to emulate a nfc card?
This information may help you. The Sector 0 is the so called MAD (Mifare Application Directory) which says where the Applications are stored. Within the Sector 0 the first Block (0-15 Bytes) is the Manufactor-Code followed by byte 16 which is an CRC for the MAD and then the Information-Byte which is blocked for further development. Then the Application-Ids (AIDs) starts, where 2 Bytes represent an Application and the Sector to find the Application. By this logic your Data is stored in Sector 1 which is uncommonly not present in your picture.

NDEF Capability Container decoding with NTAG 5 boost

I am currently working on an I2C communication between an i.MX6 (Android BSP) and a NTAG 5 boost component.
NTA5532 datasheet says :
"According to NFC Forum Type 5 Tag Specification, EEPROM block 0 contains the Capability Container directly followed by the NDEF Message TLV."
In fact, below is the user memory orgnisation of the NTAG 5 boost:
So I used TagInfo NXP's app to read the memory of the NTAG 5 component.
Here is what I get concerning NDEF Capability Container using this app:
How can I decode this block as NXP does in its application?
Following what says this PDF from ST about NDEF management, "The CC manages the information of an NFC Forum T5T", so the structure of this Capability Container is mainly common to all NFC Forum tags.
For more information about how to interpret the CC, see the previous pdf.

How to send data between two phones using NFC in Flutter?

I am building a flutter where an app transfers user details from one phone to another. Initially I built this using a qr code scanner and generator setup.
Now I am trying to pass the data between the devices using NFC.
Could someone tell me how to send an NFC message from a device, and how to accept this message from another device?
I did read through github.com/matteocrippa/flutter-nfc-reader, and I understood how to read NFC data, but how can we send NFC data from a device?
I know this is an old question but I've encountered it and if someone is still searching - flutter_nfc_kit.
Yet another plugin to provide NFC functionality on Android and iOS.
This plugin's functionalities include:
read metadata and read & write NDEF records of tags / cards complying with:
ISO 14443 Type A & Type B (NFC-A / NFC-B / MIFARE Classic / MIFARE Plus / > MIFARE Ultralight / MIFARE DESFire)
ISO 18092 (NFC-F / FeliCa)
ISO 15963 (NFC-V)
transceive commands with tags / cards complying with:
ISO 7816 Smart Cards (layer 4, in APDUs)
other device-supported technologies (layer 3, in raw commands, Android only)
Note that due to API limitations not all operations are supported on both platforms.
This library uses ndef for NDEF record encoding & decoding.
Note: NDEF (NFC Data Exchange Format) is a light-weight binary format, used to encapsulate typed data. It is specified by the NFC Forum, for transmission and storage with NFC, however it is transport agnostic. (source: developer.android.com)

How to configure libnfc to use a specific device?

I have a Raspberry PI with two NFC readers attached. Problem is that the readers get different device numbers each time the system reboots or a reader is detached and attached again.
I therefore created udev rules that create a fixed device name depending on the physical port a device is attached to. E.g. plug in NFC reader in the upper left port leads always to /dev/nfc_a and plugged into the upper right port leads always to /dev/nfc_b.
How can I now configure libnfc to use these devices and report the device names such as /dev/nfc_a as a part of the reading? I am using Node-RED with node-red-contrib-nfc (https://github.com/hardillb/node-red-contrib-nfc) on top of libnfc. My ultimate goal is to safely distinguish the two readers within my Node-RED flow to act differently upon the readings.
I already found the "connstring" configuration but I don't know how to correctly set it for using /dev/nfc_a.
It's been a LONG time since I wrote this node, but looking back at the nodejs library it's based on (nfc) the output message should contain a field called deviceID which should indicate which NFC reader triggered the input.
When I run on my machine I get:
deviceID: 'pn53x_usb:001:005'
Where 001 is the USB bus id and 005 is the device ID, which matches up with the output from lsusb. These should stay static as long as the readers are always plugged into the same USB sockets.

NFC Reader : ACR122U-A9 not holding tags

The SDK provided along with NFC reader does not work and we are not able to write data / tag using the Tools available with SDK. The main issue is that the data written using another tool does not remain in the device for permanently. When tag is scanned using Android device, reader gets clear and we have to to write data again.
I have checked and tried instructions from https://github.com/fkooman/nfcip-java/blob/master/nfcip-java/doc/ACR122_PN53x.txt but it does not work.
So, we need help to understand what command is needed to keep data(tag) in Reader even if it has been unplugged from the computer. The reader needs to be working in emulation mode and should provide tags.
I know this is old but ranked in google so...
The ACR122U does not have any memory so it cannot save any state. You need to use it as you mentioned - writing to the device on each use.
Hope it helps someone.
First of all, the ACR122U was mainly designed as a contactless smartcard reader and not as a card emulator. However, it is possible to do host-based card emulation (HCE) with this device (see How to card emulate with ACR122U-A9). But note that there are issues with some versions of the ACR122U (e.g., see The PN532 configured as target has been released by its initiator).
Nevertheless, all this is host-based card emulation. So the ACR122U only acts as the contactless front-end for emulating a tag (or contactless smartcard). It's the host (the computer) to which the ACR122U is connected to that performs the actual emulation.
Thus, the ACR122U is not a stand-alone device that you could program to act as a tag. You always need an application running on the computer that is connected to the ACR122U (via USB) to perform the actual emulation.