LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-17-2013, 12:27 PM   #1
budviser37
LQ Newbie
 
Registered: Sep 2013
Posts: 4

Rep: Reputation: Disabled
Serial Port Communication Issue Debian 7.1


I have a box that's hooked up via serial port to a piece of equipment that outputs data via the serial port. On the linux box I have a program that monitors the serial port, parses the data and puts it into an xml file as it's being sent from the equipment. That is working no problem. My issue is that on startup and shutdown of the linux box, the serial port sends a string of zeros out to the equipment and well, the equipment doesn't like receiving data and reboots whenever it receives anything. This obviously isn't ideal for production equipment to restart whenever the monitoring equipment does.

So my question is, how can I stop the serial port from spitting out this data on startup or shutdown? Or (and i know this is probably a long shot) but can i disable the serial port from sending at all and just receive data?
 
Old 09-17-2013, 01:17 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You could always just cut off the Tx pin on the serial cable (or make your own cable without the Tx line), so even if the computer sends info, the device doesn't receive it. There's no reason you need to use a bi-directional cable for a one-directional interface.
 
Old 09-17-2013, 01:20 PM   #3
budviser37
LQ Newbie
 
Registered: Sep 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
We'd already talked about just cutting the send pin on our linux box. Don't really want to have to make a bunch of cables. Once all done we'll have about 75 of these running. Was just trying to see if it was possible to accomplish in the software first before I start hacking away at my hardware.
 
Old 09-17-2013, 02:10 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
By start up or shutdown I would guess the serial port spits out garbage due to the power supply as it ramps up/down. Therefore it is a hardware issue and not software fixable. If you have access to an oscilloscope it might be worth monitoring the power supply and TX pin while power is applied/removed. So the cheapest fix might be just modifying the cables.

Without knowing anything about the hardware these are only assumptions.

Last edited by michaelk; 09-17-2013 at 02:23 PM.
 
Old 09-17-2013, 03:13 PM   #5
budviser37
LQ Newbie
 
Registered: Sep 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
This is the device we're using. And it's not random ones and zeros that are kicked out. It was 4 octets of just zeros. I think we settled on just doing the hardware modification and pulling the TX pin out of the connector.

Still open for software ideas though.
 
Old 09-17-2013, 03:16 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Some OS's probe for hardware on the serial ports when they're booting, maybe it's that? I've found a ton of hits for disabling this probing on Windows, but I haven't seen anything yet about how to disable it on Linux, or if Linux even does it in the first place.
 
Old 09-17-2013, 04:02 PM   #7
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Deal with root cause. The kit thats crashing. A peice of kit should not crash just because it got an unexpected input on a serial port. There are all kinds of reasons where you might get spurious input on a serial interface, crashing in response is not good!
 
Old 09-17-2013, 04:13 PM   #8
budviser37
LQ Newbie
 
Registered: Sep 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Piece of equipment is designed to do exactly what it does as a security mechanism (it doesn't crash per say, it does gracefully reboot) and is produced by a worldwide company in the financial sector. Rather not say just because of disclosure rules with our customer but can't do anything on that front....
 
Old 09-17-2013, 04:41 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
Have you verified that it does not happen when you start/stop your application?
I have not experienced this happening with any of my computers. It might take a little experimentation to determine where in the boot sequence but if may not be worth the effort.
 
Old 09-18-2013, 11:26 AM   #10
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Quote:
Originally Posted by budviser37 View Post
Piece of equipment is designed to do exactly what it does as a security mechanism (it doesn't crash per say, it does gracefully reboot) and is produced by a worldwide company in the financial sector. Rather not say just because of disclosure rules with our customer but can't do anything on that front....
So this peice of kit is designed with a built in Denial of Service vulnerability? Class.

If its designed to work that way why did they even connect the RX pin internally to the device? Sounds like a cop-out to me.
 
Old 09-18-2013, 01:18 PM   #11
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by baldy3105 View Post
If its designed to work that way why did they even connect the RX pin internally to the device?
I was wondering the same thing.
 
Old 09-18-2013, 01:40 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
Not necessarily. I use several RS-232 devices that output continuously and are programmable via the RX pins. Their RX pins are always enabled although require a specific code for reset.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Port Communication canavaroski90 Programming 5 02-28-2012 06:55 PM
serial port communication prems Linux - Newbie 1 04-17-2005 02:31 AM
serial port communication vidyaraj Linux - Software 2 03-14-2004 11:32 PM
communication with serial port vidyaraj Linux - Hardware 0 03-09-2004 08:32 PM
communication via serial port perdesiz Linux - Software 0 11-13-2003 06:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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