Products for USB Sensing and Control
It is currently Tue May 21, 2013 7:52 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Fri Apr 16, 2010 4:59 am 
Offline
Phidgetsian

Joined: Tue Mar 27, 2007 4:38 am
Posts: 8
I'm running the Ubuntu 10.04 beta, kernel version 2.6.32-21, and am unsuccessfully trying to connect a Phidgets 8/8/8. I have many other phidgets devices which are working normally, but the 8/8/8 seems to be refusing to connect.

To make sure this isn't any sort of power supply issue I only have the 8/8/8 attached, and no other USB devices are connected to the computer. I'm also using the version with the 6 port hub and its own independent power supply (which might only be supplying the hub), and have tried plugging into different USB ports. The Phidget is connected directly to the USB socket on the computer and not through any other hub.

What I see when using lsusb is that the device is occasionally connecting then disconnecting.

Occasionally I get a connection like this:

Code:
Bus 003 Device 079: ID 06c2:0045 Phidgets Inc. (formerly GLAB) PhidgetInterface Kit 8-8-8
Bus 003 Device 002: ID 0451:2077 Texas Instruments, Inc. TUSB2077 Hub


but mostly I just get.

Code:
Bus 003 Device 002: ID 0451:2077 Texas Instruments, Inc. TUSB2077 Hub


Noticing the product number, I have added the line

Code:
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="06c2", ATTRS{idProduct}=="0045", MODE="666"


to /etc/udev/rules.d/99-phidgets.rules, but this doesn't solve the problem (after rebooting and also trying plugging into different USB ports). Running the example program through sudo also doesn't work.

Code:
sudo ./InterfaceKit-simple


But it shouldn't be necessary to use sudo.

Any ideas on what might be the cause of the problem? As I said earlier, I have other phidgets devices which are working normally.


Top
 Profile Send private message  
 
PostPosted: Fri Apr 16, 2010 8:23 am 
Offline
Lead Developer
User avatar

Joined: Mon Jun 20, 2005 8:46 am
Posts: 2351
Location: Canada
Do the USB ports on the 1019 work properly? What type of power supply are you using to power the board (this does need to be plugged in)? Have you tried using it on a different machine, or with a different USB cable? Is this a new Phidget for you, or did it stop working at some point?

It could be a bad board, but usually that's not the issue.

-Patrick


Top
 Profile Send private message  
 
PostPosted: Fri Apr 16, 2010 8:30 am 
Offline
Phidgetsian

Joined: Tue Mar 27, 2007 4:38 am
Posts: 8
patrick wrote:
Do the USB ports on the 1019 work properly? What type of power supply are you using to power the board (this does need to be plugged in)? Have you tried using it on a different machine, or with a different USB cable? Is this a new Phidget for you, or did it stop working at some point?

It could be a bad board, but usually that's not the issue.



The full story is that I have an original 8/8/8 which I had working some months ago. Recently I tried using it again, along with a lot of other phidgets, and it didn't work. I assumed that the board was broken, and ordered a new one with the 6 port hub. It looks as if the new board behaves in an identical way, so I now assume that this is some kind of software issue - possible OS/kernel/hotplugging related. I have tried different cables and different machines (but both running Ubuntu 10.04), but with the same result, and the external power supply I'm using is the one supplied (12V/2A).


Top
 Profile Send private message  
 
PostPosted: Fri Apr 16, 2010 8:36 am 
Offline
Lead Developer
User avatar

Joined: Mon Jun 20, 2005 8:46 am
Posts: 2351
Location: Canada
Ok, something you can try it enabling logging in a program that tries to open and use the 8/8/8. In C, you just need to add the command:

Code:
CPhidget_enableLogging(PHIDGET_LOG_VERBOSE, "/home/user/logfile.log");

before any other Phidget API calls.

This log may contain useful information if it's a software problem.

-Patrick


Top
 Profile Send private message  
 
PostPosted: Fri Apr 16, 2010 9:05 am 
Offline
Phidgetsian

Joined: Tue Mar 27, 2007 4:38 am
Posts: 8
patrick wrote:
Ok, something you can try it enabling logging in a program that tries to open and use the 8/8/8. In C, you just need to add the command:

Code:
CPhidget_enableLogging(PHIDGET_LOG_VERBOSE, "/home/user/logfile.log");

before any other Phidget API calls.

This log may contain useful information if it's a software problem.



I only get

Code:
Fri Apr 16 15:54:20 2010,-1248446704,"clog.c(46)",INFO,"Enabling logging"


The program attempts to attach, then times out after ten seconds. The code looks like this:

