Is it possible to use python to get True Full Duplex on a Serial port?

exarkun at exarkun at
Fri Aug 14 15:58:37 CEST 2009

On 01:38 pm, hendrik at wrote:
>On Friday 14 August 2009 12:54:32 Diez B. Roggisch wrote:
>>How about using pyserial? With that, I never had any problems 
>>the the serial ports, and AFAIK no duplex-problems as well. And I
>>seriously doubt that these are a python-related problem - python only
>>has a very thin, direct layer above the posix-calls, and doesn't do
>>anything that would explain your observed behavior. The GIL is not the
>>issue here either - it won't interfer with blocking IO.
>I will have a look at pyserial - have never used it before.
>I agree that it is probably not a Python issue, and that the GIL is
>irelevant  - I was hoping that someone had already travelled the road 
>could give me a signpost.
>In the meantime I have had another idea which I have also not tried 
>namely to do independent opens for reading and writing, to give me two 
>instances instead of one, and to try with that.  I have no idea if it 
>make any difference, or even work at all.
>My normal stuff works, but I do not like it as it is essentially busy 
>with short sleeps in between. In the eBox, it uses most of the 
>processor just
>to move a few bytes of I/O in and out between the serial port and the 
>and struggles to do that better than five times a second, while the 
>time on the 115200 baud port is only about 2 milliseconds.

One strategy you might employ to get rid of the busy looping is to use 
Twisted and its serial port support.  This also addresses the full- 
duplex issue you've raised.


More information about the Python-list mailing list