-
-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small documentation change for Python Bindings #87
Comments
Thanks for your suggestions. |
I tested the master code of Python. It works fine. Could you test the master code? Open the following comments at python\CMakeLists.txt
This way, the application will output debug info to console and log. CSerialPort_20240515.log
|
Console Result,
At the end, the program just came back to the prompt... I didn't stop it.
My Python program,
|
send is same with log. |
I fixed formatting so things match in the above log.
The data received, the 432 bytes, is a fragment from my target, probably from its boot up log. Again the python program just ends, there is no error message from Windows. |
Could it be a Python version problem? I am using Python 3.12.3. |
My python version 3.10. Could you test the receive function with VSPD(Virtual Serial Port Driver)? In this way, the program is not affected by the hardware. |
Do you mean with CDC serial driver? I have been using However I am sending a lot of data and running into a Python GIL problem to read the serial data fast enough before Windows buffers overflow. I am running more tests to try and truly understand the nature of my problem using pyserial. With WireShark I am able to see the serial data packets and frames and they are good. However on the PC, I get packet decode errors and I see that some data is just missing, and I see large values of Your CSerialPort interests me because you create your own thread and buffer to read serial, and that means your read loop will be outside of the Python GIL, and should read serial port no matter what Python is doing. I don't know much about swig and how it creates the Python bindings, but my feeling is thats where the problem is. |
Could you use the C++ program CSerialPortDemoNoGui to test the receive problem? If CSerialPortDemoNoGui also crash, we could use Visual Studio debug it for more information.
|
That seems to work, specifically,
Running it the console fills up very fast, here is a snippet from the log,
I didn't decode anything to see if this my expected data... I do have a Python 3.10 virtual environment, but when I try to run
I tried putting the DLL local in this directory but that didn't help. I rebuilt CSerialPort from within the Python 3.10 venv. The Python 3.12 venv the import does succeed, but port doesn't work as previously reported above. |
I test different version python. windows 10 |
Thank you. The Python 3.12 result at least matches my result. I am in less of a hurry now, as I resolved a problem with But I am interested still in CSerialPort because I have some low level processing that I would like to move out of Python and into C++ and your project might be ideal for that. Thank you so much for trying. |
Describe the bug
It was not clear how to build Python bindings from the instructions.
To Reproduce
Current Build instructions:
Additional context
Suggestion:
Has this been tested on Windows lately? I got the build to work, and Python bindings, and I am testing it with a STM32 target that I have, and I don't get any bytes in or out of it. I modified the test program slightly, added some prints,
OS Name Microsoft Windows 11 Pro
Version 10.0.22631 Build 22631
The text was updated successfully, but these errors were encountered: