LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-20-2007, 02:27 PM   #1
bob.wright1
LQ Newbie
 
Registered: Jul 2007
Distribution: RHEL
Posts: 6

Rep: Reputation: 0
usb to serial - no data flow


I have a laptop with only one serial port and want to add a serial port via usb.
I have attached the adapter and /var/log/messages shows it as recognized.
The system sees the device and has an entry in /dev for ttyUSB0, but I need to send data that would normally go to /dev/ttyS1 to /dev/ttyUSB0.
How do I redirect all traffic that applications normally send to com2 (/dev/ttyS1) to /dev/ttyUSB0 ???
 
Old 07-20-2007, 02:29 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,379

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
can you not just change whatever device is opening ttyS1 to use ttyUSB0 instead? what application is this? you could replace the ttyS1 device with a symlink to ttyUSB0 i guess...
 
Old 07-20-2007, 02:35 PM   #3
bob.wright1
LQ Newbie
 
Registered: Jul 2007
Distribution: RHEL
Posts: 6

Original Poster
Rep: Reputation: 0
procedure?

need a procedure for the O/S to redirect all apps from com2 to usb1
 
Old 07-20-2007, 02:36 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,379

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
yeah you already said that. please provide more information, or refer to the comments i already made. and it's only "com2" under windows...
 
Old 07-20-2007, 02:55 PM   #5
bob.wright1
LQ Newbie
 
Registered: Jul 2007
Distribution: RHEL
Posts: 6

Original Poster
Rep: Reputation: 0
The connections on both serial ports are for null modem connections to another computer.

When I change the script in the app to use /dev/ttyUSB0 or 1 or 2 or 3, there is no data flow.
If I try to echo a test through /dev/ttyUSB0 it returns a "no such device"
The same test goes through /dev/ttyS1 with no problem, even though it does not physically exist.

The O/S sees the device as a serial port but does not seem to automatically assign ttyS1 to it.
 
Old 07-20-2007, 04:15 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,379

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
ok, well maybe there are permissions issues which relate back to the usb device not being seen..? what are the permissions and ownerships compared to ttyS1?
 
Old 07-20-2007, 04:48 PM   #7
bob.wright1
LQ Newbie
 
Registered: Jul 2007
Distribution: RHEL
Posts: 6

Original Poster
Rep: Reputation: 0
In /dev they are root:uucp and 660
In /dev/usb they are root:root and 600
 
Old 07-21-2007, 02:02 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,379

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
well there's a good difference don't you think? are you doing this as root, as opposed to a member of the uucp group?
 
Old 07-26-2007, 09:45 AM   #9
bob.wright1
LQ Newbie
 
Registered: Jul 2007
Distribution: RHEL
Posts: 6

Original Poster
Rep: Reputation: 0
USB - Serial

Has anyone out there had success with getting LINUX to recognize a USB to SERIAL adapter as if it were ttyS1?
I have seen several other posts in other threads, and none have been able to resolve this.
I would really appreciate it if someone who has a procedure would share it.
Thanks
 
Old 07-31-2007, 08:53 AM   #10
Paulzar
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
Talking USB to Serial - redirecting ttyUSB0 to ttySx

As it turns out, I've been tying to get Atmel's FLIP software to use a USB to serial converter (Aten UC-232A using the Prolific PL2303 driver). FLIP will only talk to "serial" ports ttyS0 - ttyS3. I've managed to get it to function using the following steps (if I remember correctly).

The following assumes that the USB driver is installed and functioning. In my case (Ubunty:Feisty) I didn't need to do anything - it work "out of the (virtual) box". Try "tail -f /var/log/messages" soon after you insert the USB-Serial converter. You should see something like "pl2303 converter now attached to ttyUSB0" indicating that the driver is working and your converter is connected to /dev/ttyUSB0.

OK, so here's the steps to redirect it...

1. Delete the ttySx port you are going to use - in my case I'm using /dev/ttyS3
sudo rm /dev/ttyS3
BE WARNED!!! I have no idea on how to re-instate the serial port (that's why I chose ttyS3)

2. Create a Symlink from the USB port to the chosen serial port.
sudo ln /dev/ttyUSB0 /dev/ttyS3

3. Change the permissions of the Symlink to allow owner and group r/w access
sudo chmod 660 /dev/ttyS3

4. Change the owner & group of the Symlink to match the USB port.
sudo chown root:dialout /dev/ttyS3

All going well you should get a good result.

Things to check:
1. Permissions, owner and group of /dev/ttyUSB0 and /dev/ttyS3 (or your port choice) are the same. In my case they look like this:

ls -la /dev/USB0
crw-rw---- 2 root dialout 188, 0 2007-07-31 19:35 /dev/ttyUSB0
ls -la /dev/ttyS3
crw-rw---- 2 root dialout 188, 0 2007-07-31 19:35 /dev/ttyS3

2. Regardless of any of the above, if you have a LED on your USB-Serial converter, an echo test should get it to flicker:
echo "test" > /dev/ttyUSB0

3. If the echo test works on the ttySx port, then try it on the new "link":
echo "test" > /dev/ttyS3
If you can get the light to flicker again, then it should be working! Try it with the software you originally intended to use.

Hope this helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Monitoring data-flow through a router WhiskeyTangoFoxtrot Linux - Networking 3 05-29-2006 12:20 PM
External Serial Modem problem. Data flow halts or Balarabay1 Linux - Networking 0 05-03-2006 04:14 PM
Constant Data Flow oberon1879 Linux - Networking 1 03-03-2005 12:23 PM
Serial flow control in 2.6.8 kidzmom3 Linux - General 1 12-08-2004 08:47 AM
Disable Hardware Flow Control at serial port DJ_Cyberdance Linux - Hardware 0 11-27-2003 02:00 AM


All times are GMT -5. The time now is 01:56 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration