nfc-pcsc
nfc-pcsc copied to clipboard
Starting issue with electron
Hello. I'm developing a React+Electron app and I'm also using this library to read some bands with a nfc reader. The problem I have is that on some computers the app runs perfectly, but on the others, the app starts as a background process and it stays there with no error.
Any idea what can cause this to happen?
LE: If I remove the line
this.nfc = new NFC();
, the app starts normally on all computers. So it's something cause by the initialization.
Attach a card-reader to the computer then start the program, it issome logic problem that if no card reader found it freezes the program withput any error response.
@danielhanzs I tried what you said. I installed the needed usb driver and attached the usb reader and now the app works. The strange thing is that it works now even without the nfc reader connected. Like it installed something when it connected and now it doesn't need it anymore. Any idea how to solve this?
I have another person which tried only installing the nfc usb driver, but no success. So it must be related to the usb reader itself.
If you connect the device and start the application and desconnect the devie without restarting the application it will start searching for the readers instead of stopping the application which is good.
I will try tomorrow the https://www.npmjs.com/package/usb-detection repo
var usbDetect = require('usb-detection'); usbDetect.startMonitoring();
usbDetect.on('add', function(device) { console.log(device); });
On add event I will check if the device, vendorId or productId or deviceName or manufacturer is the one I'm searching for (needed only for ACR122 USB reader) and then I will call the new NFC() class.
I'm at home will test it tomorrow at workplace if physical reader needed to be connected or the installed driver will solve the problem.
For a solid solution I will stick with usb detect.
PS.: For usb-detection you need full vs2017 community the windows-build-tools not sufficient enough to build it.
Ok. Thank you very much!
I don't think this is the "right" solution, there are many card readers on market and manually listing them in some enum is not very maintainable approach. Is there some flag for "not waiting for card reader connection"?