Code:
bool attach(
    CPhidgetInterfaceKitHandle &phid,
    int serial_number)
{
    CPhidget_enableLogging(PHIDGET_LOG_VERBOSE, "/home/motters/Desktop/phidgets.log");

    //create the object
    CPhidgetInterfaceKit_create(&phid);

    //Set the handlers to be run when the device is plugged in or opened from software, unplugged or closed from software, or generates an error.
    CPhidget_set_OnAttach_Handler((CPhidgetHandle)phid, AttachHandler, NULL);
    CPhidget_set_OnDetach_Handler((CPhidgetHandle)phid, DetachHandler, NULL);
    CPhidget_set_OnError_Handler((CPhidgetHandle)phid, ErrorHandler, NULL);

    //Registers a callback that will run if an input changes.
    //Requires the handle for the Phidget, the function that will be called, and an arbitrary pointer that will be supplied to the callback function (may be NULL).
    CPhidgetInterfaceKit_set_OnInputChange_Handler (phid, InputChangeHandler, NULL);

    //Registers a callback that will run if the sensor value changes by more than the OnSensorChange trig-ger.
    //Requires the handle for the IntefaceKit, the function that will be called, and an arbitrary pointer that will be supplied to the callback function (may be NULL).
    CPhidgetInterfaceKit_set_OnSensorChange_Handler (phid, SensorChangeHandler, NULL);

    //Registers a callback that will run if an output changes.
    //Requires the handle for the Phidget, the function that will be called, and an arbitrary pointer that will be supplied to the callback function (may be NULL).
    CPhidgetInterfaceKit_set_OnOutputChange_Handler (phid, OutputChangeHandler, NULL);

    //open the device for connections
    CPhidget_open((CPhidgetHandle)phid, serial_number);

    //get the program to wait for an interface kit device to be attached
    if (serial_number == -1) {
        ROS_INFO("Waiting for Interface Kit Phidget to be attached....");
    }
    else {
        ROS_INFO("Waiting for Interface Kit Phidget %d to be attached....", serial_number);
    }
    int result;
    if((result = CPhidget_waitForAttachment((CPhidgetHandle)phid, 10000)))
    {
        const char *err;
        CPhidget_getErrorDescription(result, &err);
   ROS_ERROR("Problem waiting for attachment: %s", err);
   return false;
    }
    else return true;
}


Running the phidgets manager example also fails to connect.


Top
 Profile Send private message  
 
PostPosted: Fri Apr 16, 2010 11:33 am 
Offline
Lead Developer
User avatar

Joined: Mon Jun 20, 2005 8:46 am
Posts: 2351
Location: Canada
Would you be able to try it on a Windows machine? Also - do the USB ports work? The 1019 has a built in 7 port hub - the 8/8/8 it connected to one of those ports and the other 6 are brought out for the user.

-Patrick


Top
 Profile Send private message  
 
PostPosted: Fri Apr 16, 2010 11:49 am 
Offline
Phidgetsian

Joined: Tue Mar 27, 2007 4:38 am
Posts: 8
patrick wrote:
Would you be able to try it on a Windows machine? Also - do the USB ports work? The 1019 has a built in 7 port hub - the 8/8/8 it connected to one of those ports and the other 6 are brought out for the user.


A curious feature. If I plug the old 8/8/8 into one of the USB sockets on the new 8/8/8 I can then see it. However, it detaches and re-attaches very regularly every 3 seconds.

Here's the log.

