Problem with serial port, it lost some bytes !!!!!!
Linux - NewbieThis 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
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.
Problem with serial port, it lost some bytes !!!!!!
Hello,
Let me introduce myself, I am Juan from Spain. I am developing application with linux and I have not enough experience with linux.
I will hope to find answer and more questions to learn more about linux.
In this moment, I have a problem.
I use a Visual basic application to send commands to programm in embbeded linux.
The problem is that it lost some bytes, and I do not known what is the problem.
Can you be clearer about your situation: I think you mean that you have two computers, One desktop/server type machine which runs Visual Basic and the other an embedded computer. The desktop/server one sends out the stream of data. Is this the right picture? Are you communicating via RS 232 or is it some other serial comm 'standard'?
Code:
Speed: 38400, 8N1,no flow control, and raw input
"No flow control" can give exactly this kind of problem; if the receiving end is too busy to cope with the data flow at exactly the right time, you will get a buffer overrun and lose data in exactly this manner.
You will want to get both ends using the same kind of flow control (XON/XOFF or hardware). XON/XOFF makes the cabling simpler (and don't ask about a standard RS232 cable), but means that the applications have to do something about the possibility of XON/XOFF chars in the data stream.
The other obvious possibility is that you have a data stream that contains characters which are interpreted as having a special meaning, like the XON XOFF chars.
One question that might clarify the issue is whether you always get the same loss of chars, or whether it varies from time to time.
Can you be clearer about your situation: I think you mean that you have two computers, One desktop/server type machine which runs Visual Basic and the other an embedded computer. The desktop/server one sends out the stream of data. Is this the right picture? Are you communicating via RS 232 or is it some other serial comm 'standard'?
Code:
Speed: 38400, 8N1,no flow control, and raw input
"No flow control" can give exactly this kind of problem; if the receiving end is too busy to cope with the data flow at exactly the right time, you will get a buffer overrun and lose data in exactly this manner.
You will want to get both ends using the same kind of flow control (XON/XOFF or hardware). XON/XOFF makes the cabling simpler (and don't ask about a standard RS232 cable), but means that the applications have to do something about the possibility of XON/XOFF chars in the data stream.
The other obvious possibility is that you have a data stream that contains characters which are interpreted as having a special meaning, like the XON XOFF chars.
One question that might clarify the issue is whether you always get the same loss of chars, or whether it varies from time to time.
I am sorry if I did not be clearer.
Yes , you are right, I have two computer, my laptop connected to embedded computer with a serial cable, at the begining, only 3 wires, RXD, TXD and GND.
Configuration of serial port:
Speed: 38400, 8N1,no flow control, and raw input.
As I understand, perhaps my problem is a buffer overrun and lose some bytes. So I suppoose that I need some control, like XON/XOFF, but I never use it. How I need to use it, serial cable with all wires???
As I understand, perhaps my problem is a buffer overrun and lose some bytes. So I suppoose that I need some control, like XON/XOFF, but I never use it. How I need to use it, serial cable with all wires???
See previous reply; you need to choose between hardware (more wires!) and software (issues if the data can contain the control code!) flow control methods; you need exactly one of the two.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.