Owfs has multiple aspects to error management.



Error detection

  • 1-wire is an inherently noisy and error-prone protocol.

    • Some adapters improve signal analysis a offer active pull-up
    • Reflections in the line are very sensitive to wiring topology
  • OWFS implements all data-correction algorithms (CRC8, CRC16, read after write)
  • The internal representation of the 1-wire bus is cached only transiently, so bad information will time out.
  • "Uncached" information



  • Background

    • Long-running monitoring processes require resilience
    • It is not unusual for USB (and possibly serial) connections to be transiently disconnected or at least reset
    • The goal is for adapter problems to repair themselves, possibly with a short loss of function
  • Implementation

    • Error on 1-wire RESET increment an adapter-specific counter.
    • Any successful RESET resets the counter as well.
    • After an error threshold is passed (currently 5) reconection is attempted.
    • Before any of the major OWFS entry points (read, write, parse, directory) reconnection is attempted

      • The port is formally closed
      • The port is reopened with the same initial specification.
  • USB Specifics

    • The USB adapter, DS9490, poses a special problem.
    • USB ports are re-enumerated on reconnection and so using the same "address" doesn't work.
    • OWFS attempts to find a characteristic element on the bus the first time connection is established (one of the *81 chips) and matches that to the available USB adapters on reconnection.
  • Exceptions

    • Network connection to owserver does not reconnect. Each transaction has a time limit (2-3 seconds) and then returns an error. Connections in owserver are torn down and restarted with each transaction so reconnection would be superfluous.
    • Network connection to LinkE does trigger the reconnection algorithm.

Previous page: Cache structure
Next page: owserver protocol