<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>RS232 has a lot of settings, baud rate is only one of them</span></div><div><br><span></span></div><div><span>You can use 'stty -a' to see what available.</span></div><div><span>Unless all your settings are correct you are going to have a problem with communication.<br></span></div><div><br></div><div>Valery.<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight: bold;">From:</span></b> Diego Iastrubni <elcuco@kde.org><br> <b><span style="font-weight: bold;">To:</span></b> "linux-il@cs.huji.ac.il"
<linux-il@cs.huji.ac.il> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, May 7, 2012 9:24 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> writing data over RS232<br> </font> </div> <br>Hi all,<br><br>I have been assigned at work to write a specific protocol between two <br>machines, which eventually will be over RS232. As part of the development I <br>decided to write it on linux, and simulate the communication using a named <br>pipe. In theroy, it should be trivail since the protocol only needs to know <br>about the FD to read/write to, correct? Wrong.<br><br>I face two problems (maybe one, as both problems seem similar):<br><br>When I try to read from the PC (Ubuntu 12.04, 64bit), the read just aborts <br>returning "0". If I run the application several times, I somtimes see that the <br>app can read ONE byte. Sometimes.<br><br>When I write from the PC, and read from the device (Andriod, 2.3.7, Linux <br>2.6.38.8)
the android device reads garbage. I mean, the byte count is wrong, <br>and the content is usually garbage.<br><br>When I connect microcom (busybox) on Android (actually "microcom /dev/ttyS3 | <br>hexdump -C") I can see that the bytes sent are mostly arriving, however maybe <br>times bytes are missing, and sometimes the same bytes are read twice (I sent <br>"testing 123" and read "testing 12323").<br><br>Some remarks:<br><br>- ttyS* are opened on both sides using "open(file, O_RDWR|O_NOCTTY)"<br>- speeds are set on both side using "csetispeed(&to, B1900);csetospeed(&to, <br>B1900);", note that I lowered the speed for the test. <br>- The Android side has no HW flow control (that might be the trigger).<br><br>What would you recommend me to do?<br><br>- diego<br><br>_______________________________________________<br>Linux-il mailing list<br><a ymailto="mailto:Linux-il@cs.huji.ac.il"
href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br><a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br><br><br> </div> </div> </blockquote></div> </div></body></html>