Code Monkey home page Code Monkey logo

Comments (6)

filinvadim avatar filinvadim commented on July 17, 2024 1

BTW Mac has same problem but it hasn't udev rules

from gousb.

zagrodzki avatar zagrodzki commented on July 17, 2024

Please send the output with ctx.Debug(4) added before a call to OpenDevices. What platform are you running on?

from gousb.

minhajakhterkhan199 avatar minhajakhterkhan199 commented on July 17, 2024

development environment is Ubuntu 64. Please find the output below

--------------------------------------------------------------------------------
[ 0.732632] [0000199a] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.732665] [0000199a] libusb: debug [handle_events] poll fds modified, reallocating
[ 0.732691] [0000199a] libusb: debug [handle_events] poll() 2 fds with timeout in 100ms
[ 0.733536] [000019a0] libusb: debug [linux_udev_event_thread_main] udev event thread entering.
[ 3.806486] [0000199a] libusb: debug [handle_events] poll() returned 0
[ 4.822469] [0000199a] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 4.822494] [0000199a] libusb: debug [handle_events] poll() 2 fds with timeout in 100ms
[ 4.822474] [00001993] libusb: debug [libusb_get_device_list] 
[ 4.822594] [00001993] libusb: debug [libusb_get_device_descriptor] 
[ 4.822637] [00001993] libusb: debug [libusb_get_config_descriptor] index 0
[ 5.399340] [0000199a] libusb: debug [handle_events] poll() returned 0
[ 5.916213] [0000199a] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 5.916229] [0000199a] libusb: debug [handle_events] poll() 2 fds with timeout in 100ms
[ 7.147556] [0000199a] libusb: debug [handle_events] poll() returned 0
[ 7.147578] [0000199a] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 7.147582] [0000199a] libusb: debug [handle_events] poll() 2 fds with timeout in 100ms
[ 7.147745] [00001993] libusb: debug [libusb_open] open 1.5
[ 7.147822] [00001993] libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/005: Permission denied
[ 7.147827] [00001993] libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
[ 7.147829] [00001993] libusb: debug [libusb_open] open 1.5 returns -3
[ 9.406398] [0000199a] libusb: debug [handle_events] poll() returned 0
[ 9.406423] [0000199a] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 9.406426] [0000199a] libusb: debug [handle_events] poll() 2 fds with timeout in 100ms
[ 9.409305] [00001993] libusb: debug [libusb_get_device_descriptor] 
[ 9.409330] [00001993] libusb: debug [libusb_get_config_descriptor] index 0
[10.896267] [00001993] libusb: debug [libusb_get_device_descriptor] 
[10.896296] [00001993] libusb: debug [libusb_get_config_descriptor] index 0
[10.898191] [0000199a] libusb: debug [handle_events] poll() returned 0
[10.898284] [0000199a] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[10.898293] [0000199a] libusb: debug [handle_events] poll() 2 fds with timeout in 100ms
[11.809498] [0000199a] libusb: debug [handle_events] poll() returned 0
[11.809520] [0000199a] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[11.809525] [0000199a] libusb: debug [handle_events] poll() 2 fds with timeout in 100ms
[14.275903] [0000199a] libusb: debug [handle_events] poll() returned 0
[14.275981] [0000199a] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[14.275985] [0000199a] libusb: debug [handle_events] poll() 2 fds with timeout in 100ms
[16.427548] [0000199a] libusb: debug [handle_events] poll() returned 0
[16.427600] [0000199a] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[16.427606] [0000199a] libusb: debug [handle_events] poll() 2 fds with timeout in 100ms
[17.309986] [0000199a] libusb: debug [handle_events] poll() returned 0
[17.310024] [0000199a] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[17.310028] [0000199a] libusb: debug [handle_events] poll() 2 fds with timeout in 100ms
2017/10/01 13:08:02 list: libusb: bad access [code -3]```

from gousb.

zagrodzki avatar zagrodzki commented on July 17, 2024

This is the relevant part:

[ 7.147822] [00001993] libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/005: Permission denied
[ 7.147827] [00001993] libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
[ 7.147829] [00001993] libusb: debug [libusb_open] open 1.5 returns -3

The user you're running as does not have permissions to access that USB device. You'll need to update the udev rules or change device permissions in some other way.

from gousb.

minhajakhterkhan199 avatar minhajakhterkhan199 commented on July 17, 2024

Thanks for your prompt response issue fixed!
Kindly give me example / source code, how to write & read data on USB interface.
In this regards, waiting for your response.

Best Regards,

from gousb.

zagrodzki avatar zagrodzki commented on July 17, 2024

See https://godoc.org/github.com/google/gousb#pkg-examples and https://github.com/google/gousb/tree/master/rawread for examples.

from gousb.

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.