Non-POSIX parity (mark/space) with Python-Serial on Linux.

gene heskett gheskett at wdtv.com
Mon Nov 21 12:25:54 EST 2011


On Monday, November 21, 2011 11:58:53 AM David Riley did opine:

> On Nov 21, 2011, at 11:28 AM, Matthew Lenz wrote:
> > Using 8N1 under minicom with this device resulted in garbled text when
> > once connected.  Connection using 7M1 resulted in the correct text. 
> > So there must be something else that needs to be done in my python
> > program correct?
> 
> Under minicom in 8N1, it's going to look garbled because the high bit
> will always be set. Minicom will try to spit out those characters
> anyway, which will print out whatever extended ASCII garbage your
> terminal supports in the 0x80-0xFF range. Programmatically, though, you
> can strip off the high bit when you're receiving it in Python.

I have been using 8n1 in minicom for years, never ever had such a problem. 
In fact, I don't even know if I can set the path to mark parity as it is so 
rarely used.  E or O as error detectors are much more commonly used.

Example copy/paste from minicom, talking to a trs-80 Color Computer 3 
running a shell under nitros9, which is a bit like unix.  I am asking it 
for the settings of its own output path, .1=stdout:

{t2|07}/DD/NITROS9/dw3install/6309L2/SCRIPTS:tmode .1
/t2
 upc=00 bso=01 dlo=00 eko=01 alf=01 nul=00 pau=01 pag=18
 bsp=08 del=18 eor=0D eof=1B rpr=09 dup=01 psc=17 int=03
 qut=05 bse=08 ovf=07 par=01 bau=06 xon=00 xof=00
{t2|07}/DD/NITROS9/dw3install/6309L2/SCRIPTS:

And that is 9600 baud 8n1 on both ends.  Ascii is normally 7 bit and will 
have a low 8th bit if fed normal ascii data, so how is the 8th bit getting 
set other than purposely setting 7M1 on the other end of the cable?

> "Space" parity, on the other hand, should look normal under Minicom
> because the high bit will always be low, giving you standard 7-bit
> ASCII.
> 
Yes.

> - Dave


Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene>
Everything is controlled by a small evil group to which, unfortunately,
no one we know belongs.



More information about the Python-list mailing list