-
Notifications
You must be signed in to change notification settings - Fork 127
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 while transmitting: Card was reset #19
Comments
Hi @SamVerschueren, firstly, could you please provide more details?
According to my quick search, it looks like a strange error connected to Windows OS. Also I have found an interesting thread related to this problem. I believe, we can find a solution together. So, please answer my questions. Hope it helps. |
Hi @pokusew, thanks for the quick reply. I know, my initial post was very brief but didn't have much time to provide more details, so here we go.
Here is the code that shows the behaviour 'use strict';
const NFC = require('nfc-pcsc').default;
const nfc = new NFC();
nfc.on('reader', reader => {
reader.on('card', card => {
console.log(`Card detected (${card.type})`);
const data = Buffer.from([0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0]);
reader.write(6, data)
.then(result => {
console.log('done!');
console.log(result);
})
.catch(err => {
console.log('error');
console.error(err);
});
});
}); Save that file as When I reduce the size of the data buffer to 8 bytes, it seems to work perfectly fine. So I tried to chop my data array in chunks of 4 bytes each and wrote them sequentially to the tag. The first 2 or 3 chunks work, but then I get the same error or another one indicating that the card is unpowered. So maybe I'm doing something wrong here, but I need to write 64 bytes (or more) to the tag and am not sure how I can achieve that. |
I often get a
WriteError
but can't really find a workaround for this. I also have no clue what the error message even means. Does someone have a clue how I can solve this?The text was updated successfully, but these errors were encountered: