-
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
Invalid response length 6. Expected length was 9 bytes. #3
Comments
Hi, thank you for reporting this bug. Now you should be able to read card UID when you attach it to your NFC reader without any problems. Could you test it? If everything is OK, I will close this issue. |
@pokusew Here is the code. Thanks for your response |
Hi @SuThaw, I am so sorry. I have mistakenly forgotten to run build before publishing the 0.3.0 version, so the dist folder in 0.3.0 was outdated and still contained the bug. Now I have properly run build before publishing and published the new version 0.3.1. Everything should now work in version 0.3.1 as I have written before. Could you test it? If everything is OK, I will close this issue. Thank you very much. |
Hi @pokusew |
Hi @SuThaw, This error means that the operation (reading/writing) could not be completed successfully (response status code is 0x9000). I haven't tested reading Mifare 1K Card because I don't have any (I am using Mifare Ultralight) But I have looked into some docs. According to them, it looks like you must authenticate using authenticating keys (A or B, depending which blocks you want to access) before you can read/write data. Here is the documentation of ARC122U API API-ACR122U-2.03.pdf. There are methods for loading authentication keys and authenticating blocks. You can send them to the reader using I could integrate this commands to this library, if it is useful for you. I hope my answer will help you. btw. you can join here https://discord.gg/bg3yazg and we can solve this issue faster using chat |
Hi @SuThaw, I have finally implemented support for authentication. Keys are automatically loaded into reader's memory when authenticating. See https://github.com/pokusew/nfc-pcsc/blob/authentication-support/test/index.js. I have created new branch Could you clone this branch and test if everything works for you? Thank you. |
@pokusew |
Hi @SuThaw, I am sorry for late response, but I have been very busy. It's strange that you have got this error. It could be caused by incompatibility of authenticate command with version of your reader. According to the API specification, I have added support for obsolete version of authenticate command too. For easier debugging, I have also added console.log to log content of sent APDU commands packets. Could you test it if it solves the problem? Please make sure that you are using correct authentication key and key type for blocks that you want to access. If the problem persists, we can chat to solve this faster. I believe it should work. |
Hi @pokusew |
Hi @SuThaw, It is different error than last time. I am ready for chat. |
This issue should be resolved as authentication support for Mifare Classic cards has been merged to master and released in v0.4.0. |
I got that message when i try to read or write MiFare 1K card. What is wrong ?
The text was updated successfully, but these errors were encountered: