GithubHelp home page GithubHelp logo

sensirion / python-uart-scc1 Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 52 KB

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

Python 100.00%
liquid-flow sensirion shdlc uart usb scc1

python-uart-scc1's People

Contributors

psachs avatar rol-la avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

python-uart-scc1's Issues

SHDLC device returned error code 33: Unknown error with

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.

error code 32: Unknown error when stop_continuous_measurement() not called

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.

Measured flow rate with IPA half of the set flow

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.