googlearchive/chrome-nfc

Not work on Windows 7

Opened this issue · 11 comments

Tried chrome.usb API on Windows 7, but got nothing:

chrome.usb.findDevices({"vendorId": 1254, 'productId': 21905}, function(d) { DEBUG(d); });
undefined
[]
chrome.usb.getDevices({"vendorId": 1839, 'productId': 8704}, function(d) { DEBUG(d); });
undefined
[]

Tried "enable experimental API"
Tried "remove SCM and ACR driver in device manager"

No luck.

@yjlou maybe you can handle permission management before calling getDevices. It works for me on Win7.
The steps are :

  • configure your manifest with permissions => usb and custom optional permissions matching your pId and vId
"permissions": ["usb"],
"optional_permissions": [
    {
      "usbDevices": [
        {
          "vendorId": 1273,
          "productId": 51
        }
      ]
    }
  ]
  • Use requestPermissions before getting device with your pId and vId :
chrome.permissions.request(
              {permissions: [
                {'usbDevices': [
                  {
                    vendorId: 0x04f9,
                    productId: 0x0033
                  }
                ]}
              ]}, function (result) {
                if (result) {
                  chrome.usb.getDevices({
                    vendorId: 0x04f9,
                    productId: 0x0033
                  }, function (devices) {
[...]

These steps works for me in windows for a zebra 2844 printer.
auth

I'm also unable to get this to work in Windows (Windows 8 for me) and I suspect it's related this Chromium bug 302278.

I setup a branch to debug this issue and I am running into the exact problem outlined in that Chromium bug 302278.

@KishCom : have you tried with generic usb driver like Zadigs one ?
See GoogleChrome/chrome-extensions-samples#203.
See http://zadig.akeo.ie/

Hey Andrew,

The USB implementation in Chrome relies heavily on a third party library, libusbx. Unfortunately its Windows implementation can only access devices with some kind of kernel-mode driver installed, which is where WinUSB et al come in. Usually even this is fine because Windows will often handle devices through WinUSB by default.

It seems like smart card readers are a special case in Windows Vista+. It's possible that they're owned exclusively by the system card reader service. Hopefully, the chromium team will be able to address this issue.

@sdaclin I did try with the Zadigs driver (WinUSB and libusb-win32). It does not appear to support WCID, no access is given to the device. Did your printer support WCID? Or is that even a factor?
I have both the ACR122U and SCL3711 devices. No luck with either.

@beaufortfrancois Exactly what I thought was going on -- I imagine getting access to USB across all the platforms in a uniform way is tricky. I'll keep my eye on it. Hopefully they address it, I'd love to use these reader/writers in a project I'm working on :)

@KishCom ok for the WCID spec.
No, mine printer isn't WCID compliant.

Not sure if it's doable for you or not, but it works great on Chrome OS and fine on Mac OS and Linux.

I haven't had time to test on more computers yet, but the definitive fix on Windows 8.1 seems to be using the Zadig tool linked above to install the libusbK driver. Once that's done, disconnect and reconnect the reader.

I don't know about the SCL3711, but on the ACR122, the red light should no longer light up, This means Windows is no longer taking control of the device, which let's Chrome take over.

Note that you need to do this for every USB port you use the NFC reader with.

I have Window 7 64bits to try this sample code with SCL3711 installed by its official driver. Then to launch the app, but there is nothing shown on the Device tab as well as not able to read/write the tag.

Next, I replace the driver with libusb-win32(v1.2.6.0) using Zadig, reconnect the reader and the light doesn't light up. The name, vendor ID and product ID shown up on the Device tab finally, but no luck, app isn't still able to read/write the tag. Does anyone have ideas?

UPDATED as below (24 Jul 2015):
I think the tag maybe has no messages or not be initialized. Hence, I recover driver to official one back, and initialize the tag and write a text message using the vendor's utility. Again, replace driver with libusb, still no luck.

This sample app is actually a web app that inspires me to open up the console of Chrome Dev-tool. Following list is printed out by app:

14:50:54.645 >0000FFFFFF0004FCD44A0100E100
chrome-nfc.js:1844 14:50:54.653 <0000FF00FF00
chrome-nfc.js:1844 14:50:54.669 <0000FF0FF1D54B010100440807040F3382B620806D00
chrome-nfc.js:1034 DEBUG: InListPassiveTarget SENS_REQ(ATQA)=0x44, SEL_RES(SAK)=0x8
chrome-nfc.js:1037 DEBUG: tag_id: 040F3382B62080
chrome-nfc.js:1039 DEBUG: found Mifare Ultralight (106k type A)
chrome-nfc.js:610 [DEBUG] nfc.wait_for_passive_target: tt2 with ID: 040F3382B62080
chrome-nfc.js:1892 14:50:54.680 >0000FFFFFF0005FBD440013000BB00
chrome-nfc.js:1844 14:50:54.687 <0000FF00FF00
chrome-nfc.js:1844 14:50:54.692 <0000FF03FDD54113D700
chrome-nfc.js:1004 ERROR: InDataExchange reply status = [19] format error during rf communication
chrome-nfc.js:967 14:50:57.687 [1000001] timeout!

What does the ERROR mean?

I'm also having the same problem. I've been through to same steps as above. The reader is detected, but when it attempts to read a card, I get the "InDataExchange..." error.

Is this library still supported? I see no recent updates on here.