Open normanb opened 10 years ago
Can you try this in a terminal and let me know if it works for you?
sudo chmod -x /usr/sbin/pcscd
sudo pkill pcscd
Hi, that has just killed my connectivity to the NFC device! Any ideas? I would like to get this working if possible.
Thanks.
On Mon, Mar 17, 2014 at 1:59 AM, François Beaufort <notifications@github.com
wrote:
Can you try this in a terminal and let me know if it works for you?
sudo chmod -x /usr/sbin/pcscd sudo pkill pcscd
Reply to this email directly or view it on GitHubhttps://github.com/GoogleChrome/chrome-nfc/issues/6#issuecomment-37791736 .
I have restart pcscd manually
pcscd --foreground --debug --apdu
I am seeing this in the debug.
/SourceCache/SmartCardServices_Executables/SmartCardServices-55105/src/PCSC/readerfactory.c:260:RFAddReader() RFAddReader: ACS ACR122U init failed: -2146435067
which seems to be because pcscd starts itself when the device is connected.
Hi norman,
could you define "Killed my connectivity to the NFC device"?
I'm asking you this because what Francois suggested was killing the PC/SC demon. In general this demon monopolises all control of smartcard and NFC readers. By killing the daemon all SC/NFC readers are left to itself and are free to be consumed by raw USB API's, like the chrome USB lib.
So if you mean it killed NFC connectivity outside of Chrome, thats ok. You can't do both at the same time. Or you use PC/SC or you use Chrome USB (but not both at the same time!)
If you want to stop experimenting with the Chrome USB and need to re-enable pcscd, just do
sudo chmod +x /usr/sbin/pcscd
and restart your Mac.
it stopped the device working, when I plugged it in the red light on the device didn't come in when I plugged it in.
On Mon, Mar 17, 2014 at 11:57 AM, Alex Van Boxel notifications@github.comwrote:
Hi norman,
could you define "Killed my connectivity to the NFC device"?
I'm asking you this because what Francois suggested was killing the PC/SC demon. In general this demon monopolises all control of smartcard and NFC readers. By killing the daemon all SC/NFC readers are left to itself and are free to be consumed by raw USB API's, like the chrome USB lib.
So if you mean it killed NFC connectivity outside of Chrome, thats ok. You can't do both at the same time.
Reply to this email directly or view it on GitHubhttps://github.com/GoogleChrome/chrome-nfc/issues/6#issuecomment-37848457 .
Hi norman,
this is normal, the red light came on because the PC/SC daemon took over the reader.
Now concerning the Mac. I've checked out the library and it doesn't seem to work for me either. I'll try to look at it tomorrow and see if I can get it running on my Mac.
@yjlou Do you have any hint on what's happening there?
getDevices
callback returns null even after killing the pcscd Mac daemon.
Hi Norman,
I don't have a Mac on hand. Is there any kernel module using the NFC reader? You could run "lsmod" and list the output to us. If you see something like "nfc" or "pn532", try to "sudo rmmod nfc" and "sudo rmmod pn532" to release the device. If this works, you may want to change your system configuration to remove the PN532 kernel module.
Sadly lsmod
doesn't exist on Mac OS. The equivalent seems to be kextstat
but when I grep it I don't find anything related to "nfc" or "pn532".
The closest I get is com.apple.driver.AppleUSBCardReader
. Not sure it helps...
Guys, I've been looking at the issue and I wonder why it even works on ChromeOS... the reason it doesn't work is the the devices returned by:
https://developer.chrome.com/apps/usb#method-getDevices
is of type Device
But the method:
https://developer.chrome.com/apps/usb#method-claimInterface
expects a ConnectionHandle
, this handler is returned by
https://developer.chrome.com/apps/usb#method-findDevices
So replacing the getDevices
by findDevices
in the code makes it work.
The big question here is, why does it work on ChromeOS?
Thank you @alexvanboxel! Nice catch!
I've submitted a PR for that at #8 that @yjlou can approve it.
It basically reverts my change of renaming findDevices
to getDevices
great, I will test this tomorrow and report back. Thanks for the help.
On Thu, Mar 20, 2014 at 3:02 AM, François Beaufort <notifications@github.com
wrote:
Thank you @alexvanboxel https://github.com/alexvanboxel! Nice catch!
I've submitted a PR for that at #8https://github.com/GoogleChrome/chrome-nfc/pull/8that @yjlou https://github.com/yjlou can approve it. It basically reverts my change of renaming findDevices to getDevices
Reply to this email directly or view it on GitHubhttps://github.com/GoogleChrome/chrome-nfc/issues/6#issuecomment-38146216 .
I tested it on a mac and I get
14:48:20.156 Enumerated 1 devices chrome-nfc.js:27 Array[1] chrome-nfc.js:27 14:48:20.163 claimed chrome-nfc.js:27 Object chrome-nfc.js:28 14:48:20.167 tiny reply! chrome-nfc.js:66 Object chrome-nfc.js:66 0 devices remaining chrome-nfc.js:25 14:48:20.172 released chrome-nfc.js:25 14:48:20.173 closed chrome-nfc.js:25 NFC.device.open() = 1 chrome-nfc.js:21 Uncaught TypeError: Cannot read property 'productId' of undefined
I will look into this, this seems like something I can solve :)
it looks like chrome is finding my device, however this is not being passed back to find devices. I can dig into it a little more.
16:49:45.960 Enumerated 1 devices chrome-nfc.js:27chrome-extension://bjikgcclhgdgkpgjdhlmpenlafigfemp/chrome-nfc.js Array[1] chrome-nfc.js:27chrome-extension://bjikgcclhgdgkpgjdhlmpenlafigfemp/chrome-nfc.js 16:49:45.966 claimed chrome-nfc.js:27chrome-extension://bjikgcclhgdgkpgjdhlmpenlafigfemp/chrome-nfc.js Object
chrome-nfc.js:28chrome-extension://bjikgcclhgdgkpgjdhlmpenlafigfemp/chrome-nfc.js 16:49:45.969 tiny reply! chrome-nfc.js:66chrome-extension://bjikgcclhgdgkpgjdhlmpenlafigfemp/chrome-nfc.js Object chrome-nfc.js:66chrome-extension://bjikgcclhgdgkpgjdhlmpenlafigfemp/chrome-nfc.js 0 devices remaining chrome-nfc.js:25chrome-extension://bjikgcclhgdgkpgjdhlmpenlafigfemp/chrome-nfc.js 16:49:45.973 released chrome-nfc.js:25chrome-extension://bjikgcclhgdgkpgjdhlmpenlafigfemp/chrome-nfc.js 16:49:45.974 closed chrome-nfc.js:25chrome-extension://bjikgcclhgdgkpgjdhlmpenlafigfemp/chrome-nfc.js NFC.device.open() = 1 chrome-nfc.js:21chrome-extension://bjikgcclhgdgkpgjdhlmpenlafigfemp/chrome-nfc.js Uncaught TypeError: Cannot read property 'productId' of undefined
On Thu, Mar 20, 2014 at 11:25 AM, Norman Barker norman@cloudant.com wrote:
great, I will test this tomorrow and report back. Thanks for the help.
On Thu, Mar 20, 2014 at 3:02 AM, François Beaufort < notifications@github.com> wrote:
Thank you @alexvanboxel https://github.com/alexvanboxel! Nice catch!
I've submitted a PR for that at #8https://github.com/GoogleChrome/chrome-nfc/pull/8that @yjlou https://github.com/yjlou can approve it. It basically reverts my change of renaming findDevices to getDevices
Reply to this email directly or view it on GitHubhttps://github.com/GoogleChrome/chrome-nfc/issues/6#issuecomment-38146216 .
I still had to run this below to make it work by the way.
sudo chmod -x /usr/sbin/pcscd
sudo pkill pcscd
If you don't execute this, you have the reader detected but you're not able to read/write.
Just like Francois said, this looks like chrome.usb.claimInterface() failed. Please check if the dev permission is proper.
And, thanks for the good catch. I should have caught that, but not. Thanks.
On Mon, Mar 24, 2014 at 1:56 AM, François Beaufort <notifications@github.com
wrote:
I still had to run this below to make it work by the way.
sudo chmod -x /usr/sbin/pcscd sudo pkill pcscd
If you don't execute this, you have the reader detected but you're not able to read/write.
Reply to this email directly or view it on GitHubhttps://github.com/GoogleChrome/chrome-nfc/issues/6#issuecomment-38422436 .
what do you mean by dev permission is proper?
sorry. device permission. either the udev rules or a program is using that.
On Mon, Mar 24, 2014 at 8:46 PM, normanb notifications@github.com wrote:
what do you mean by dev permission is proper?
Reply to this email directly or view it on GitHubhttps://github.com/GoogleChrome/chrome-nfc/issues/6#issuecomment-38528242 .
@normanb did you ever figure out the fix to your issue? I'm running into exactly the same problem.
HI,
no it never worked for me, I still have an NFC Reader/Writer so I am interested.
Norman
From: Zertz notifications@github.com To: GoogleChrome/chrome-nfc chrome-nfc@noreply.github.com, Cc: normanb norman@cloudant.com Date: 05/13/2014 08:17 PM Subject: Re: [chrome-nfc] Mac Issues (#6)
@normanb did you ever figure out the fix to your issue? I'm running into exactly the same problem.
— Reply to this email directly or view it on GitHub.
@normanb This definitely isn't an issue with our code, but rather the OS is taking over control of the reader, which stops Chrome from being able to access it. I didn't investigate much on the Mac, but I managed to make some progress on Windows (8.1, all the latest updates). The basic idea is that the red light must not be on when launching the Chrome app.
I managed to write a tag, but having issues reading it back. The library thinks my tags are Mifare Ultralight when they're actually NTAG203.
I'll keep you posted.
sudo chmod -x /usr/sbin/pcscd sudo pkill pcscd
This stop working after update to yosemite. Any ideas?
I have an ACR122 Device but I'm getting errors, I am running OS X 10.10.2
under yosemite, try to execute
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.ifdreader.plist
I have the same issue with @jethroguce , thanks for @celevra solution, It works for me!! yay!
It seems that Chrome can find the NFC device on a Mac, but then it dies.
14:57:22.981 Enumerated 1 devices chrome-nfc.js:27 Array[1] 0: Object device: 1 productId: 8704 vendorId: 1839 proto: Object length: 1 proto: Array[0] : : chrome-nfc.js:27 Uncaught Error: Invalid value for argument 1. Property 'handle': Property is required, Property 'device': Unexpected property. extensions::schemaUtils:34 NFC.device.open() = 1 chrome-nfc.js:21 Uncaught TypeError: Cannot read property '0' of null
Any ideas?