Go Down

Topic: Slow serial write in Python compared to Arduino IDE serial monitor (Read 517 times) previous topic - next topic

Robin2

Python Code
I just copied your Python and Arduino code and tried it on this Linux laptop and it worked just as expected.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

cattledog

Quote
I just copied your Python and Arduino code and tried it on this Linux laptop and it worked just as expected.
@Robin2 are you saying that the code with rtscts = True runs successfully in Linux?

What Arduino is on the other end?

In Windows10, with an Arduino Uno, and Python 3.6.5 and IDLE I can not run your demo with the hardware flow control True.







sterretje

I'm sure some study of the Arduino hardware serial core will explain, but from what I can see the Uno I'm testing on does not support hardware flow control.
The flow control only effects if the Arduino is reset when opening the serial port on a PC or not. That's not part of the Serial library ;)

In Win10 using a C# or C++ application, the flow control configured in the application does affect that behaviour.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

cattledog

In Win10 using a C# or C++ application, the flow control configured in the application does affect that behaviour.
Thanks for that information. Maybe it would then be reasonable for a Python3 application in Win10 to also be affected by the flow control.

I know that in the past I tried several times to run @Robin2's demonstration programs without success, but I didn't figure out the reason until I began to dig into @atonbom's failure which I confirmed.

Is there's anyone with experience on a Mac running Robin2's python demo pair?
Other windows versions?

It sounds like the demonstration pair run successfully in Linux but fail in Windows 10. Does anyone know why?

Robin2

@Robin2 are you saying that the code with rtsctc = True runs successfully in Linux?

What Arduino is on the other end?

In Windows10, with an Arduino Uno, and Python 3.6.5 and IDLE I can not run your demo with the hardware flow control True.
Yes

Uno

I don't use Windows.


What do you mean by "IDLE"


If you are saying that Windows requires rtscts=True then I will mention that when I refer to the example in future. And thank you for pointing it out.


EDIT -- Stupid mistake - I intended to write the following  (see Reply #20)
If you are saying that Windows requires rtscts=False then I will mention that when I refer to the example in future. And thank you for pointing it out.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

cattledog

Quote
If you are saying that Windows requires rtscts=True then I will mention that when I refer to the example in future. And thank you for pointing it out.
No. Windows10 requires rtscts = False.

False is the default setting of pySerial.

https://pyserial.readthedocs.io/en/latest/pyserial_api.html

Code: [Select]
classserial.Serial
__init__(port=None, baudrate=9600, bytesize=EIGHTBITS, parity=PARITY_NONE, stopbits=STOPBITS_ONE, timeout=None, xonxoff=False, rtscts=False, write_timeout=None, dsrdtr=False, inter_byte_timeout=None, exclusive=None)


When I played around a bit with CoolTerm connected to a Uno (no python involved) I could see that it was the cts setting which mattered and not the rts.

Quote
What do you mean by "IDLE"
IDLE is an IDE and text editor which was recommended by the python.org tutorials.

https://docs.python.org/3/library/idle.html

Some additional information is here
https://www.softwaretestinghelp.com/python-ide-code-editors/

EDIT: Anyone with Mac experience and Robin2's python/Arduino Demo should chime in now so that when he adds the Windows information to the demo he can address the Mac as well.

Robin2

No. Windows10 requires rtscts = False.
Stupid me. That's what I intended to say. I will update my earlier Reply.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up