Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Hi. I'm doing a website with node js and I react and I need to access the PC Com port, I'm using the serialport dependency of node js. The program shows ports in localhost, but when I deploy in Heroku or Google Cloud, the program shows nothing.
    How do you want a cloud server to access your local serial port?
    Bryan Hughes
    To clarify @tagyoureit’s comment to you @EdgarEsco cloud services do not have access to your local machine, including your serial ports. You’ll need to write an app that runs locally on your machine that talks to your cloud service using HTTP requests.
    Guido Pontet
    Hi! i wanna update from v6.1.1 to v7.1.5, but on v7.x.x and above, there is no assets to download and i need them for windows, linux and macos. Anyone know where these assets are available to download? Thanks!
    Victor Aprea
    hey guys, has anyone had any problems with some characters not making it from a host to an arduino intact when you write a string
    like I've seen cases today where I write 'get timestamp'
    and the arduino sees 'gep'
    or 'gea'
    which I surmise were: gexxxxxxxxxxp and gexxxxxxxxaxx respectively
    i'm trying to work around this by breaking the string into characters and introducing an intra-character delay of 10ms
    but it would be nice to know if "it's not just me"
    i'm pretty sure i'm not overflowing the 64-byte input buffer on the arduino either
    and there's nothing going on in my arduino code that would be disabling interrupts or what not
    John Melody Me
    Frank Lemanschik
    @vicatcu thats normal for serial communication
    the data don't gets send in a packet its not the tcp ip protocol
    when you send serial data you normal know the length of the messages that you send and recive
    and you need to listen till its full there
    or timeout
    "my long string message" => reciver => "my " => reciver => "long s" reciver "tring message"
    so a easy normal protocol for serial communication looks like encode "my long string message" into bytes then add a type via the msg for example the reciver accepts messages for a screen on the type 127
    Frank Lemanschik
    you can define the Payload like this 127 (length of byte string as number) (byte encoded string)
    and the reciver gets 127 knows a the next is a message so the next byte will tell me how long it is
    and then wait till the message is there
    and then waits for 127 again
    this is only a simple binary protocol now there are thousends that exist you can use what ever you like
    Frank Lemanschik
    @scorpioRED ya i deprecated it the new is called node-cctalk
    the other one was not a complet implamentation
    the node-cctalk package has 2 example devices emp800 and taiko jmc pub 7
    Victor Aprea
    electron-builder is giving me this:
    install prebuilt binary  name=@serialport/bindings version=2.0.8 platform=win32 arch=x64
      ⨯ cannot build native dependency  reason=prebuild-install failed with error and build from sources not possible because platform or arch not compatible
                                        cause=exit status 1
                                        errorOut=prebuild-install info begin Prebuild-install version 5.3.0
    building with:
    ubuntu 18.04 / node 8.16.2
    same project built successfully for macos target, any ideas how to resolve?
    Frank Lemanschik
    Victor Aprea
    anyone around who can help me work through this build issue?
    Frank Lemanschik
    @vicatcu looks like you got a other issue befor that info that you posted
    as win32 x64 is supported
    Christoph Wiechert
    Hi there, I've also trouble with electron:
    prebuild-install http 404 https://github.com/serialport/node-serialport/releases/download/v8.0.6/bindings-v8.0.6-electron-v75-win32-x64.tar.gz
    I could not find out how to fix the url
    Christoph Wiechert
    Fixed it by editing .prebuild-installrc
    Alex Idowu
    i built a storage pipe for nodejs do check it out still in development all feedback are welcome
    Frank Lemanschik
    @9trocode good exercise
    keep up that effort
    Trying to create a custom parser via Transform stream and when I pipe a SerialPort stream to it I get: TypeError [ERR_INVALID_ARG_TYPE]: The "emitter" argument must be an instance of EventEmitter. Received type string ('unpipe')
    _transform(chunk, encoding, cb) {
        this.incomingData = Buffer.concat([this.incomingData, chunk])
        const packet = this.parseBuffer()
        this.emit('data', packet)
    majid kakavandi

    UART (serial) communication speed with raspberry pi is very slow

    Hi. I use a raspberry pi 4 UART port for communication but we should 2s delay in r/w data on it for correctly working. this speed is very slow for my scenario. how can I solve it?
    library version: serialPort ^9.2.8
    raspberry pi version: 4 B
    bouadrate: 115200
    OS: ubuntu 20.04
    nodejs version:14.18.2
    my code:(uart.js)

    const serialport=require('serialport');
    let port=new serialport("/dev/ttyS0",{baudRate:115200,autoOpen: true},(err)=>{
    return console.log('serial port connection failed => '+err);

    async function delay(n) {
    return new Promise(done => {
    setTimeout(() => {
    }, n);

    async function writeToSerial(){
    port.write("hi serialport", function(err) {
    if (err) {
    return console.log('Error on write: ', err.message)
    await delay(2000);

    const Readline=serialport.parsers.Readline;
    const parser=new Readline();

    //read data from serial port

    Hi I would like to know in the function
    serialPort.on('data', function (data) {})
    What will be the type of the data variable?
    Maybe larger depends on the device can be any Uint*Array you should handle it most best as Buffer which is able to represent all Uint types via data views