Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

onewire.py: Optimize timing, enable CRC check and slim the code #62

Closed
wants to merge 6 commits into from
Closed

onewire.py: Optimize timing, enable CRC check and slim the code #62

wants to merge 6 commits into from

Commits on Jun 16, 2018

  1. onewire.py: Optimize timing, enable CRC check and slim the code

    The reason for a change was the observation, that with about one in
    300 measurements were wrong, some of them obvious. So I made a few
    changes:
    
    1. The timing of readbit was changed to shorten the initial low puls
    to 2 µs by not calling sleep_us() at all and reading the state of the bit
    about 8 µs later. That matches better the datasheet.
    
    2. The CRC check was enabled in the method read_temp_async(). The function
    returns None, when the CRC is wrong
    
    3. The crc8() method is now table based, with two 16 byte tables.
    
    4. Some inefficient optimizations in the onwire class were removed.
    Especially caching system call names in local variables for calls
    used only once in a functions was dropped.
    
    With change 1, readings with wrong crc are very rare now, and enabling
    the crc check allows to detect them.
    
    The crc8 implementation is a Python port of the code published here:
    http://lentz.com.au/blog/tag/crc-table-generator
    robert-hh committed Jun 16, 2018
    Configuration menu
    Copy the full SHA
    f3d9d80 View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2018

  1. Update onewire.py

    robert-hh authored Jun 25, 2018
    Configuration menu
    Copy the full SHA
    86fa8e7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ed1999f View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2018

  1. Configuration menu
    Copy the full SHA
    5f9145d View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2018

  1. Configuration menu
    Copy the full SHA
    dabce8d View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2019

  1. lorawan-nano-gateway/nanogateway.py: Fix error handling

    With version 1.20.1, the object returned by:
    except Exception as exp:
    does not have the attribute exp.errno any more. Instead,
    exp.args[0] is used, which is backward compatible.
    robert-hh committed Oct 11, 2019
    Configuration menu
    Copy the full SHA
    1738aa2 View commit details
    Browse the repository at this point in the history