Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
How can I setting Dynamic Serialport parameters? NodeJS

I'm using Node.js serialport for electron in raspberrypi4 https://serialport.io/docs/ but I can't setting Dynamic parameters for serialport

Here is my code

var portname, baudrate, databits, stopbits, Parity, RTSCTS;
    var portOpen = false;

    const port = new serialport('COM4', {
        baudRate: baudrate,
        dataBits: databits,
        stopBits: stopbits,
        parity: Parity,
        rtscts: RTSCTS,
        autoOpen: false,
    })
    // take parameters value in other page
    function getSerial() {
        const serialdata = localStorage.getItem('serialdata');
        const data = JSON.parse(serialdata);
        portname = data.portName;
        baudrate = parseInt(data.baudRate);
        databits = parseInt(data.dataBits);
        stopbits = parseInt(data.stopBits);
        Parity = data.parity;
        RTSCTS = data.RTSCTS;
}

This code is error in electron "TypeError: "baudRate" must be a number: undefined at new SerialPort"

Baudrate is using port.update() for dynamic parameter, but other things is not available. Please help me

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!