LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-07-2011, 02:41 AM   #1
kaza
Member
 
Registered: Apr 2010
Distribution: FC17
Posts: 343

Rep: Reputation: 2
/dev/ttyUSB0 + "broken pipe": how to force re-discovery?


Hello,

I'm operating an EVB (evaluation board) through a
USB<=>SERIAL bridge (TUSB3410) and PerlTk script
which sends/receives message strings to/from the EVB.
The USB bridge is detected as /dev/ttyUSB*. Once in a while
the EVB (or the firmware on it responsible for the
communication) got "stuck" and on the LINUX side I'm getting
the "broken pipe" messages when attempting "sysread/syswrite".
If I go to the EVB, disconnect the USB connector and re-connect it
I cause the device first to disappear then to be re-discovered
and communication resuls. But I'm looking for some solution that
can be done programmatically, without me physically going to the
EVB and disconnecting and reconnecting the USB.

Can I somehow "force" linux to disconnect a stuck USB device and
to re-discover it again, as if the USB connector had been
disconnected and reconnected again?

TIA for any help,
 
Old 12-07-2011, 09:38 PM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
Greetingz!

I've come across a similar problem; I run a "console server" (a 16-port USB hub with lots of USB-to-serial adapters).
You could try to unload the usbserial module; (if it's an actual module, and not compiled-in to the kernel)

1) Do a 'lsmod|grep usbserial' to see if the module's loaded.
2) A 'rmmod usbserial' to pop-out the driver support (note: *all* USB Serial connectors will offline when you do this)
3) Wait a second or two, then do a 'modprobe usbserial'
 
1 members found this post helpful.
Old 12-09-2011, 02:13 PM   #3
kaza
Member
 
Registered: Apr 2010
Distribution: FC17
Posts: 343

Original Poster
Rep: Reputation: 2
Thanks, xeleema!

Your reply pointed me into the right direction.
Doing "lsmod" I saw that the "usbserial" module is in use
by the driver of that particular bridge (from memory: ti_usb_3410_5052),
so removing it and then re-adding does what I need.

Regards,
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash scripting sending "cat: write error: Broken pipe," rojoblandino Linux - Server 8 04-23-2010 10:23 AM
Finding the latest file - "broken pipe" error RasmusThomsen Linux - Server 3 11-30-2009 04:04 PM
termios /dev/ttyUSB0 "resource unavailable" nanoo Programming 4 07-14-2009 09:53 AM
"broken pipe" in installing Ndiswrapper joshknape Linux - Newbie 0 02-14-2006 11:27 PM
ifconfig usb0 produces "Broken pipe" JohnKFT Slackware 0 11-13-2004 04:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration