-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Not found response. Tag not compatible with AID F222222222 #97
Comments
I can get a log if I pass in the logger, which outputs:
10:07:29 PM – debug: new reader detected 'ACS ACR 38U-CCID 00 00' |
I have the same problem and no idea what to do. Did you fixed it meanwhile? |
Unfortunately no. I never got an answer to this and could never figure it out. |
I don't know if its helpful for you but I found this: https://www.npmjs.com/package/simple-pcsc1 |
It depends on the card, I've 2 cards, one is a credit card and the second one a white rfid card. The credit card gives the error:
While the white card, works as expected
|
Can you link me to where you got the ones that work?
…On Tue, Jun 2, 2020, 06:24 Flavien Volken ***@***.***> wrote:
It depends on the card, I've 2 cards, one is a credit card and the second
one a white rfid card.
The credit card gives the error:
ACS ACR122U PICC Interface ERROR Error: Not found response. Tag not compatible with AID F222222222.
at ACR122Reader.handle_Iso_14443_4_Tag (/Volumes/CaseSensitive/nfc/node_modules/nfc-pcsc/dist/Reader.js:598:21)
ACS ACR122U PICC Interface CARD_REMOVED { atr: <Buffer 3b 86 80 01 43 68 69 70 31 37 33>,
standard: 'TAG_ISO_14443_4',
type: 'TAG_ISO_14443_4' }
While the white card, works as expected
ACS ACR122U PICC Interface CARD_INSERTED { atr:
<Buffer 3b 8f 80 01 80 4f 0c a0 00 00 03 06 03 00 01 00 00 00 00 6a>,
standard: 'TAG_ISO_14443_3',
type: 'TAG_ISO_14443_3',
uid: 'a7337062' }
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#97 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEWEM5N5527R7KU3VTJPTTRUT4SBANCNFSM4LFNQEZA>
.
|
@zacharycohn sure, I bought those: https://www.velleman.eu/products/view/?id=438176 but think the problem does not comes with the regular cards, it does with the protocol or those cards. The same reader is working and reading UID properly using @Sennar4 link. I therefore replaced Reader.ts 'use strict';
const EventEmitter = require('events');
class Reader extends EventEmitter {
reader = null;
logger = null;
constructor(reader, logger) {
super();
this.reader = reader;
if (logger) this.logger = logger;
else {
this.logger = {
log: () => { },
info: () => { },
warn: () => { },
error: () => { }
};
}
this.reader.on('error', (err) => {
this.logger.warn(` > Error [${this.reader.name}] : ${err.message}`);
this.emit('error', err);
});
this.reader.on('status', (status) => {
this.logger.log(`* Status [${this.reader.name}] : ${status}`);
// We should check what has been changed
const changes = this.reader.state ^ status.state;
this.logger.info(`# Changes [${this.reader.name}] : ${changes}`);
if (changes) { // If somethings changed?
if ((changes & this.reader.SCARD_STATE_EMPTY) && (status.state & this.reader.SCARD_STATE_EMPTY)) {
this.logger.info('- SCARD_STATE_EMPTY - There is no Card in the Reader');
// Let's disconnect from the Reader
reader.disconnect(reader.SCARD_RESET_CARD, (err) => {
if (err) this.logger.warn(err);
else this.logger.info('# SCardDisconnect - Terminated connection to the Reader made through SCardConnect');
});
}
else if ((changes & this.reader.SCARD_STATE_PRESENT) && (status.state & this.reader.SCARD_STATE_PRESENT)) {
this.logger.info('+ SCARD_STATE_PRESENT - There is a Card in the Reader');
// Let's connect to the Reader
this.reader.connect({ share_mode: this.reader.SCARD_SHARE_SHARED }, (err, protocol) => {
// Maybe Reader is used by another process or/and blocked
if(err) this.emitOnError(err, false);
else {
this.logger.info(`# SCardConnect - Established connection to the Reader through Protocol = ${protocol}`);
this.getTagUid(protocol);
}
});
}
}
});
this.reader.on('end', () => {
this.logger.info(`* Reader [${this.reader.name} removed`);
this.emit('end');
});
}
static reverseBuffer(src) {
let buffer = new Buffer(src.length);
for (var i = 0, j = src.length - 1; i <= j; ++i, --j) {
buffer[i] = src[j];
buffer[j] = src[i];
}
return buffer;
}
emitOnError(error, emitError = false) {
let err = error.toString();
if(err.indexOf('0x80100017') != -1) {
this.logger.warn(' > 0x80100017 - The specified reader is not currently available for use.');
this.emit('busy', err);
}
else if(err.indexOf('0x80100069') != -1) {
this.logger.warn(' > 0x80100069 - The smart card has been removed, so that further communication is not possible.');
this.emit('removed', err);
}
else this.logger.warn(err);
if(emitError) this.emit('error', err);
}
getTagUid(protocol) {
let packet = new Buffer([
0xFF, // Class
0xCA, // Ins
0x00, // P1: Get current card UID
0x00, // P2
0x04 // Le
]);
this.reader.transmit(packet, 40, protocol, (err, data) => {
// TODO: If SmartCard ejected too fast, we should inform about that via EventEmitter instead of `busy` event
if (err) return this.emitOnError(err, false);
else {
this.logger.info('* Data received', data);
// TODO: Bad bad bad ... should refactor this sh*t
if(typeof(data) == undefined) {
this.emit('error', 'Invalid data.');
return;
} else if(data.length !== 6) {
this.emit('error', 'Invalid data.');
return;
}
// Example: <Buffer 3f 82 55 b8 90 00>
// 3f 82 55 b8 - UID | 90 00 - returned code
let error = data.readUInt16BE(4);
if (error !== 0x9000) { // Decimal = 36864
this.emit('error', 'Error reading UID.');
return;
}
let uid = data.slice(0, 4).toString('hex').toUpperCase(); // HEX capitalized String
/* TODO: Add option for getting Decimal UID
let uidReverse = Reader.reverseBuffer(data.slice(0, 4)).toString('hex');
let uid = data.readInt16BE(0, 4);
*/
this.logger.info('UID: ', uid);
this.emit('card', {
uid: uid
});
}
});
}
close() { this.reader.close(); }
}
module.exports = Reader; and NFC.ts 'use strict';
const pcsclite = require('pcsclite');
const EventEmitter = require('events');
const Reader = require('./Reader');
export class NFC extends EventEmitter {
pcsc = null;
logger = null;
constructor(logger = console) {
super();
this.pcsc = pcsclite();
this.logger = logger ?? this.emptyLogger();
this.pcsc.on('reader', (reader) => {
this.logger.info('New reader detected', reader.name);
const device = new Reader(reader, this.logger);
this.emit('reader', device);
});
this.pcsc.on('error', (err) => {
this.logger.info('PCSC error', err.message);
this.emit('error', err);
});
}
private emptyLogger() {
return {
log: () => {
},
info: () => {
},
warn: () => {
},
error: () => {
}
};
}
close() {
this.pcsc.close();
}
} |
Hi @pokusew, I got the MiFare Classic 1K card to read/write with the NFC card reader and now I'm trying to test it for any credit card. I am receiving the same error as posted in this issue. I am testing it using Why do you think I am receiving this? Is it because the credit cards are more secure than MiFare Classic 1K cards? Environment Information: |
hi guys const nfc = new nfcPcsc.NFC(); nfc.on("reader", (reader) => {
}); nfc.on("error", (err) => { function parseAFL(afl) {
} |
this is the code in the link import nfcPcsc from "nfc-pcsc"; const nfc = new nfcPcsc.NFC(); nfc.on("reader", (reader) => {
}); nfc.on("error", (err) => { compile output ; root@firefly:/var/nfc/credit-card-reader/src# node test_nfc.js |
On Raspbian, I installed pcsc smoothly but when I run "npm start example" I get this:
9:39:02 PM – ACS ACR 38U-CCID 00 00 info: device attached
9:39:03 PM – ACS ACR 38U-CCID 00 00 error: an error occurred Error: Not found response. Tag not compatible with AID F222222222.
at Reader.handle_Iso_14443_4_Tag (/home/pi/SoundCube/nodeNFC/nfc-pcsc/src/Reader.js:767:17)
Not sure what that error means. The "An error occured" part is line 91 of read-write.js.
I'm using a Touchatag / acr122.
The text was updated successfully, but these errors were encountered: