Giter Site home page Giter Site logo

Comments (18)

reillyeon avatar reillyeon commented on May 12, 2024 1

@atvvarna You need to do with it says, add a "usbDevices" permission dictionary to the "optional_permissions" section of the manifest like this:

"optional_permissions": [
    {
      "usbDevices": [
        {
          "vendorId": 3034,
          "productId": 10290
        },
        {
          "vendorId": 3034,
          "productId": 10296
        }
      ]
    }
  ]

(copied from the Radio Receiver app)

from chrome-extensions-samples.

reillyeon avatar reillyeon commented on May 12, 2024 1

Are you calling the function during a user gesture? Permissions must be requested in the context of an event handler for a user gesture such as clicking a button.

from chrome-extensions-samples.

kjantzer avatar kjantzer commented on May 12, 2024

Hey @ohmmmo

I too am trying to get the 450 Turbo to work. I figured out how to fix the "device not found" issue, but unfortunately can't get anything to print.

To find the device you'll need to update the product ID in two places:

index.js:
var productId = 0x0021; // changed from 0x0020

manifest.json
"optional_permissions": [ {"usbDevices": [{"vendorId": 2338, "productId": 33}]}] // changed from 32

from chrome-extensions-samples.

kjantzer avatar kjantzer commented on May 12, 2024

#176 fixes this issue. You still need to make the changes I listed above though.

from chrome-extensions-samples.

mangini avatar mangini commented on May 12, 2024

Thank you @kjantzer . I've added your information in the sample's README.md

from chrome-extensions-samples.

sdaclin avatar sdaclin commented on May 12, 2024

Hi @kjantzer, did you finally manage to print via USB on WIN 7 ?

I'm facing the same problem with the API on Win7. I manage to find the device via chrome.usb.getDevices but I can't open it.
I wonder if it's possible to open a device like an usb thermal printer on win 7.

from chrome-extensions-samples.

kjantzer avatar kjantzer commented on May 12, 2024

@sdaclin sorry, but I only tested on a Mac

from chrome-extensions-samples.

sdaclin avatar sdaclin commented on May 12, 2024

I have done further investigations and chrome usb api can't manage generic text driver. I'm going to write an issue on chromium tracker.

from chrome-extensions-samples.

sdaclin avatar sdaclin commented on May 12, 2024

I have tested http://zadig.akeo.ie/ generic usb drivers for windows and it seems to be ok.

from chrome-extensions-samples.

RimaSGit avatar RimaSGit commented on May 12, 2024

@kjantzer I was able to detect our printer using the app and also allowed the permission request. But it could not actually print using that printer even after allowing access. I am using Chrome browser on Mac. Any help?

from chrome-extensions-samples.

kjantzer avatar kjantzer commented on May 12, 2024

@RimaSGit – did you apply this patch: 9b9fdd6

Other than trying that, I don't have any other advice. I ended up needing to print with the label writer.

from chrome-extensions-samples.

RimaSGit avatar RimaSGit commented on May 12, 2024

@kjantzer Thank you Kevin. I have the same patch. The other thing I wanted to make sure is the info endpoint which is “2”, I am not sure how to I get that for my device?
I did use the chrome.usb.listInterfaces to get all that data, there are many endpoints listed in it, so I am not sure which one to use and if I need to convert this to raw address before using it?

Thanks a lot.

from chrome-extensions-samples.

kjantzer avatar kjantzer commented on May 12, 2024

Unfortunately what you said goes right over my head. I have very little experience with hardware and low level programming.

I know that on a mac you can get some device info by opening "System Information"

screen shot 2015-06-10 at 1 42 18 pm

from chrome-extensions-samples.

atvvarna avatar atvvarna commented on May 12, 2024

I've set everything but always get in the log:
App was not granted the "usbDevices" permission.
Object {message: "Optional permissions must be listed in extension manifest."}

I didn't see the permission window.
Any help?

from chrome-extensions-samples.

RimaSGit avatar RimaSGit commented on May 12, 2024

I think you need this in your manifest.json for usb permissions

"usb_printers":{

"filters":[

  {

    "vendorId": yourvendorID

  }

 ]

},

"permissions": [

"usb",

...........

From: atvvarna <[email protected]mailto:[email protected]>
Reply-To: GoogleChrome/chrome-app-samples <[email protected]mailto:[email protected]>
Date: Friday, May 20, 2016 at 12:15 PM
To: GoogleChrome/chrome-app-samples <[email protected]mailto:[email protected]>
Cc: Microsoft Office User <[email protected]mailto:[email protected]>, Mention <[email protected]mailto:[email protected]>
Subject: Re: [GoogleChrome/chrome-app-samples] chrome.usb device not found on Windows (#126)

manifest

from chrome-extensions-samples.

atvvarna avatar atvvarna commented on May 12, 2024

Thanks for the fast reply, yes I have it there but it seems that messed up as tried different IDs.
Now I have:
App was not granted the "usbDevices" permission.
index.js:54 Object {message: "This function must be called during a user gesture"}

from chrome-extensions-samples.

atvvarna avatar atvvarna commented on May 12, 2024

I didn't modify the code at all, just change the vendor/productIDs.
The printer is found by chrome without any problems and I can print trough standard print dialog of chrome.

from chrome-extensions-samples.

atvvarna avatar atvvarna commented on May 12, 2024

I've just found that in chrome://settings/contentExceptions#plugins if I start the application I see that chrome automatically add block exception. Even if I manually add allow the block is still added on top. What can cause that?

from chrome-extensions-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.