Product Comparison: USB I2C | USB SPI | USB GPIO

USB-I2C/SPI/GPIO Interface Adapter U2C-12 FAQ


1.1. Linux (OpenSuse) libusb User Permissions Issue

Problem:

I'm trying to use your i2c_bridge_0.2.2 software for Linux, and it's not working. I think the problem may be with my libusb version. As I step through code, I get to dr_u2c_transaction() and it seems to fail at rc = usb_claim_interface(); the return code is -1... Also, it's strange that usb_claim_interface seems to be called twice (even though it appears only once in the source).

Anyway, do you have any recommendations for getting the correct libusb? Or other ideas what is broken? The tests func_test and pin_test also fail after OpenDevice: Here is the output U2C_GetDeviceCount: found 1 Diolan u2c-12 device(s) U2C_OpenDevice(0): hDevice=0x8064d58.

Following message:

I discovered that usb_claim_interface() is failing because of user access permissions. If I run the code as root, it works.

Solution:

Here is one solution.

Find '50-udev-default' file under /etc/udev/rules.d or /lib/udev/rules.d. Search for

'libusb' # libusb device nodes SUBSYSTEM=="usb", 
ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}",
MODE="0644" 
               
Change the MODE to "0666".

You should also use libusb-0.1-x version instead of libusb-1.0-x.