Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work on ARM (rasbperry pi) #45

Closed
willemcvu opened this issue Aug 7, 2018 · 8 comments
Closed

Doesn't work on ARM (rasbperry pi) #45

willemcvu opened this issue Aug 7, 2018 · 8 comments

Comments

@willemcvu
Copy link

willemcvu commented Aug 7, 2018

I'm trying to build a package that includes gousb on a Raspberry Pi 2, and I'm unable to get gousb working at all.
go get -v github.com/google/gousb returns:

github.com/google/gousb (download)
github.com/google/gousb
# github.com/google/gousb
../github.com/google/gousb/libusb.go:234:29: could not determine kind of name for C.libusb_get_port_number
../github.com/google/gousb/libusb.go:396:19: could not determine kind of name for C.libusb_set_auto_detach_kernel_driver

Any ideas?

@zagrodzki
Copy link
Collaborator

Which version of Go and which version of libusb?

@willemcvu
Copy link
Author

libusb-1.0-0 and go1.10.3.
I also tried go1.8, same exact issue.

@zagrodzki
Copy link
Collaborator

libusb-1.0-0 is not helpful, unfortunately, that's the name of the package (Debian or Ubuntu, I'm guessing), but not the version. dpkg -l libusb-1.0-0 should help.

@willemcvu
Copy link
Author

Whoops, sorry!
2:1.0.11-1 is the version I'm using (as returned from dpkg).

@zagrodzki
Copy link
Collaborator

1.0.11 was released in May 2012, so I think it's fair to call it really old... Port number function was added few days later in May 2012, and kernel autodetach was added in June 2013. The first version that includes both was 1.0.16, released Jul 2013. Current version is 1.0.22.

If that is indeed Debian wheezy, you'll either need to install 1.0.19 from wheezy-backports or upgrade to jessie.

@willemcvu
Copy link
Author

OK, thanks a ton, I will try upgrading my distro.

@Gustavomurta
Copy link

Gustavomurta commented Oct 18, 2021

Updated Gousb instructions for Raspberry Pi :

Installing Golang on Raspberry Pi:
https://forums.raspberrypi.com/viewtopic.php?f=28&t=317369&p=1926129#p1926129

  1. You must first install libusb-1.0
    apt-get install libusb-1.0-0-dev

  2. Test the Libusb installation with these commands. Make sure the folders are correct (very important).
    Examples:
    root@raspberrypi:/home/pi# pkg-config --cflags libusb-1.0
    -I/usr/include/libusb-1.0
    root@raspberrypi:/home/pi# pkg-config --libs libusb-1.0
    -lusb-1.0
    root@raspberrypi:/home/pi#

  3. Install the Gousb package, with this command and no message of errors:
    Example:
    root@raspberrypi:/home/pi/go#go get -v github.com/google/gousb (It might take a while)
    github.com/google/gousb
    root@raspberrypi:/home/pi/go#

  4. Test the Gousb installation by compiling and running the example lsusb
    https://github.com/google/gousb/tree/master/lsusb/

@zagrodzki
Copy link
Collaborator

@Gustavomurta I don't think your instructions help - first, the problem mentioned in this question was exactly that the libusb that came with the distribution (as installed by apt-get in your documentation) was too old and didn't have the required functions.

Second, your instructions are specific to Debian-flavor of Raspberry Pi (Raspbian etc) and not generally useful for other distributions (SUSE, Gentoo, Arch etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants