Code Monkey home page Code Monkey logo

ehz-sml-reader's Introduction

ehz-sml-reader

EHZ SML parser/reader to be used with IR opto heads (tested with ehz ISKRA MT681)

Build Status

Usage

new Reader({ port: '/dev/ttyUSB0' })
  .on('data', (msg) => console.log('0:', msg)) // e.g. msg = { total: 123.1234, t1: 123.1234, t2: 0 }
  .on('error', (msg) => console.log('0:', msg))

Default options

const defaultOptions = {
  port: '/dev/ttyUSB0',
  portOptions: {
    baudrate: 9600,
    databits: 8,
    stopbits: 1,
    parity: 'none',
    buffersize: 2048,
    parser: SerialPort.parsers.raw
  },
  pattern: {
    message: new RegExp('1b1b1b1b01010101.*1b1b1b1b.{8}'),
    params: {
      total: new RegExp('070100010800.{24}(.{16})0177'),
      t1: new RegExp('070100010801.{24}(.{8})0177'),
      t2: new RegExp('070100010802.{24}(.{8})0177')
    }
  },
  maxChunkSize: 4096,
  autoStart: true
}

ehz-sml-reader's People

Contributors

z0mt3c avatar mohlendo avatar

Watchers

James Cloos avatar

Forkers

alex-voigt

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.