Hi,
I am using the BMP5DIRECTSDK examples C#with Visual Studio at the moment.
I would like to have an Python 3 example serial connection in the examples map in BMP5DIRECTSDK.
Is that possible?
Or does someone has a working Python code to get aserial connection with a cr1000?
With kind regards.
There aren't any Python examples that I know about for using the BMP5 Direct SDK.
The following, however, might be what you are looking for (it is based on PakBus, not the BMP5 Direct SDK) :
https://pycampbellcr1000.readthedocs.io/en/latest/
This project is not officially supported by Campbell Scientific, and I don't know if it the code is still being maintained or not.
--
It is theorectically possible to use Python with the BMP5 Direct SDK. It is all about being able to tie in to the "C language calling convention" functions that are contained in the file "simplepb.dll" that is included with the SDK.
ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries :
https://docs.python.org/3/library/ctypes.html
https://stackoverflow.com/questions/252417/how-can-i-use-a-dll-file-from-python
The BMP5 Direct SDK documentation discusses what functions are contained in the simplepb.dll and how to reference those functions with the correct argument types to successfully make the calls from your code. To create Python examples, that is the process that Campbell would go through. We can note the request for consideration in future releases.
Hi GTProdMgr,
Thanks for the reply.
yes i know the pycampbellcr1000 python code, i am using it.
But it doesnt work because of an error when i try to run the code/connect to the cr1000.
It gives the error:"stdout has no attribute buffer".
I am in contact with the developer of the pycampbellcr1000 code And he knows there has been reports with this error, but he cant remember how he solved it.
He is very helpfull and im sure he will sort it.
With kind regards.
Hi,
Is there some news regarding the use of Python?
With the kindest regards,
Mark
Hi,
Is there some news regarding the use of Python?
With the kindest regards,
Mark
@Makada can you please provide your email address I need your help regarding pycampbellcr1000 library?
Hi Haidar,
What do you want to know?
Might be of help for others if post here👍
The error you're encountering on line 27 is most likely due to the serial module not being imported correctly. This can happen if the module is not installed or if there is a typo in the import statement.
To resolve this issue, make sure you have the pyserial package installed. You can install it by running the following command in your terminal: pip install pyserial
After installing pyserial, you should be able to import the serial module without any errors.
Hi Makada
I have to send you some screenshots of errors I'm getting while Fetching the mateorological data using pycampbellcr1000 library
Please please send your Email so that we can communicate easily.
audirennsport@delta.nl