LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-15-2010, 07:33 AM   #1
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Rep: Reputation: 16
How to ensure reliable RS-232 connection?


I have a configuration file for a network device(2100 lines). This device is configurable only over console line. If I copy chunks of those lines into terminal(I use minicom), there will be mistakes (sometimes some characters missing, space characters added etc). Hardware flow control and software flow control doesn't help either. I tried with cu utility, but same issues appeared. There will be mistakes even if I copy in ~100 line parts. What causes those missing/added characters? How to avoid those?

PS don't recommend coping one line at a time
 
Old 10-15-2010, 08:22 AM   #2
wclark
LQ Newbie
 
Registered: Aug 2007
Posts: 6

Rep: Reputation: 0
You should check the wiring on your serial cable. It sounds like you do not have all the connections you should. That would explain why the flow control does not work. Hopefully the device manufacturer has a recommended wiring for their serial cable. Otherwise you will have to figure it out using a breakout box.

Hope this helps.
Bill
 
Old 10-15-2010, 03:34 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
See if you can slow down the speeds and use parity. I agree that some part of the system is failing. Serial is normally pretty solid if it is setup right. Cockroaches will be using it when we are gone.
 
Old 10-18-2010, 06:39 AM   #4
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by wclark View Post
You should check the wiring on your serial cable. It sounds like you do not have all the connections you should. That would explain why the flow control does not work. Hopefully the device manufacturer has a recommended wiring for their serial cable. Otherwise you will have to figure it out using a breakout box.

Hope this helps.
Bill
yes, wiring may be an issue here. I use following setup:

network_device <-> Cisco_DE9-RJ45_converter(74-0495-01) <-> Cisco_console_cable <-> RS232-USB_converter <-> laptop.

I'm even not sure, does this RS232-to-USB converter support hardware flow control(it has no documentation). As fas as I know, some RS232-to-USB adapters do not support RTS and CTS signals


Quote:
Originally Posted by jefro View Post
See if you can slow down the speeds and use parity. I agree that some part of the system is failing. Serial is normally pretty solid if it is setup right. Cockroaches will be using it when we are gone.
This network device supports only 9600 8N1 setup. I'm afraid there are only two possibilities in this particular case:

A) find a terminal emulation program, which supports pausing before sending each command
B) make a script, which sends this huge configuration file line after another and sleeps 1s after each transfer

Is there a terminal emulation program under Linux, which supports pausing before each byte/line transfer?
 
Old 10-18-2010, 03:09 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
I have played with rs-232c a long time ago. It was rock solid back then under all sorts of adverse conditions. You don't need to pause anything or at least I never did have to. 9600 is pretty slow. You may have to put a scope on the lines. It may be that some radar nearby or large electric motor like an elevator is causing it. Normal salt and pepper line is less likely to suffer but better still is shielded wire. Some say to ground the shield of only one side where others say both ends of shield needs to be grounded. I have always used the two end method. If you can't improve it you may have to go up to rs-485 or some other more dependable signal.

I guess it could be some sort of ac or dc mismatch between the components. Some voltage is causing the tx or rx device to get out of whack.

Could be that the clock on one is way too far off.


How far are you going with this line?

Last edited by jefro; 10-18-2010 at 03:12 PM.
 
Old 10-18-2010, 03:54 PM   #6
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jefro View Post
I have played with rs-232c a long time ago. It was rock solid back then under all sorts of adverse conditions. You don't need to pause anything or at least I never did have to. 9600 is pretty slow. You may have to put a scope on the lines. It may be that some radar nearby or large electric motor like an elevator is causing it. Normal salt and pepper line is less likely to suffer but better still is shielded wire. Some say to ground the shield of only one side where others say both ends of shield needs to be grounded. I have always used the two end method. If you can't improve it you may have to go up to rs-485 or some other more dependable signal.

I guess it could be some sort of ac or dc mismatch between the components. Some voltage is causing the tx or rx device to get out of whack.

Could be that the clock on one is way too far off.


How far are you going with this line?
Console cable is about 1m long. However, I have never encountered problems when coping one line after another. Errors may appear if I copy bunch of configuration lines together.
 
Old 10-18-2010, 04:09 PM   #7
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
I have no experience with RS-232 outside of a SuperBuddy satellite alignment meter that uses it for downloading configuration files. One thing that has caused me much grief in the past and is specifically warned about in the Applied Instruments literature on the subject is that many serial cables, especially when using a USB conversion fail to properly ground the system. It is recommended by them to either use cabling and adapters that they have tested, or at the least to ground the chasis of both connected units with a copper wire.

The problem is apparently more severe when one device is running off a battery or through a battery charger, such as your laptop may be or in my case as the satellite meter is. Corrupted data is the end result.
 
Old 10-18-2010, 09:05 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Can you change stuff to half split this somehow? Any other computer or cable or anything.

9600 should go like .5 miles or some thing like that. I forget but I know it is a long way. It should go a meter for sure all day long and not have an error in a year.

Cell phones, remote phones, microwave ovens and all sorts of stuff can cause this but without an o'scope or some scope that has logging you are in a swap mode.

Last edited by jefro; 10-18-2010 at 09:06 PM.
 
Old 10-25-2010, 08:29 PM   #9
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Original Poster
Rep: Reputation: 16
I tried with three different USB-to-RS232 adapters. Two of those were noname adapters and one was Trendnet TU-S9. One of those noname adapters and Trendnet one used the same chip(PL-2303HX) and are identified as "Prolific Technology Inc USB-Serial controller". Other noname adapter is identified as "FTDI USB serial converter". However, at least one of those USB-to-RS232 has ground wire clearly present- in addition to Vcc, D-, D+ and GND cables, there is an additional wire, which is soldered to USB-A connector in one end DE-9 connector in the other end. PL-2303HX based USB-to-RS232 adapters should support hardware flow control as well, because PL-2303HX supports RTS and CTS(PL-2303HX datasheet www.stkaiser.de/anleitung/files/PL2303.pdf). Console cable is ~1m long and I keep it away from other cables in order to avoid electromagnetic interference. Maybe buffers of USB-to-RS232 adapters get filled..or something like this..I mean if I copy line-by-line, I have had never any issues and as jefro said, it really seems to be rock solid. On the other hand, if I copy chunks of lines, there are constantly some characters missing or few added. All additional ideas are most welcome

Isn't there a terminal emulation program under Linux, which supports pausing before each byte/line transfer? Or any hints, how to script something like this?
 
Old 10-26-2010, 03:37 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Basic terminals go back to the old original teletype terminals. A keyer typing would continue to type after return so there has never been a reason to pause as you say. I have seen people type for hours on old teletypes. They would keep a key pressed on HF systems to keep the crypto's synced up so I know they kept some signal on the line.
 
  


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
How to ENSURE email delivery ??? entz Linux - Server 8 08-29-2009 10:38 PM
please i need a clear guide on how to set up a fast and reliable internet connection ufomskie Linux - Networking 2 07-14-2006 02:27 PM
How to ensure the connectivity in network? pcy Red Hat 1 03-17-2006 02:27 AM
Rs-232 yogotie Linux - Hardware 2 08-03-2003 01:02 PM
how to ensure only one record exist with the same name. meluser Programming 5 03-18-2003 02:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:21 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