Code:
Fri Apr 16 18:52:14 2010,-1247910128,"clog.c(46)",INFO,"Enabling logging"
Fri Apr 16 18:52:14 2010,-1283458192,"cusblinux.c(368)",INFO,"New device in CUSBBuildList: 003122"
Fri Apr 16 18:52:15 2010,-1283458192,"cusblinux.c(348)",ERR,"usb_get_string_simple failed with error code: -110 "Connection timed out""
Fri Apr 16 18:52:15 2010,-1283458192,"cusblinux.c(349)",INFO,"This usually means you need to run as root"
Fri Apr 16 18:52:15 2010,-1283458192,"cusblinux.c(459)",WARN,"usb_get_driver_np failed with error code: -61 "No data available""
Fri Apr 16 18:52:15 2010,-1291850896,"cthread.c(335)",INFO,"WriteThread running"
Fri Apr 16 18:52:15 2010,-1302332560,"cthread.c(220)",INFO,"ReadThread running"
Fri Apr 16 18:52:15 2010,-1283458192,"cusblinux.c(368)",INFO,"New device in CUSBBuildList: 003123"
Fri Apr 16 18:52:16 2010,-1283458192,"cusblinux.c(348)",ERR,"usb_get_string_simple failed with error code: -110 "Connection timed out""
Fri Apr 16 18:52:16 2010,-1283458192,"cusblinux.c(349)",INFO,"This usually means you need to run as root"
Fri Apr 16 18:52:16 2010,-1291850896,"cusblinux.c(84)",INFO,"Device was unplugged - detach."
Fri Apr 16 18:52:16 2010,-1291850896,"cthread.c(399)",INFO,"WriteThread exiting normally (Phidget detach detected in CPhidget_write)"
Fri Apr 16 18:52:17 2010,-1302332560,"cusblinux.c(195)",INFO,"Device was unplugged - detach."
Fri Apr 16 18:52:17 2010,-1302332560,"cthread.c(271)",INFO,"ReadThread exiting normally (Phidget detach detected in CPhidget_read)"
Fri Apr 16 18:52:17 2010,-1283458192,"cusblinux.c(348)",ERR,"usb_get_string_simple failed with error code: -110 "Connection timed out""
Fri Apr 16 18:52:17 2010,-1283458192,"cusblinux.c(349)",INFO,"This usually means you need to run as root"
Fri Apr 16 18:52:17 2010,-1283458192,"cusblinux.c(32)",WARN,"usb_release_interface called on unplugged device."
Fri Apr 16 18:52:18 2010,-1283458192,"cusblinux.c(368)",INFO,"New device in CUSBBuildList: 003124"
Fri Apr 16 18:52:19 2010,-1283458192,"cusblinux.c(348)",ERR,"usb_get_string_simple failed with error code: -110 "Connection timed out""
Fri Apr 16 18:52:19 2010,-1283458192,"cusblinux.c(349)",INFO,"This usually means you need to run as root"
Fri Apr 16 18:52:19 2010,-1283458192,"cusblinux.c(459)",WARN,"usb_get_driver_np failed with error code: -61 "No data available""
Fri Apr 16 18:52:19 2010,-1310725264,"cthread.c(335)",INFO,"WriteThread running"
Fri Apr 16 18:52:19 2010,-1319117968,"cthread.c(220)",INFO,"ReadThread running"
Fri Apr 16 18:52:19 2010,-1283458192,"cusblinux.c(368)",INFO,"New device in CUSBBuildList: 003125"
Fri Apr 16 18:52:20 2010,-1283458192,"cusblinux.c(348)",ERR,"usb_get_string_simple failed with error code: -110 "Connection timed out""
Fri Apr 16 18:52:20 2010,-1283458192,"cusblinux.c(349)",INFO,"This usually means you need to run as root"
Fri Apr 16 18:52:20 2010,-1310725264,"cusblinux.c(84)",INFO,"Device was unplugged - detach."
Fri Apr 16 18:52:20 2010,-1310725264,"cthread.c(399)",INFO,"WriteThread exiting normally (Phidget detach detected in CPhidget_write)"
Fri Apr 16 18:52:21 2010,-1319117968,"cusblinux.c(195)",INFO,"Device was unplugged - detach."
Fri Apr 16 18:52:21 2010,-1319117968,"cthread.c(271)",INFO,"ReadThread exiting normally (Phidget detach detected in CPhidget_read)"
Fri Apr 16 18:52:21 2010,-1283458192,"cusblinux.c(348)",ERR,"usb_get_string_simple failed with error code: -110 "Connection timed out""
Fri Apr 16 18:52:21 2010,-1283458192,"cusblinux.c(349)",INFO,"This usually means you need to run as root"
Fri Apr 16 18:52:21 2010,-1283458192,"cusblinux.c(32)",WARN,"usb_release_interface called on unplugged device."
Fri Apr 16 18:52:22 2010,-1283458192,"cusblinux.c(368)",INFO,"New device in CUSBBuildList: 003126"
Fri Apr 16 18:52:23 2010,-1283458192,"cusblinux.c(348)",ERR,"usb_get_string_simple failed with error code: -110 "Connection timed out""
Fri Apr 16 18:52:23 2010,-1283458192,"cusblinux.c(349)",INFO,"This usually means you need to run as root"
Fri Apr 16 18:52:23 2010,-1283458192,"cusblinux.c(459)",WARN,"usb_get_driver_np failed with error code: -61 "No data available""
Fri Apr 16 18:52:23 2010,-1327510672,"cthread.c(335)",INFO,"WriteThread running"
Fri Apr 16 18:52:23 2010,-1335903376,"cthread.c(220)",INFO,"ReadThread running"
Fri Apr 16 18:52:23 2010,-1283458192,"cusblinux.c(368)",INFO,"New device in CUSBBuildList: 003127"
Fri Apr 16 18:52:24 2010,-1283458192,"cusblinux.c(348)",ERR,"usb_get_string_simple failed with error code: -110 "Connection timed out""
Fri Apr 16 18:52:24 2010,-1283458192,"cusblinux.c(349)",INFO,"This usually means you need to run as root"
Fri Apr 16 18:52:24 2010,-1327510672,"cusblinux.c(87)",ERR,"usb_control_msg failed with error code: -62 "Timer expired""
Fri Apr 16 18:52:24 2010,-1327510672,"cthread.c(410)",ERR,"WriteThread exiting - CPhidget_write returned : 3"
Fri Apr 16 18:52:24 2010,-1335903376,"cusblinux.c(209)",WARN,"Failure in CUSBReadPacket - Report Length: 8, bytes read: 0. Probably trying to use too many Phidgets at once, and some data is being lost."
Fri Apr 16 18:52:25 2010,-1335903376,"cusblinux.c(195)",INFO,"Device was unplugged - detach."
Fri Apr 16 18:52:25 2010,-1335903376,"cthread.c(271)",INFO,"ReadThread exiting normally (Phidget detach detected in CPhidget_read)"


Top
 Profile Send private message  
 
PostPosted: Fri Apr 16, 2010 12:06 pm 
Offline
Lead Developer
User avatar

Joined: Mon Jun 20, 2005 8:46 am
Posts: 2351
Location: Canada
Does it do that if you run as root?

-Patrick


Top
 Profile Send private message  
 
PostPosted: Fri Apr 16, 2010 12:12 pm 
Offline
Phidgetsian

Joined: Tue Mar 27, 2007 4:38 am
Posts: 8
patrick wrote:
Does it do that if you run as root?


Whether or not I run the InterfaceKit-simple demo with sudo I still get periodic detachment and re-attachment.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 21, 2010 3:27 pm 
Offline
Phidgetsian

Joined: Tue Mar 27, 2007 4:38 am
Posts: 8
I've done some further testing on Ubuntu version 9.10, and it looks like the phidgets devices are all working normally (including the 8/8/8), so this is looking like perhaps some kernel issue or some difference in the way that USB is handled in 10.04.

I am only using the beta of 10.04, so I'll wait for the final release and try again after that. At least I know that if all else fails going back to the earlier version would be an option.


Top
 Profile Send private message  
 
PostPosted: Fri Apr 23, 2010 3:46 am 
Offline
Phidgetsian

Joined: Tue Mar 27, 2007 4:38 am
Posts: 8
I've located the cause of the problem, and it's simply that Rhythmbox was running in the background. It looks as if Rhythmbox is periodically trying to do something with USB devices (perhaps ipods) and that this is causing the above problems with connected Phidgets.

Quitting Rhythmbox (which I had loaded by default on startup) fixes the problem.

I filed a bug on Launchpad here https://bugs.launchpad.net/ubuntu/+source/rhythmbox/+bug/568883


Top
 Profile Send private message  
 
PostPosted: Fri Apr 23, 2010 8:46 am 
Offline
Lead Developer
User avatar

Joined: Mon Jun 20, 2005 8:46 am
Posts: 2351
Location: Canada
Thanks for tracking this down, we'll keep an eye on this issue.

-Patrick


Top
 Profile Send private message  
 
PostPosted: Tue May 11, 2010 8:53 pm 
Offline
Fresh meat

Joined: Tue May 11, 2010 8:37 pm
Posts: 1
I am having apparently similar trouble with Ubuntu 10.4, kernel 2.6.32-21-generic on a 64-bit machine. In this instance I am trying to use python3.1to access a 1124 temp sensor attached to a 8/8/8 interface. When running the TemperatureSensor-simple.py code as root, I get timeouts:

Code:
rna@rna-desktop:~/Desktop$ sudo python3.1 /home/rna/Desktop/TemperatureSensor-simple.py
Opening phidget object....
Waiting for attach....
Phidget Exception 13: b'Given timeout has been exceeded.'
Exiting....


This may be a naive problem as I am very new to this. Trying a range of USB ports, or running as user, seem to make no difference. Any ideas?


Top
 Profile Send private message  
 
PostPosted: Wed May 12, 2010 8:50 am 
Offline
Lead Developer
User avatar

Joined: Mon Jun 20, 2005 8:46 am
Posts: 2351
Location: Canada
You need to use Interface Kit examples, the temperature sensor example is for the USB temperature sensors (thermocouple sensors).

-Patrick


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group