You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a really strange issue on Windows 10 Pro using python 3.12.1 with PySerial 3.5.
I have an arduino board with MEGA2560 connected via USB and the firmware on the board will reply to a "*IDN?\r" command with some version string.
If I send the commands in an interactive python promt, all works fine:
Also from the debug console (in VS Code) all works fine:
However, when I run the commands from a script, it seems like nothing is sent to the board:
I tried to put time.sleep() everywhere, but it did not change anything. It really seems like the difference is, if the call comes from an interactive session, or not.
I am not sure, if the issue originates from PySerial, from python or from Windows.
Does somebody here have an idea, where this could come from?
Thanks and BR
The text was updated successfully, but these errors were encountered:
Yes, I'm seeing an issue similar to yours. In my case a sleep(5) after the serial port creation seemed to be a workaround.
Thanks for the information! A 2 second sleep works for me. Amazing! I only tried 100ms sleep, which I thought was super long, but apparently not enough.
I also found that writing to the .timeout member is a very bad idea. As soon as I try to change the timeout, the next send transaction just sends garbage.
Hello,
I found a really strange issue on Windows 10 Pro using python 3.12.1 with PySerial 3.5.
I have an arduino board with MEGA2560 connected via USB and the firmware on the board will reply to a "*IDN?\r" command with some version string.
If I send the commands in an interactive python promt, all works fine:
![Python Bug 0](https://private-user-images.githubusercontent.com/100354556/300961888-b88ba644-83f6-47dd-ba25-5a58583c6979.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1ODc2ODksIm5iZiI6MTcyMDU4NzM4OSwicGF0aCI6Ii8xMDAzNTQ1NTYvMzAwOTYxODg4LWI4OGJhNjQ0LTgzZjYtNDdkZC1iYTI1LTVhNTg1ODNjNjk3OS5QTkc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxMFQwNDU2MjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xODM0YTdlNjFkZTIwZGFkMTFhMTUyY2I4MWVmNjY4NzNhZjEwYzVhMmM1ZWQzYmQ4YmE4YmE2NWJkNWRiYzBmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.0QQMT3aLtxJmPaxghr5etdgYPfnxFmz6IViR_r65o3k)
Also from the debug console (in VS Code) all works fine:
![Python Bug 1](https://private-user-images.githubusercontent.com/100354556/300962159-8bb04e75-4098-42e3-9f60-d6ea43b449e5.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1ODc2ODksIm5iZiI6MTcyMDU4NzM4OSwicGF0aCI6Ii8xMDAzNTQ1NTYvMzAwOTYyMTU5LThiYjA0ZTc1LTQwOTgtNDJlMy05ZjYwLWQ2ZWE0M2I0NDllNS5QTkc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxMFQwNDU2MjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02NzMxMTY4MmQxY2ExZjMxMWRmMzRmZWMxNDc4ZDI0NjkyNDJlNDFkNzY1NWMxZGI0NmZjNDgxYzBhNGU3NGRhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.A4Z5Na__MWxTxB4W3UTmqPJuYxCpYUor-g8E3GdJDOo)
However, when I run the commands from a script, it seems like nothing is sent to the board:
![Python Bug 2](https://private-user-images.githubusercontent.com/100354556/300962459-72fc268d-093b-464b-9f61-795ea1627e96.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1ODc2ODksIm5iZiI6MTcyMDU4NzM4OSwicGF0aCI6Ii8xMDAzNTQ1NTYvMzAwOTYyNDU5LTcyZmMyNjhkLTA5M2ItNDY0Yi05ZjYxLTc5NWVhMTYyN2U5Ni5QTkc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxMFQwNDU2MjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NTBlOTk2YTkyODBhYTY4MmE2YWE4OWFkNmY4NzUxMTU2MmMwYjBhMGNlNjMzN2ZhY2QxYWU4ZmQyNzQyZDg1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.MbC1BmlSC42OynOuXIkuP3lyziFALsO5F82L7SHpXyc)
I tried to put time.sleep() everywhere, but it did not change anything. It really seems like the difference is, if the call comes from an interactive session, or not.
I am not sure, if the issue originates from PySerial, from python or from Windows.
Does somebody here have an idea, where this could come from?
Thanks and BR
The text was updated successfully, but these errors were encountered: