I'm curious about the serial monitor in the ArduinoIDE.
When I access a COMport via Python client, I can either read, or write.
How is the IDE handling this?
I'm curious about the serial monitor in the ArduinoIDE.
When I access a COMport via Python client, I can either read, or write.
How is the IDE handling this?
The same way. The IDE can also read and write. Both reading and writing are required for uploading your sketch to the Arduino. With serial monitor, both reading and writing are used.
Or did you mean to ask how the IDE will handle the situation where your Python script is using the COM port? It will not be able to, until your Python script closes the COM port. You will not be able to select the COM port in the IDE menu, or you will get an error message.
The same will happen in reverse. If you are using serial monitor and you attempt to run your Python script, the Python script will probably error because it can't open the COM port.
Hi @bmarc92. I don't know whether you will find it useful, but I'll share some links to the relevant codebases. You might be able to get a more low level understanding of the subject by studying that code.
The Arduino IDE 2.x codebase only implements the GUI for the Serial Monitor so you won't find anything interesting there. The actual serial port communication under the hood is provided by a tool named serial-monitor:
In turn, serial-monitor uses the go.bug.st/serial Go module:
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.