Giter Club home page Giter Club logo

sartorius-sbi-httpd's People

Contributors

ericlowry avatar iot-democore avatar

Stargazers

 avatar

Watchers

 avatar  avatar

sartorius-sbi-httpd's Issues

Unable To Connect To Serial Port

I have downloaded github library and install all need libraries with latest serialport.

I have made following changes into sbi-httpd.js to make compatible with new serialport parser changes.

// Changes begins.

//
// default error handler (just throws the error)
//
function throwIt(err){
if (err) throw new Error(err);
}

class Scale extends Emitter {

constructor( options, callback ) {

    super();

    let scale = this;

    scale.options = Object.assign({}, TTY_DEFAULTS, options || {});

    scale.responseHandler = undefined;

    const Regex = require('@serialport/parser-regex')
    scale.tty = new SerialPort( scale.options.ttyDevice, {

        //"parser": SerialPort.parsers.readline("\r\n"),
        "autoOpen": false,

        // defaults

        "baudRate": scale.options.baudRate,
        "dataBits": scale.options.dataBits,
        "stopBits": scale.options.stopBits,
        "parity":   scale.options.parity,
        "rtscts":   scale.options.rtscts,
        "xon":      scale.options.xon,
        "xoff":     scale.options.xoff,
        "xany":     scale.options.xany

    });
    const parser = scale.tty.pipe(new Regex({ regex: /G\s{5}([-+\s]{1})\s([\d\.\s]{8})\s([\w\s]{3})\r\n/ }))

// Changes ends

Now when I run sbi-httpd.js with node command. I get following error.

Unable To Connect To Serial Port

Please someone help me how to fix this issue.

Thank you.

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.