Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Robin
    @Acccent
    same with trying to resolve 'fs'. I'm on Windows 10
    (I'm trying to bundle it with webpack – sorry for giving all the info in the wrong order)
    Robin
    @Acccent
    Looks like this just isn't doable and it's not a good idea to use webpack with node-serialport
    Gunnar Oledal
    @Dealerpriest
    Hello! Anybody used serialport together with socket.io?
    I have some weird behaviour when i try to write to the serialport in the socket message callback.
    Partap Davis
    @partap
    Hi all! I'm developing an app on OSX, but trying to also build for Windows and Linux, using electron-builder. Most stuff "just works", but I'm having problems with serialport
    I've looked at electron-rebuild... It seems like I'm on the right track, but I'm not actually seeing any options for platform (win, linux) there... just electron version and arch
    AgileDog
    @AgileDog
    @Dealerpriest I don't monitor this regularly and just get a weekly digest. If you are still having issues, I may be able to help. We have developed a working system using socket.io and serialport
    Partap Davis
    @partap
    If anyone cares, I figured it out...electron-rebuild wasn't necessary. electron-builder handles it with a postinstall script: "electron-builder install-app-deps"
    Mr-KoPu
    @Mr-KoPu
    Hello everyone, I am trying to install node-serialport on an embedded platform running arm linux. Is there any good way? Not RaspberryPi Thank you!
    Gunnar Oledal
    @Dealerpriest
    @AgileDog Thx for the offer! I eventually got it working. The issue was apparently related to the socket code. Actually I didn't get to the bottom of it. But it was somehow related to my client code creating two sockets while my socket-to-serial server only expects one socket connection. When I made sure the client only inititated one socket, everything worked as expected.
    AgileDog
    @AgileDog
    @Dealerpriest Our application allows for multiple browser tabs/windows connected to multiple serial ports. The way we handle this is to use the "rooms" feature of socket.io. The server creates one socket and the clients connect up to individual "rooms" which are, in fact, one socket to one room. This way we can have one socket on the server and as many as we like on the client. Then we keep an array of serial port to client socket on the server side so we can direct serial communications to the correct socket.
    Gunnar Oledal
    @Dealerpriest
    @AgileDog neat
    :D
    DioBal
    @DioBal
    Hello, I need to send the CR (cartridge return) ASCII character as a message, how would I accomplish that
    Duke
    @DukethePianist_twitter
    image.png
    Hello, I am having issues downloading serialport. I have node v10.3.0. I have seen many more of install issues with serialport but none of the fixes I found worked for me. Here is the code of me trying to install serialport above. Any help is much appreciated.
    Carl-CircuitWorx
    @Carl-CircuitWorx
    Hi, I have a binary data stream with no line termination.. data is separated only by gaps in transmission. So need to implement a parser that has a timeout and supply's the data received during that time.. can any one give me some pointers
    Wookee420
    @Wookee420
    Hi, im trying to make sms sending machine with simple usb mode using node-serialport and it sends messages with no problem but i cant read anything that could resemble modem response, i've tried everything thats available on npmjs.com with mear results, please help :)
    Francois Weber
    @coach1001
    Hi everyone, first time question asker here. created a vue cli 3 app. vue added. added the vue-cli-plugin-electron-builder plugin. in the main rendering thread of electron i tried to add "var SerialPort = require('serialport')" and I receive this message "TypeError: Path must be a string. Received undefined" and a confusing stacktrace. Might be a problem with the plugin might be a problem with the cli. I dont know. Hoping someone may have happened the same problem and have come with a solution. vue-cli 3.0.1 , electron ^2.0.2 and serialport ^6.2.2
    Bryan Hughes
    @nebrius
    @rwaldron here's the unmaintained GitHub badge I use: http://unmaintained.tech/
    DanaCase
    @DanaCase
    I'm trying to interface with some hardware where order matters. Messages are new line delimited. I tried to read in only one byte at a time (by setting the highWaterMark to 1) and then send my responses once I see a new line. However I noticed that 10 bytes are read in at once when looking at an EZ-Tap serial port sniffer, so my responses are instantly out of order. Is there a way to read in one byte at a time from the level of the port?
    shahzad
    @shahzadc
    test
    Steve Lim
    @SteveLimSY
    Hi, I am trying to open a serial port with none for flow control. I am following the Github and cannot understand why my port.read is just echoing my port.write

    //Start
    port.on('open', function(){
    console.log('Port Opened');
    port.write('ATE1');
    });

    port.on('data', function(data){
    data = data.toString();
    console.log(data);
    });

    thats all im trying to do
    Steve Lim
    @SteveLimSY
    I got it, nothing wrong with the code, it was the device issue
    wrjcs
    @wrjcs
    hello,I can't install serialport on my ubuntu, anyone could help me?
    Sara Mae
    @saramaebee
    hello all
    Jack
    @Jackbennett
    Am I missing something trying to use @serialport/stream and mockbindings because I cannot get the realine parser on'data' to fire at all
    Vercellotti
    @Vercellotti
    I am a new serialport user. I have got it working to send a data stream out. I would like to ask someones help with some example code on how to listen for a response from the other device when I send a string out. Would some kind soul be able to assist me please?
    Frank Lemanschik
    @frank-dspeed
    @Vercellotti this code already should be in the repo :)
    @Vercellotti
    const SerialPort = require('serialport')
    const Readline = require('@serialport/parser-readline')
    const port = new SerialPort('/dev/tty-usbserial1')
    const parser = new Readline()
    port.pipe(parser)
    // Here we wait for data and do console.log
    parser.on('data', console.log)
    // Here we send data and do nothing else
    port.write('ROBOT PLEASE RESPOND\n')
    this example uses the searl port stream interface
    Frank Lemanschik
    @frank-dspeed
    you can see we pipe the port stream which is bidirectional read/ẃrite
    into the parser Stream that is write only
    the parser stream processes the data of the port stream
    Vercellotti
    @Vercellotti
    Many thanks Frank.
    Scott Foster
    @scottosaur_gitlab
    Adding on to @Vercellotti 's question (I'm a bit new to streams): I need be able to keep track of which command I write triggered the response I read. Is pairing each port.write(...) with a corresponding port.once('data',...) function a reasonable way to do this, or is there a more sensible / direct way?
    I also considered having my write commands set a "lastCommandSent" flag and having a port.on("data",...) function that checks the flag before processing the response, but that felt like a bad pattern.
    Juan José Bermúdez
    @juanjo75es
    Hi, I have a problem with the write function on a raspberry using UART port: it doesn't report any error but the execution stops.

    ``` const SerialPort = require('serialport')
    const port = new SerialPort('/dev/ttyAMA0', {
    baudRate: 9600,
    autoOpen: false
    },function(err){
    console.log(err);
    })

    setTimeout(function(){
    port.open(function (err) {
    if (err) {
    return console.log('Error opening port: ', err.message)
    }

    })
    },5000);

    // The open event is always emitted
    port.on('open', function() {
    // open logic
    console.log('opened ')
    var buf = new Buffer([ 0xC1, 0xC1, 0xC1 ]);
    port.write(buf, function(err,n) {
    if (err) {
    return console.log('Error on write: ', err.message)
    }
    console.log('message written')
    })

    }) ```

    AgileDog
    @AgileDog
    @scottosaur_gitlab The way we handle this is to send one command at a time and wait for a response before sending the next command. We send a command and set a timeout that the device must respond within. If we receive a response that makes some kind of sense, then we move on. If the response doesn't make sense or we don't receive a response in a specified amount of time, then we throw an exception. So commands are sent in a serial manner, one at a time and we ensure we get a response. We deal with up to 28 ports simultaneously and keep track of them in an array. We also use sockets to communicate with a browser window, so we can have up to 28 browser windows open simultaneously, talking to 28 ports. We tack the socket ID on to the serial port info so when we get a response, we know which browser window it came from and then gets sent back to. The limitation of 28 ports is not a real limitation but the number of ports we could physically connect to one computer before we ran out of hardware.
    Marko Bregant
    @eMarek
    Hello everyone! I have an electron app which connects via johnny-five to arduino and everything works fine in development. When I package my app with electron-packager and open my app I get this error: Uncaught Exception: /path/to/app/release/Rozi-darwin-x64/Rozi.app/Contents/Resources/app/node_modules/johnny-five/node_modules/serialport/lib/serialport.js:1 Error: Cannot find module 'debug'. Anyone has any idea what am I doing wrong?
    Bryan Hughes
    @nebrius
    @eMarek that typically happens when you have a native module (a.k.a. something written in C++) that was compiled against the wrong version of Node.js. This is very common with Electron, and you'll want to make use of the electron-rebuild module to fix it: https://github.com/electron/electron-rebuild
    usmanakram-ts
    @usmanakram-ts
    Hi there
    i need some help
    with node serial port
    i asked question on stackoverflow
    please help