sensirion / python-uart-scc1 Goto Github PK
View Code? Open in Web Editor NEWPython driver for Sensirion SCC1-USB Cable
Home Page: https://www.sensirion.com/products/catalog/SCC1-USB
License: BSD 3-Clause "New" or "Revised" License
Python driver for Sensirion SCC1-USB Cable
Home Page: https://www.sensirion.com/products/catalog/SCC1-USB
License: BSD 3-Clause "New" or "Revised" License
Hi,
I got the SLF3S-1300F Evaluation Kit from Mouser. I connected the sensor to my computer using the supplied USB to i2c converter. I installed the sensirion-uart-scc1 package in my virtual environment and made a file "sensiron_flow_sensor_test.py" with the contents of "contscc1_slf3x_example.py". However, if I run this example I get error 33, see the terminal output below. Any idea what could be the issue?
I am running python 3.11.1 on windows 11.
Kind regards,
Martijn Schouten
(venv) D:\lmts\git\pumptestbench_v2>python ./devices/flow_sensor/sensirion_flow_sensor_test.py --serial-port COM12
SHDLC device with address 0 returned error 33.
Traceback (most recent call last):
File "D:\lmts\git\pumptestbench_v2\venv\Lib\site-packages\sensirion_shdlc_driver\device_base.py", line 88, in execute
data, err = self._connection.execute(self._slave_address, command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\lmts\git\pumptestbench_v2\venv\Lib\site-packages\sensirion_shdlc_driver\connection.py", line 68, in execute
data, error = self.transceive(slave_address, command.id, command.data,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\lmts\git\pumptestbench_v2\venv\Lib\site-packages\sensirion_shdlc_driver\connection.py", line 105, in transceive
raise ShdlcDeviceError(error_code) # Command failed to execute
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sensirion_shdlc_driver.errors.ShdlcDeviceError: SHDLC device returned error code 33: Unknown error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\lmts\git\pumptestbench_v2\devices\flow_sensor\sensirion_flow_sensor_test.py", line 15, in <module>
sensor = Scc1Slf3x(device)
^^^^^^^^^^^^^^^^^
File "D:\lmts\git\pumptestbench_v2\venv\Lib\site-packages\sensirion_uart_scc1\drivers\scc1_slf3x.py", line 32, in __init__
self._serial_number, self._product_id = self._get_serial_number_and_product_id()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\lmts\git\pumptestbench_v2\venv\Lib\site-packages\sensirion_uart_scc1\drivers\scc1_slf3x.py", line 202, in _get_serial_number_and_product_id
data = self._scc1.transceive(0x50, [], 0.01)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\lmts\git\pumptestbench_v2\venv\Lib\site-packages\sensirion_uart_scc1\scc1_shdlc_device.py", line 64, in transceive
result = self.execute(ShdlcCommand(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\lmts\git\pumptestbench_v2\venv\Lib\site-packages\sensirion_shdlc_driver\device_base.py", line 93, in execute
raise self._get_device_error(exc.error_code)
sensirion_shdlc_driver.errors.ShdlcDeviceError: SHDLC device returned error code 33: Unknown error.
I have the SLF3S-1300F Evaluation Kit from Mouser. Usually running the example "contscc1_slf3x_example.py" works nicely. However, if my program crashes and sensor.stop_continuous_measurement() is not called, then the next times I start the example I cannot connect to the sensor anymore. In this case I get a SHDLC device returned error code 32: Unknown error.
from device.set_sensor_type(Scc1Slf3x.SENSOR_TYPE)
The solution seems to be easy: execute an device.device_reset()
before device.set_sensor_type(Scc1Slf3x.SENSOR_TYPE)
. For robustness, it might be good to add this to the example.
Hi,
We are using this library to read out an SLF3S-1300F evaluation kit. To validate that the flowsensor is working correctly we calibrated it using a syringe pump with a syringe filled with IPA. When we use the viewer software we measure the same flow rate as that we set the syringe pump to. However, when we use this library we get only half the flow rate. We did set the sensor to IPA using sensor = Scc1Slf3x(device, SlfMode.LIQUI_2)
Could it be that somewhere in the library the data conversion goes wrong, causing the flow rate to be halved?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.