libusb | Access USB devices from Ruby via libusb-1.x

 by   larskanis Ruby Version: Current License: LGPL-3.0

kandi X-RAY | libusb Summary

kandi X-RAY | libusb Summary

libusb is a Ruby library. libusb has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has low support. You can download it from GitHub.

Access USB devices from Ruby via libusb-1.x
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              libusb has a low active ecosystem.
              It has 148 star(s) with 33 fork(s). There are 22 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 6 open issues and 22 have been closed. On average issues are closed in 114 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of libusb is current.

            kandi-Quality Quality

              libusb has 0 bugs and 0 code smells.

            kandi-Security Security

              libusb has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              libusb code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              libusb is licensed under the LGPL-3.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              libusb releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.
              libusb saves you 1573 person hours of effort in developing the same functionality from scratch.
              It has 3498 lines of code, 432 functions and 37 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed libusb and discovered the below as its top functions. This is intended to give you an instant insight into libusb implemented functionality, and help decide if they suit your requirements.
            • Register a hotplug event
            • Perform a transfer control transfer
            • Perform a bulk transfer .
            • Sets log option .
            • Registers a list of file descriptors .
            • Send a message to the server
            • Open the device
            • Read an IO object .
            • gets the buffer from the buffer
            • Performs a bulk transfer .
            Get all kandi verified functions for this library.

            libusb Key Features

            No Key Features are available at this moment for libusb.

            libusb Examples and Code Snippets

            No Code Snippets are available at this moment for libusb.

            Community Discussions

            QUESTION

            Can libusb be build using GNU GCC compiler?
            Asked 2021-Jun-10 at 14:03

            I am trying to start using libusb for communication via COM port ( EDIT: for my Rs232 device), on windows 10 x64 only. My IDE is Code:blocks. I have a couple of questions:

            I downloaded libusb from their website (latest windows binaries)

            But I noticed there is a libusb-win32 ''version'' of it in sourceforge. It says

            "libusb-win32 is a port of libusb-0.1 under Windows"

            1. What does this mean, and should I use the "latest windows binaries" version or the "libusb-win32" version?

            Also, the Readme file from their website (the 'libusb windows binaries' one) has instructions for compiling in Visual Studio and Mingw and there are files for Visual studio and Mingw only.

            1. Does this means I cannot compile the libusb it in GNU GCC compiler?

            EDIT: the question 2) is already answered here: https://stackoverflow.com/a/38252750/13294095

            ...

            ANSWER

            Answered 2021-Jun-10 at 14:03

            "I am trying to start using libusb for communication via COM port ( EDIT: for my Rs232 device), on windows 10 x64 only"

            If you have a device that when you plug it into your PC via a USB port, it instantiates a COM port, then that device does have a UART. The device must also have driver that upon connecting to the PC is installed, and results in establishing the serial port you can see in device manager (under ports) Read about USB serial driver for some background.

            "I have a physical uart device after the Rs232, I my MCU. I use the Rs-232 to translate from UART to USB protocol. -Even though I do not know what "Virtual com port" is."

            Your device may have a UART, but when you plug it into a PC via a USB port, a virtual serial port is created via a driver on the PC... "When the USB to serial adapter is connected to the computer via the USB port the driver on the computer creates a virtual COM port which shows up in Device Manager on Windows"... Read more here. (under Architecture)

            In short, if when you plug your device into the PC, you can see a port that has been created in Device Manager, then all the work is done. Your application code can incorporate a C serial port library to open a port and send/receive serial messages, etc. However, if you are developing the device with the UART to work on a Windows PC via a USB port, then yes, you need to create a driver. Maybe then libUSB is for you.

            Source https://stackoverflow.com/questions/67920784

            QUESTION

            Installation problem on Raspberry Pi 4 Debian 10
            Asked 2021-May-03 at 08:45

            I can't install Onboard-SDK on my raspberry PI. What I should do? I used instruction from and was blocked during use cmake ..: https://developer.dji.com/onboard-sdk/documentation/quickstart/development-environment.html

            pi@raspberrypi:~/Onboard-SDK/build $ lsb_release -a

            ...

            ANSWER

            Answered 2021-May-03 at 08:45

            The error message is pretty clear

            Cannot Find FFMPEG

            You can install it via sudo apt install ffmpeg libavcodec-dev libavformat-dev libavfilter-dev

            Source https://stackoverflow.com/questions/67358799

            QUESTION

            Ubuntu 20.04 Could NOT find MPIR during gr-iio cmake
            Asked 2021-Feb-28 at 00:29

            For the third time I reinstalled Ubuntu 20.04 on a Windows 10 machine running VMWare whilst attempting to install GNU Radio Companion 3.8 with the PlutoSDR gr_iio blocks. Each time failed with a different error.

            I am charting my most recent attempt below. Any help is greatly appreciated.

            1. Installed Ubuntu 20.04 on VMWare
            2. Updated Ubuntu
            3. cp ./53-adi-plutosdr-usb.rules /etc/udev/rules.d/
            4. sudo service udev restart
            5. checked the output of dmesg
            6. Since I had no ~/.ssh/config file I ran wget https://raw.githubusercontent.com/analogdevicesinc/plutosdr_scripts/master/ssh_config -O ~/.ssh/config
            7. ssh plutosdr to add to list of known hosts. I verified the IP and firmware version.
            8. sudo apt-get install libiio-utils and verified I can talk to the device via iio_info -n 192.168.2.1 | grep device The following output was produced:
            ...

            ANSWER

            Answered 2021-Feb-28 at 00:29

            Accoding to the documentation, the gr-iio project doesn't include the GNU Radio project but expects you to build it in advance.

            However, you only built libiio and libad9361, but not the GNU Radio library from https://github.com/gnuradio/gnuradio. The config file gr-iio is complaining about should be installed when installing GNU Radio.

            Regarding MPIR: While MPIR started as a fork of gmp you can't install gmp as a replacement for MPIR, as they use different names for their headers and libraries. Which is why MPIR is still not being found after you've installed the development packages for gmp. If ubuntu doesn't provide packages for MPIR you'll have to compile it from source.

            Source https://stackoverflow.com/questions/66402771

            QUESTION

            Reading from an NFC reader directly into a desktop web application?
            Asked 2021-Feb-22 at 14:36

            I have LibNFC working from the Linux terminal recognising my ACR122U Reader, and I wanted to know if there was a method for it to work through Chrome on a Linux Desktop as it is really similar to Android Support, with all the NFC device handling done by libnfc and the browser just has to know about this library instead of every type usb or other device than can do NFC.

            I have tried using the WebNFC API to connect it :

            ...

            ANSWER

            Answered 2021-Feb-10 at 06:54

            Web NFC is supported on Android only as of February 2021. See https://web.dev/nfc/

            The WebUSB error suggests you're requesting an interface that implements a protected class (among those below):

            Source https://stackoverflow.com/questions/66111078

            QUESTION

            Run script after all udev rules are through and device is completely initialized
            Asked 2021-Feb-16 at 09:06

            I am attempting to read information from a usb device after it is attached.

            The information I require are accessed through two APIs: v4l2 and libusb. Both are used through a script that is correctly called as the v4l2 part executes are expected.

            ...

            ANSWER

            Answered 2021-Feb-16 at 09:06

            The way to go seems to be systemd.

            The systemd unit camera-index@.service

            Source https://stackoverflow.com/questions/65718937

            QUESTION

            Building node-usb for Electron
            Asked 2021-Jan-30 at 19:11

            I have cloned electron-react-boilerplate from GitHub, which comes with Electron 11.0.1:

            ...

            ANSWER

            Answered 2021-Jan-30 at 19:11

            Electron 11 has a newer version of V8 JS engine which the native module usb@1.6.3 with a version of the std library not set to std=c++14 thus that doesn't support what V8 now requires.

            This is known issue and you can read about it at these PRs #376, #394, #400 and the fix has been merged today (January 30 2021) with this PR #407 and there is a new release on NPM usb@1.6.4.

            Now your steps are working for me on Ubuntu 20.04 and ElectronRebuild.js runs with no errors after installing latest usb module:

            Source https://stackoverflow.com/questions/65871803

            QUESTION

            Ada on the microbit: scrolling text example not working, no libusb library found
            Asked 2021-Jan-28 at 23:39

            I followed the adacore tutorial on displaying scrolling text (https://blog.adacore.com/ada-for-microbit-part-1-getting-started) but can't get it working on my microbit.

            Maybe my microbit is a more recent version that is not yet supported? The reason I suspect this is that my board id (9904) was not supported the first time I tried to flash to the board. I used the fix described here: Unable to get the Ada scrolling text demo working on the microbit on GNAT 2019 community edition and added the following line in board_ids.py:

            ...

            ANSWER

            Answered 2021-Jan-23 at 14:12

            libusb is missing or not found on your computer. It is used to communicate with the Microbit board to upload/debug.

            Source https://stackoverflow.com/questions/65859253

            QUESTION

            Coral Edge TPU USB Accelerator driver fails to install
            Asked 2021-Jan-21 at 21:35

            I'm trying to install and test my Coral Edge TPU. I'm following the instructions here: https://coral.ai/docs/accelerator/get-started/

            The first step is to install drivers from the coral website, but I'm getting the following errors. I've tried running with and without admin, and uninstalling and installing again, but I get the same errors.

            Has anyone else run into this issue? I'm on Windows 10.

            ...

            ANSWER

            Answered 2021-Jan-18 at 17:04

            This is a bug in the coral software. According to this thread https://github.com/google-coral/edgetpu/issues/260 they messed up a few things in the newest version (at the time 2.5.0). Starting with a fresh virtual environment and using the release 2.1.0 and corresponding driver for Python 3.7 (3.8, 3.9 not supported as of 2.1.0) fixed the issue.

            From that thread:

            For now, I suggest rolling back to the older driver: https://dl.google.com/coral/edgetpu_api/edgetpu_runtime_20200728.zip

            And you also need to remove your current tflite_runtime and downgrade it to an older version (make sure to change to the right python version):

            pip3 install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp36-cp36m-win_amd64.whl pip3 install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-win_amd64.whl Apologies, we are working to get this fixed ASAP

            Source https://stackoverflow.com/questions/65605537

            QUESTION

            Cannot get USB to work on Raspberry-Pi Zero with Coral Edge TPU
            Asked 2020-Dec-15 at 12:17

            I have cross compiled libedgetpu for Raspi-0 and I can run a minimal C++ program. However it does not detect any TPU's. (The Coral TPU is connected via USB port to the Pi-0).

            ...

            ANSWER

            Answered 2020-Dec-15 at 12:17

            I figured out the answer, it was pretty stupid, the library has to be built as a shared library:

            Source https://stackoverflow.com/questions/65252662

            QUESTION

            Can't hear sound when audio is being played in Pyglet (Raspberry Pi 4B, Raspbian)
            Asked 2020-Dec-14 at 20:21

            I am running the latest version of Raspbian on the Raspberry Pi with Python 2.7 and 3.7 installed. For a project, I need to implement some spatial/binaural audio file playback capabilities in Python, and Pyglet (version 1.5.6) (https://pypi.org/project/pyglet/, https://github.com/pyglet/pyglet) seems to be the simplest option with least dependencies. However, I am not being able to hear audio output through the headphones. Here's what I did:

            1. Installed pyglet dependencies: sudo apt-get install ffmpeg libopenal1 libopenal-dev python3-pil.imagetk python3-pil python3-matplotlib python3-scipy gstreamer1.0-alsa gstreamer1.0-python3-plugin-loader (From previous programs, the system also had cmake, python3-opencv libopencv-dev libusb-1.0-0-dev, libboost-program-options-dev and python3-numpy installed)
            2. I then installed pyglet as per given in the guide: sudo pip3 install --upgrade pyglet. The installation proceeded without any errors.
            3. I know that by default often, Raspberry Pi spits audio out through the HDMI port instead of A/V port. So I went to raspi-config using sudo raspi-config, went to Advanced Options -> Audio. Selected the proper option (in my case 1 Headphones). I checked if audio was playing fine through my headphones by playing couple of youtube videos and audio files on the Raspberry Pi itself.
            4. I then checked if pyglet was working by importing pyglet with import pyglet in a python shell, it worked fine without any warnings or errors.
            5. I launched the example program provided here: https://github.com/pyglet/pyglet/tree/master/examples/soundspace. To do so, I downloaded the repo https://github.com/pyglet/pyglet and moved to the proper directory (via cd command) and wrote: sudo python3 soundspace.py. For a brief overview, the program contains 4 instruments that can be dragged across the room with a mouse. In doing so, the audio that you hear from each instrument changes depending on position and orientation of those instruments as well as your virtual position inside the mini game. The program executes without any error being shown in the terminal, but I don't hear any sound. When I try to move the objects, the program freezes but no error is shown in the terminal.
            6. Since I was least bothered about the complex program, I went ahead to create my own simple program that will play a wav file (sourced from the Pyglet's developer repo itself before anyone says the wav file is incompatible https://github.com/pyglet/pyglet/tree/master/examples/soundspace), reference from: https://pyglet.readthedocs.io/en/latest/programming_guide/media.html . Here's the code snippet:
            ...

            ANSWER

            Answered 2020-Jun-21 at 08:35

            https://github.com/NicklasTegner/PyAL Since I was out of time. I tried experimenting with other OpenAL Python libraries and this one works fine.

            Edit: The actual problem was not with Pyglet but with PulseAudio, which clashes with ALSA. I solved the problem by connecting an external USB audio card and audio was working properly (with HRTFs and all).

            Source https://stackoverflow.com/questions/62481810

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install libusb

            While gem install the system is checked for a usable libusb library installation. If none could be found, a bundled libusb version is built and used, instead.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/larskanis/libusb.git

          • CLI

            gh repo clone larskanis/libusb

          • sshUrl

            git@github.com:larskanis/libusb.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link