Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Help installing USB

by dJJackson (Initiate)
on Sep 23, 2016 at 18:10 UTC ( [id://1172484]=perlquestion: print w/replies, xml ) Need Help??

dJJackson has asked for the wisdom of the Perl Monks concerning the following question:

Platform: Raspberry II

sudo cpan install Inline::C ran fine

But when I run: sudo cpan install Device::USB I the following errors:

Reading '/root/.cpan/Metadata' Database was generated on Fri, 23 Sep 2016 15:17:02 GMT Running install for module 'Device::USB' Checksum for /root/.cpan/sources/authors/id/G/GW/GWADEJ/Device-USB-0.36.tar.gz ok 'YAML' not installed, will not store persistent state Configuring G/GW/GWADEJ/Device-USB-0.36.tar.gz with Makefile.PL Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Device::USB Writing MYMETA.yml and MYMETA.json Failed to find module path for 'USB.pm' at Makefile.PL line 50. Warning: No success on command/usr/bin/perl Makefile.PL INSTALLDIRS=site GWADEJ/Device-USB-0.36.tar.gz /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK

Replies are listed 'Best First'.
Re: Help installing USB
by stevieb (Canon) on Sep 23, 2016 at 18:52 UTC

    Welcome to the Monastery, dJJackson!

    I notice that the CPAN Testers results are showing the distribution has more breakage than it does passing, so some finagling may be needed to get it to work, that, or find another distribution that does the same thing (if there is one).

    I've got several Pi 2 and Pi 3 units at home, so tonight after work, I'll play around and see if there's an easy fix, and post back with my findings.

Re: Help installing USB
by dasgar (Priest) on Sep 23, 2016 at 20:15 UTC

    You might want to check to see what version of libusb you have installed in your OS. Based on the information in bug #113422:

    This module was written back when libusb 0.14 was current. The 1.0+ versions use a different API, so compile fails.

    If the version of libusb is not compatible with the older API used by the module, that could be the reason why you are unable to install the module.

      How do I check the libusb version?

        Just got to start looking into this now, in time to see your question.

        I found to check libusb:

        dpkg -l libusb*

        Which outputs a slew of info like this (click the download link below it to see it without line-wrap). Note this is on my Linux Mint laptop, not a Pi, but it'll be the same command:

        spek@sainai:~/repos/app-envui$ dpkg -l libusb* Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/T +rig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Descripti +on +++-======================-================-================-========= +========================================= ii libusb-0.1-4:amd64 2:0.1.12-23.3ubu amd64 userspace + USB programming library ii libusb-1.0-0:amd64 2:1.0.17-1ubuntu amd64 userspace + USB programming library ii libusb-1.0-0:i386 2:1.0.17-1ubuntu i386 userspace + USB programming library un libusb0 <none> <none> (no descr +iption available) ii libusbmuxd2 1.0.8-2ubuntu1 amd64 USB multi +plexor daemon for iPhone and

        It'll be a bit before I can test it out on my Pi(s), but when I do, I will report back with anything I can find to get this working.

Re: Help installing USB
by haukex (Archbishop) on Sep 24, 2016 at 12:00 UTC

    Hi dJJackson,

    On my various RPi devices, I find it's often easier to install the version provided by Raspbian via sudo apt-get install libdevice-usb-perl (just tested this and it works cleanly). That doesn't always get you the latest version of the module, but in my experience it's usually it's "good enough". Also, note that it's often not recommended to modify the system Perl, so if you're using cpan to install modules, I'd strongly recommend you do so in a custom built Perl.

    However, what kind of a USB device is it? I find most USB devices fall into a category for which there are already Linux drivers available, such as mass storage, HID, etc. I've been doing a lot of work recently with USB-to-serial adapters, or devices that present themselves as such. Very often if you've got a "custom" USB device that supposedly needs a "custom" driver, then what has actually happened is that the vendor took some off-the-shelf USB chip and simply changed the default device ID so that the Linux drivers no longer automatically recognize it as a standard device. So it's just a matter of teaching the kernel driver the new device ID and suddenly the standard Linux drivers work perfectly :-)

    Hope this helps,
    -- Hauke D

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1172484]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-23 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found