Skip to content
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

Detect Reader #116

Open
lottafederico opened this issue Sep 29, 2021 · 4 comments
Open

Detect Reader #116

lottafederico opened this issue Sep 29, 2021 · 4 comments

Comments

@lottafederico
Copy link

lottafederico commented Sep 29, 2021

I'm using the ACR122u with a raspberry pi, the library works like a charm but when I reboot the Pi and the application start (automatically with Pm2) it doesn't detect the reader. The only way is to unplug and plug the reader again. I was using uhubctl library to phisically turn on/on the usb ports simulating the unplug but the Pi Zero doesn't support this feature. I've tried to use the node-pcsclite library and call pcsc.close() but doesn't work. The pi actually detect the reader (test done with lsusb). Any suggest? Thanks

@lottafederico lottafederico changed the title Detect Readeer Detect Reader Oct 1, 2021
@atoikka
Copy link

atoikka commented Mar 28, 2022

@lottafederico by any chance, did you find out anything?
I am currently seeing the same issue periodically. The next time I encounter, I'll try to look at pcsc_scan and see what it reports.

@mirkogeest
Copy link

I have exactly the same issue, but with pi 3. Did you manage to find a solution to this?

@atoikka
Copy link

atoikka commented May 28, 2022

I found out that it is likely a ACR122U reader firmware issue. I was able to find some references such as this and verified from the pcscd logs that it was unable to enumerate the device unless a complete power reset (i.e. replug of RPi power or the ACR122U itself) was done. I also experimented running pcscd on the foreground (with verbose logging) and issuing USB reset to the device - the results were odd, the ACR122U was functioning after about 20% of all resets.
We briefly discussed the idea of using a GPIO pin to drive the device's power supply, but found a good delivery option for the ACR1252U. I can confirm that the ACR1252U survives USB resets (no power loss) properly, and advise towards using it.

@mirkogeest
Copy link

For our topology we finally found a solution, as it is not an option to unplug the usb physically.
We use a balena docker image, so we added the uhubctl app, which allows turn usb off and on, to the Dockerfile.template:

RUN install_packages pcscd libusb-dev libpcsclite1 libpcsclite-dev dh-autoreconf python3 uhubctl g++

And at package.json we start this way:

  "scripts": {
    "start": "uhubctl -l 1-1 -p 2 -a off && uhubctl -l 1-1 -p 2 -a on && pcscd && node server.js"
  }

It's working like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants