Spatial 3/3/3 not attaching on Linux

Supporting 2.6 and up
bdillow

Spatial 3/3/3 not attaching on Linux

Postby bdillow » Tue Jul 12, 2011 4:29 pm

I had written an Orocos module to talk to Phidget Spatials. It was working with a 3/0/0. My 3/3/3s just arrived, but the code no longer works. The attach / detach events never seem to reach my code from the phidget21 library. When I run Spatial-simple (the example code, freshly downloaded and compiled), it times out without ever seeing a Spatial, despite the 3/3/3 being plugged in. If I do any of plugging/unplugging while Spatial-simple is running, it doesn't react. I can, however, run Manager-simple, the example program for Phidget Manager code, it can see the device. I modified that code to try to pole the 3/3/3 for its accelerometer, gyro and compass data, but it returns all zeros (possibly bad data).

I turned on verbose logging and this was the output:

Code: Select all

Tue Jul 12 17:50:02 2011,-1231755568,"clog.c(45)",INFO,"Enabling logging"
Tue Jul 12 17:50:06 2011,-1303090320,"linux/cusblinux.c(410)",INFO,"New device in CUSBBuildList: 004060"
Tue Jul 12 17:50:06 2011,-1303090320,"linux/cusblinux.c(505)",INFO,"Kernel driver name: usbhid"
Tue Jul 12 17:50:06 2011,-1303090320,"linux/cusblinux.c(514)",INFO,"Successfully detached kernel driver: usbhid"
Tue Jul 12 17:50:06 2011,-1303090320,"cphidget.c(1253)",ERR,"Device Initialization functions failed: 3"
Tue Jul 12 17:50:06 2011,-1303090320,"linux/cusblinux.c(505)",INFO,"Kernel driver name: usbfs"
Tue Jul 12 17:50:06 2011,-1303090320,"linux/cusblinux.c(521)",WARN,"usb_claim_interface failed with error code: -16 "Device or resource busy""
Tue Jul 12 17:50:06 2011,-1303090320,"cphidget.c(1232)",WARN,"unable to open active device: 1"
Tue Jul 12 17:50:06 2011,-1303090320,"linux/cusblinux.c(505)",INFO,"Kernel driver name: usbfs"
Tue Jul 12 17:50:06 2011,-1303090320,"linux/cusblinux.c(521)",WARN,"usb_claim_interface failed with error code: -16 "Device or resource busy""
Tue Jul 12 17:50:06 2011,-1303090320,"cphidget.c(1232)",WARN,"unable to open active device: 1"



I do have udev rules installed, here's what my /etc/udev/rules.d/99-phidgets.rules reads:

Code: Select all

# Very old Phidgets
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0925", ATTRS{idProduct}=="8101", MODE="666"
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0925", ATTRS{idProduct}=="8104", MODE="666"
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0925", ATTRS{idProduct}=="8201", MODE="666"

# All current and future Phidgets - Vendor = 0x06c2, Product = 0x0030 - 0x00af
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="06c2", ATTRS{idProduct}=="00[3-a][0-f]", MODE="666"


When I run lsusb, I get the following output:

Code: Select all

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 061: ID 06c2:0033 Phidgets Inc. (formerly GLAB)
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Which indicates that the manufacture ID and product code should have made the device with permissions 666.

Here's the output of the modified Manager-simple (it starts with the 3/3/3 plugged in, then I remove its usb cable, then plug it back in before exiting via a keypress):

Code: Select all

INFO: Enabling logging
Press any key to end
INFO: New device in CUSBBuildList: 004063
Phidget Spatial 3/3/3     145686 attached! (20, 51)
|-   # -|-              Type              -|- Serial No. -|-  Version -|- Acc. Axes -|- Gyro Axes -|- Compass -|
|-------|----------------------------------|--------------|------------|-------------|-------------|-----------|
Accel   = [ 0.000000, 0.000000, -0.000000 ]
Gyro    = [ 0.000000, 0.000000, 0.000000 ]
Compass = [ 0.000000, -0.000000, 0.000000 ]
|-   0 -|-                 PhidgetSpatial -|-     145686 -|-      200 -|-         3 -|-         3 -|-       3 -|
|-------|----------------------------------|--------------|------------|-------------|-------------|-----------|
Phidget Spatial 3/3/3     145686 detached!
|-   # -|-              Type              -|- Serial No. -|-  Version -|- Acc. Axes -|- Gyro Axes -|- Compass -|
|-------|----------------------------------|--------------|------------|-------------|-------------|-----------|
INFO: New device in CUSBBuildList: 004064
Phidget Spatial 3/3/3     145686 attached! (20, 51)
|-   # -|-              Type              -|- Serial No. -|-  Version -|- Acc. Axes -|- Gyro Axes -|- Compass -|
|-------|----------------------------------|--------------|------------|-------------|-------------|-----------|
Accel   = [ 0.000000, 0.000000, 0.000000 ]
Gyro    = [ 0.000000, 0.000000, 0.000000 ]
Compass = [ 0.000000, 0.000000, -0.000000 ]
|-   0 -|-                 PhidgetSpatial -|-     145686 -|-      200 -|-         3 -|-         3 -|-       3 -|
|-------|----------------------------------|--------------|------------|-------------|-------------|-----------|

Closing...
INFO: Central Thread exiting

I only changed the manager-simple.c file, attached.

Any ideas as to why everything might have worked with 3/0/0's, still appears to at least send 'attach' events with the Manager-simple program, but 3/3/3s fail to work with Spatial-simple or my own code?

I have tried two 3/3/3s, both version 200 firmware. I don't have the 3/0/0s handy to check their firmware version.

Is there anything else I can offer that would help diagnose the problem? I do not own this box, so I haven't had a chance to run anything as root, but can get permission to do so if it would really change something. (Didn't think this would help because the udev rules seem to be ok.)

Thanks in advance.
Attachments
Manager-simple.c
Modified Manager-simple program to poll for number of axes in each sensor, and try to get data from attached Phidget Spatial 3/3/3.
(5.46 KiB) Downloaded 400 times

User avatar
Patrick
Lead Developer
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Spatial 3/3/3 not attaching on Linux

Postby Patrick » Wed Jul 13, 2011 9:34 am

Hi,

You need to install the latest libphidget21 - version 200 of the 3/3/3 is very recent and only supported in the latest libraries.

-Patrick

bdillow

Re: Spatial 3/3/3 not attaching on Linux

Postby bdillow » Wed Jul 20, 2011 1:50 pm

When I call "CPhidget_getLibraryVersion()" it reports that my library version is "Phidget21 - Version 2.1.8 - Built Jul 1 2011 13:52:52".

Is there a more recent version than that? The download link at http://www.phidgets.com/drivers.php seems to indicate that 2.1.8 is the newest driver set available for Linux.

User avatar
Patrick
Lead Developer
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Spatial 3/3/3 not attaching on Linux

Postby Patrick » Tue Aug 02, 2011 11:34 am

The 2.1.8 part of the version number has not changed. The most recent version is 2.1.8.20110615 - your library version output will display the date that you last built the library.

That being said, this may be another problem. Does the spatial work on another computer and/or OS?

-Patrick

bdillow

Re: Spatial 3/3/3 not attaching on Linux

Postby bdillow » Tue Aug 02, 2011 2:07 pm

Thanks Patrick.
The libphidget version I had installed was libphidget_2.1.8.20110615. So that appears to be the newest.

I tested all 3 of the 3/3/3's I have on Mac OS 10.6.8 with the Phidget library from the installer Phidget_2.1.8.20110630.dmg. I was able to build the example code, run SpatialSimple and watch the values change as I moved it all around. So it's not the units themselves.

Here's the output of "uname -a" on the machine where they didn't work:
Linux HOSTNAME 2.6.31-11-rt #154-Ubuntu SMP PREEMPT RT Wed Jun 9 12:28:53 UTC 2010 i686 GNU/Linux

It is a Ubuntu 10.04 install with libusb-0.1-4 libusb-1.0-0 and libusb-dev installed.

Thoughts? Ideas?
Thanks

User avatar
Patrick
Lead Developer
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Spatial 3/3/3 not attaching on Linux

Postby Patrick » Wed Aug 03, 2011 10:08 am

This is the important line:
Tue Jul 12 17:50:06 2011,-1303090320,"cphidget.c(1253)",ERR,"Device Initialization functions failed: 3"

It looks like you're not getting any calibration packets. Have you tried running as root (I know you're using udev).

I can't do much more without being able to single-step through the library. Are you familiar with GDB?

-Patrick

bdillow

Re: Spatial 3/3/3 not attaching on Linux

Postby bdillow » Wed Aug 03, 2011 4:51 pm

I am only a lowly user / developer on the machines that the 3/3/3 is not attaching on. I am waiting on a request of an admin user.

In the meantime, I tested the same 3/3/3 on Ubuntu 11.04 (running in VirtualBox on a Mac OS 10.6 host). I successfully ran Spatial-simple and saw real-time data with libphidget_2.1.8.20110615.

The output of "uname -a" is

Code: Select all

Linux HOSTNAME 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:05:41 UTC 2011 i686 i686 i386 GNU/Linux


The usb libraries of interest that are installed are:
libusb-0.1-4 ( 2:0.1.12-17 )
libusb-1.0-0 ( 2:1.0.8-2 )
libusb-dev ( 2:0.1.12-17 )

Is there any additional information about this machine or the one on which they are failing that may help?

I am familiar with GDB, and even put a breakpoint just before the line that causes the error in cphidget.c, but I don't know what data to check in memory. What would you like me to try in GDB?

Thanks for continuing to help.

jason120679
Fresh meat
Posts: 3
Joined: Thu Jan 28, 2016 2:00 pm
Contact:

Re: Spatial 3/3/3 not attaching on Linux

Postby jason120679 » Wed Feb 03, 2016 5:50 pm

Was this issue ever resolved? I am having a similar issue. I found an article about a known issue with a capacitor and the USB hub on boards made in and before 2012.

http://www.phidgets.com/docs/SBC2_USB_Hub_Fix

I have 3 SBC2's with the same issue (SN 47606, SN48559 and SN 250847). One has this capacitor and the other does not. I don't think I would have the same hardware issue with 3 separate systems. I have tried to connect them to an advanced servo board as well as a 3/3/3 spatial sensor. My code worked fine on other systems 2 or 3 years ago but I am struggling to figure out what may have changed. I have also tried the sample code with the same outcome.

Patrick asked if the thread author was familiar with GDB but I don't know what he wanted done after that.


opening phidget SN 48559
INFO: New device in CUSBBuildList: 001003
INFO: New device in CUSBBuildList: 001005
WARN: usb_get_driver_np failed with error code: -61 "No data available"
INFO: ReadThread running
INFO: WriteThread running
Lid ID = 0
No Lid - uScout or Backpack Scout
opening phidget SN 177175
INFO: Kernel driver name: usbhid
INFO: Successfully detached kernel driver: usbhid
ERR: Device Initialization functions failed: 19
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
INFO: Kernel driver name: usbfs
WARN: usb_claim_interface failed with error code: -16 "Device or resource busy"
WARN: unable to open active device: 1
Problem waiting for attachment: Given timeout has been exceeded.
INFO: Disabling logging


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 1 guest