Coder Social home page Coder Social logo

sensirion / python-shdlc-driver Goto Github PK

View Code? Open in Web Editor NEW
5.0 14.0 1.0 10.72 MB

Python Driver for Sensirion SHDLC Devices

Home Page: https://sensirion.github.io/python-shdlc-driver

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
sensirion sensorbridge evalkit shdlc

python-shdlc-driver's Introduction

Python Driver for Sensirion SHDLC Devices

This repository contains the base driver for Sensirion SHDLC devices as a Python package. For details, please read the package description in README.rst.

Usage

See package description in README.rst and user manual at https://sensirion.github.io/python-shdlc-driver/.

Development

We develop and test this driver using our company internal tools (version control, continuous integration, code review etc.) and automatically synchronize the master branch with GitHub. But this doesn't mean that we don't respond to issues or don't accept pull requests on GitHub. In fact, you're very welcome to open issues or create pull requests :)

Check coding style

The coding style can be checked with flake8:

pip install -e .[test]  # Install requirements
flake8                  # Run style check

In addition, we check the formatting of files with editorconfig-checker:

pip install editorconfig-checker==2.0.3   # Install requirements
editorconfig-checker                      # Run check

Run tests

Unit tests can be run with pytest:

pip install -e .[test]                          # Install requirements
pytest -m "not (needs_serialport or needs_tcp)" # Run tests without hardware
pytest                                          # Run all tests

To run the tests which access connected hardware, you need to pass following arguments to pytest:

  • --serial-port: The serial port where a device is connected (e.g. COM7)
  • --serial-bitrate: The bitrate of the device connected to the serial port (e.g. 460800)
  • --serial-address: The slave address of the device connected to the serial port (e.g. 0)
  • --tcp-port: The TCP IP address where a device is connected (e.g. 192.168.100.209)
  • --tcp-port: The port of the device connected via TCP (e.g. 10001)
  • --tcp-address: The slave address of the device connected via TCP (e.g. 0)

Build documentation

The documentation can be built with Sphinx:

python setup.py install                        # Install package
pip install -r docs/requirements.txt           # Install requirements
sphinx-versioning build docs docs/_build/html  # Build documentation

License

See LICENSE.

python-shdlc-driver's People

Contributors

dstraessler avatar glan-2000 avatar leoniefierz avatar ubruhin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ppt000

python-shdlc-driver's Issues

A list of supported ID commands

There is a comment in your usage example

    # Execute custom command
    raw_response = device.execute(ShdlcCommand(
        id=0xD2,  # The command ID as specified in the device documentation
        data=b"\x01",  # The payload data to send
        max_response_time=0.2,  # Maximum response time in Seconds
    ))

Could you please link the device documentation with a list of supported ID commands? In particular, what's the command to initialize and read a differential pressure from an SDP31 device using your API?
Thank you.

Node SHDLC Driver

I work at a company which uses Node to communicate with Teensy devices over serial. We are looking to add the ability to communicate with a SF06 flow sensor using the RS485 sensor cable. Currently we have implemented a test script using the the Python SHDLC driver and the RS485 SF06 implementation guide.

We would like to create a basic Node package which uses Node SerialPort · Node.js package to access serial ports for Linux, OSX and Windows. in order to communicate with Sensirion devices using SHDLC. Given our use case is to control the SF06 flow sensor I would likely include sensor specific commands in the library.

There is some existing work on a High-level data link control Node module called elkrem/HDLC. We would intend to use this for reference, however, largely write from the ground up using Typescript.

Are there any licensing issues which we should be aware of when writing this library? Our current plan is to release this as an open source package under Cytera, then at a future point we could transfer ownership or the Sensirion team could fork the project.

Do the Sensirion team have any requests on implementation or approach? We were considering making the serialport library pluggable such that consumers of the package would be able to provide their own.

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.