Serial Port Returning Garbage. Why?

Chris Liechti cliechti at gmx.net
Mon Jul 15 13:51:39 EDT 2002


mlai at intrinsyc.com (max) wrote in 
news:f128688f.0207150939.1af19401 at posting.google.com:
> I need some help.

many people who post here do ;-)
 
> I've been trying to establish a bi-directional serial communications
> link between two microprocessors with a python script. The link is
> used by a 'master' processor to transmit commands to a 'slave'
> processor, while also allowing the 'slave' to return any output back
> to the 'master' for analysis. The information garnered from the
> 'slave' is used to determine subsequent actions.
...
> Anyway, I'm using the os module's functions to read and write to the
> serial port, and i'm using os.system to invoke the stty program to set
> the properties of the serial port connection. The reason for using
> stty is because the termios and fcntl modules aren't available for
> use.
>... 
> Knowing all of this, does anyone know what could be causing the output
> to become garbled?

maybe your port is not configured to transmit binary data. usualy the linux 
drivers interpret the characters and provide line editing etc, like in a 
console. my module uses the termios and fnctl module, but you might get 
some ideas on how to configure your port:

http://pyserial.sf.net

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list