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

David Riley fraveydank at gmail.com
Mon Nov 21 11:47:53 EST 2011


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.

"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.

- Dave


More information about the Python-list mailing list