Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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.
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.
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!
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....
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.