Is it possible to use python to get True Full Duplex on a Serial port?
Hendrik van Rooyen
hendrik at microcorp.co.za
Fri Aug 14 09:38:15 EDT 2009
On Friday 14 August 2009 12:54:32 Diez B. Roggisch wrote:
>
> How about using pyserial? With that, I never had any problems accessing
> 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 and
could give me a signpost.
In the meantime I have had another idea which I have also not tried yet,
namely to do independent opens for reading and writing, to give me two file
instances instead of one, and to try with that. I have no idea if it would
make any difference, or even work at all.
My normal stuff works, but I do not like it as it is essentially busy looping
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 TCP/IP,
and struggles to do that better than five times a second, while the message
time on the 115200 baud port is only about 2 milliseconds.
- Hendrik
More information about the Python-list
mailing list