Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

BMP5DIRECTSDK incl. Python?


Makada Nov 13, 2020 05:32 PM

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.


GTProdMgr Dec 31, 2020 11:01 PM

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.


Makada Jan 1, 2021 03:32 PM

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. 


Makada Feb 2, 2022 01:51 PM

Hi,

Is there some news regarding the use of Python?

With the kindest regards, 

Mark


Makada Apr 24, 2022 08:12 AM

Hi,

Is there some news regarding the use of Python?

With the kindest regards, 

Mark


Haidar May 20, 2023 03:46 PM

@Makada can you please provide your email address I need your help regarding pycampbellcr1000 library? 


Makada May 22, 2023 11:01 AM

Hi Haidar, 

What do you want to know?

Might be of help for others if post here👍


Haidar May 24, 2023 01:57 PM

Makada May 25, 2023 02:03 PM

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.


Haidar May 25, 2023 02:06 PM

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.


Makada May 25, 2023 04:18 PM

audirennsport@delta.nl

Log in or register to post/reply in the forum.