FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 09-29-2010, 03:55 PM
"Roger K. Wells"
 
Default cp210x.ko hangs on open attempt

I have a RS485 serial device (Quatech SSU2-300) that when plugged
into a USB (2.0) port appears to be recognized correctly. dmesg yields:

cp210x 3-1:1.0: cp210x converter detected
usb 3-1: reset full speed USB device using uhci_hcd and address 8
usb 3-1: cp210x converter now attached to ttyUSB0

A "C" language program attempting to use this port hangs at the
open call.

This same program with the same device worked on a Centos 5.5
install on the same computer.

uname -r : 2.6.34.7-56.fc13.x86_64

The USB device works in Windows XP so I don't think there is a defect
there.

Any thoughts will be appreciated.
THX

--
Roger Wells, P.E.
SAIC
221 Third St
Newport, RI 02840
401-847-4210 (voice)
401-849-1585 (fax)
roger.k.wells@saic.com

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 09-29-2010, 04:10 PM
Rick Stevens
 
Default cp210x.ko hangs on open attempt

On 09/29/2010 08:55 AM, Roger K. Wells wrote:
>
> I have a RS485 serial device (Quatech SSU2-300) that when plugged
> into a USB (2.0) port appears to be recognized correctly. dmesg yields:
>
> cp210x 3-1:1.0: cp210x converter detected
> usb 3-1: reset full speed USB device using uhci_hcd and address 8
> usb 3-1: cp210x converter now attached to ttyUSB0
>
> A "C" language program attempting to use this port hangs at the
> open call.
>
> This same program with the same device worked on a Centos 5.5
> install on the same computer.
>
> uname -r : 2.6.34.7-56.fc13.x86_64
>
> The USB device works in Windows XP so I don't think there is a defect
> there.
>
> Any thoughts will be appreciated.

Check the permissions on /dev/ttyUSB0 and make sure the user you're
running the C program as has permissions. You might also have a
look to see if there's an SELinux denial associated with the attempt.
It's not uncommon for udev and/or packagekit and/or SELinux to set up
incorrect permissions or not have a context rule--especially on a
device few people have around to test with (and I doubt a lot of us
have a USB<-->RS485 adapter). :-)

If you have the source to the program you could change the open call to
a non-blocking open and print out the resulting error code:

#include <string.h>
#include <errno.h>

extern int errno;
if ((fdc = open("/dev/ttyUSB0", O_RW | O_NONBLOCK)) < 0)
printf("Can't open ttyUSB0: %s
", strerror(errno));

You get the idea.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, C2 Hosting ricks@nerd.com -
- AIM/Skype: therps2 ICQ: 22643734 Yahoo: origrps2 -
- -
- Cuteness can be overcome through sufficient bastardry -
- --Mark 'Kamikaze' Hughes -
----------------------------------------------------------------------
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 09-29-2010, 07:19 PM
Alan Cox
 
Default cp210x.ko hangs on open attempt

On Wed, 29 Sep 2010 11:55:21 -0400
"Roger K. Wells" <ROGER.K.WELLS@saic.com> wrote:

>
> I have a RS485 serial device (Quatech SSU2-300) that when plugged
> into a USB (2.0) port appears to be recognized correctly. dmesg yields:
>
> cp210x 3-1:1.0: cp210x converter detected
> usb 3-1: reset full speed USB device using uhci_hcd and address 8
> usb 3-1: cp210x converter now attached to ttyUSB0
>
> A "C" language program attempting to use this port hangs at the
> open call.
>
> This same program with the same device worked on a Centos 5.5
> install on the same computer.
>
> uname -r : 2.6.34.7-56.fc13.x86_64
>
> The USB device works in Windows XP so I don't think there is a defect
> there.

Modern kernels properly handle carrier detect and wait so open it with
O_NDELAY if you don't want to wait for the carrier line to be asserted
and/or set the CLOCAL termios bits if you are not using the carrier and
flow control.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 09-30-2010, 12:31 AM
"Wolfgang S. Rupprecht"
 
Default cp210x.ko hangs on open attempt

Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> On Wed, 29 Sep 2010 11:55:21 -0400
> "Roger K. Wells" <ROGER.K.WELLS@saic.com> wrote:
>
>>
>> I have a RS485 serial device (Quatech SSU2-300) that when plugged
>> into a USB (2.0) port appears to be recognized correctly. dmesg yields:
>>
>> cp210x 3-1:1.0: cp210x converter detected
>> usb 3-1: reset full speed USB device using uhci_hcd and address 8
>> usb 3-1: cp210x converter now attached to ttyUSB0
>>
>> A "C" language program attempting to use this port hangs at the
>> open call.
>>
>> This same program with the same device worked on a Centos 5.5
>> install on the same computer.
>>
>> uname -r : 2.6.34.7-56.fc13.x86_64
>>
>> The USB device works in Windows XP so I don't think there is a defect
>> there.
>
> Modern kernels properly handle carrier detect and wait so open it with
> O_NDELAY if you don't want to wait for the carrier line to be asserted
> and/or set the CLOCAL termios bits if you are not using the carrier and
> flow control.

One of my pet peeves is people that wire up 3-wire rs-232 (ground, tx,
rx) and then wonder why they can't open the port. Carrier detect is a
very useful line for detecting if the rs-232 plug fell out of the
computer. People should get in the habit of at least looping RTS->CTS,
DTR->{DSR,DCD}.

-wolfgang
--
Wolfgang S. Rupprecht http://www.wsrcc.com/wolfgang/ (IPv6-only)
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 03:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org