Questions tagged [node-serialport]

a Node.js library for talking to serialports across all major platforms.

Filter by
Sorted by
Tagged with
0 votes
0 answers
54 views

Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'ReadLine')

When launching the app.js, there is an error written above, here is an example of the code const SerialPort = require('serialport'); const Readline = SerialPort.parsers.ReadLine; const port = new ...
mr. chaplin's user avatar
0 votes
0 answers
104 views

"Error: Cannot find module 'serialport'" in build with cordova-electron and serialport.io

Problem Hello, my problem is when I include the library SerialPort.io in my cordova-electron projet, build crashe on windows 10 , window 11 and Ubuntu 22.04. What is expected to happen? Build launch ...
laux98's user avatar
  • 51
0 votes
0 answers
33 views

I need to get a list of com ports and then listen to each one

There is a code that should get a list of COM ports, and then go through each port and get the value returned by the device connected to the port let portsPathes = []; SerialPort.SerialPort.list()....
Qivorch Velix's user avatar
0 votes
0 answers
36 views

Nodejs Serialport get Path From SerialNumber or PNPID

Im trying to make Serialport automatically find the Port depending on a set Serialnumber. Cant really figure out a simple Solution, everythign would involve wrapping everything in 20 Async await's. ...
Ys Ys's user avatar
  • 1
0 votes
0 answers
96 views

Can't start electron on Raspberry Pi OS - Error: No native build was found

Overview: I wrote an electron app (modbus power meter) in Windows that uses npm packages modbus-serial & onoff. In Windows I would just use the serial modbus, but on a Raspberry Pi 4, I'd also ...
jhoybs's user avatar
  • 1
1 vote
2 answers
639 views

Nodejs serialport error when trying to open port

Here is environment details: package.json "serialport": "^11.0.0" node -v v18.16.0 npm -v 9.5.1 index.js const {SerialPort} = require('serialport'); const port = new SerialPort({ ...
Amin's user avatar
  • 691
0 votes
1 answer
644 views

Unable to install serialport library from npm

I face the following error while trying to install serialport library from NPM $ npm i serialport > @serialport/[email protected] install /home/amin/Node/serial-port/node_modules/@serialport/...
Amin's user avatar
  • 691
0 votes
0 answers
45 views

How to lights the rgb led strip using node-hid?

I am trying to access the HID(Human interface devices) using node-hid npm in node. i want to start the light when my node app is run. But when i pass the data it is not working. i want to start the ...
selenagomez's user avatar
-2 votes
1 answer
38 views

What does "timeouts are used to physically disconnected by the device" in serial (RS232) communications?

I'm implementing serial protocol that states that after sending a particular byte, the emitter must wait X seconds to receive a response and if no response is received within the specified time, ...
Lothre1's user avatar
  • 3,583
0 votes
0 answers
86 views

NodeJS SerialPort 'The parameter is incorrect' with FTDI Chip

I am trying to set up a USB test using an FTDI chip UMFT234XD-WE, Using node-serialport I'm simply trying to open the port in a test script and write an array of data through the chip to another ...
TakenTheBacon's user avatar
1 vote
2 answers
2k views

SerialPort.list is not a function

I tried to create an array of port, to which serial devices are connected using the serialport module of nodeJS. I used the following code, which should in theory work I think: var getPortsList = (...
Ninto 1's user avatar
  • 67
0 votes
0 answers
47 views

Regarding serial port data transmitting issue from device to application

we are using serial port device for sending and receiving data from this device to application, everything is going on perfect, but when we setting up wrong setting in device as well as in application ...
Amit Kumar's user avatar
2 votes
1 answer
612 views

serialport in Electron forge (+webpack) renderer fails to load bindings?

I'm having an issue getting the serialport package to work in Electron Forge + Webpack in the renderer: Using electron forge CLI, I made a brand new project: npm init electron-app@latest my-new-app -- ...
Joe Jankowiak's user avatar
0 votes
1 answer
337 views

when using serialport in Node.js I need to parse every byte without using a delimiter

I have a legacy device from which I need to receive serial data and it does not send a delimiter. Therefore I need to send every byte I receive to a function. My code is written in Javascript and I ...
faithaurora's user avatar
1 vote
0 answers
293 views

Error: Cannot find module 'serialport' Johnny-five node package

My code is this const { Board, Led } = require("johnny-five"); const board = new Board(); board.on("ready", () =\> { // Create an Led on pin 13 const led = new Led(13); // ...
Dawit Mengistu's user avatar
0 votes
1 answer
482 views

TypeError: "path" is not defined: undefined NodeJS Serialport return function

Hello i am trying to check the usb ports for detecting arduino usb port. So here is my function detectArdu() { detector.list().then(ports => { ports.forEach(function(port) { ...
baran cihan's user avatar
0 votes
1 answer
593 views

node-gyp serialport build error on Raspberry Pi 4

I have a nodejs electron app running on a Raspberry Pi 4. The latest raspberry pi OS will not build the application (and older OS versions will not run on the latest hardware.) I fairly sure this ...
fingerskier's user avatar
0 votes
2 answers
1k views

Webpack not including module with Electron Forge and SerialPort

I'm using the electron-forge webpack template. Had some issues but got serialport working. But now when I run make to export the app, if I don't copy the node_modules folder to the exported webpack ...
Rafael Gritti's user avatar
1 vote
0 answers
283 views

How to solve the problem of the integration @SerialPort library in electron project

I need to integrate the @serialport library in my electron project but I face this error. Uncaught Error: Loading non-context-aware native module in renderer: '\?\C:\Users\PC\Desktop\...
souhir zribi's user avatar
0 votes
1 answer
120 views

I want to get mfrc522 readed data from ardiuno to my nodejs server using javascrip so can anybody know how to do it

I have ardiuno in which i have connected mfrc522 rfid reader , so i want the data which rc522 have readed from ardiuno. I have tried using have tried it using sketch which is written in cpp but i want ...
user avatar
3 votes
2 answers
2k views

Node JS SerialPort How can i change parameters in port?

I'm using node.js SerialPort in electron for raspberry pi 4. https://serialport.io/docs/guide-cli#serialport-terminal I wanna change parameters portname, dataBits, stopBits, parity etc... in port. But ...
버티면할수있다's user avatar
0 votes
1 answer
313 views

how to handle express js errors properly?

i have implemented a very minimalistic backend service using expressjs and socket.io to transfer serial data readings from an arduino to a react front end. i use SerialPort package to achieve this. my ...
Ushan Fernando's user avatar
0 votes
1 answer
376 views

How to access the local machine's serial port (USB) data from Heroku application?

I have a node express application it use Node-Serialport library . which is deployed in Heroku cloud platform. When it is running on localhost, then it is working perfectly. When I deploy in Heroku ...
Pachi's user avatar
  • 1
1 vote
1 answer
831 views

NodeJS – Serialport Readline issue

after my first question (NodeJS and Serialport – Read RFID Card) I figured out a way to get the correct data. But now my result is the following: data received: data received: 0 data received: > ...
mrclbls's user avatar
  • 45
1 vote
0 answers
991 views

Node: serialport: Error: Could not locate the bindings file

I'm trying the serialport package to communicate with an Arduino, but I can't seem to resolve an error that I'm having with my install of serialport. I am running Windows 11 (21H2 22000.194) Error log:...
Brad's user avatar
  • 23
0 votes
0 answers
479 views

SerialPort.list() return empty array

Does anyone have any idea why this (below) code return an empty array on windows ? const SerialPort = require('serialport') SerialPort.list() .then((ports) => { console.log(ports, "s&...
Rohan Mittal's user avatar
0 votes
0 answers
704 views

Node serial port write error [Error: Writing to COM port (WriteFileEx): Invalid handle] error occoured while write second time

Iam trying to write in EDC using node serial port when i start and write first time it is success but the second try its return the error and 3rd try success same behaviour continuing Error: [Error: ...
Vimal P's user avatar
0 votes
1 answer
684 views

Writing and reading data between two nodejs servers using node serial port

I would like to send "Hello world" from one nodejs server to another using node-serialport. I have verified that the radios connecting the two are connected and sending info because they ...
codes's user avatar
  • 31
0 votes
1 answer
197 views

Using node.js to recognize when Arduino Micro is plugged into USB

First off, I'm new to both node.js and the concept of async functions and would greatly appreciate any help I can get here. I've been trying to write a script using the node.js serialport module to ...
John Rippon's user avatar
0 votes
1 answer
351 views

Error: Open (GetCommState) : Unknown error code 1 - Nodejs, express, SerialPort

I am trying to connect a fiscal printer that has serial input to nodejs. I'm using the SerialPort module, but I can't make the connection, since the console gives me the following error: "Error: ...
Raymonda Medina's user avatar
0 votes
0 answers
952 views

Error: Opening COM: file not found - Nodejs, express, serialPort

I am trying to connect from nodejs to a fiscal printer that is connected by serial input and it gives me an error. I am using the serialPort module and I am following the steps in the documentation ...
Raymonda Medina's user avatar
0 votes
1 answer
262 views

Reusing a SerialPort object in NodeJS

I'm using the node js serialport package (https://serialport.io/docs/). I create the following serial port object : var port = new SerialPort(data.device.hostPort, { baudRate: 115200, ...
dcadavez66's user avatar
0 votes
2 answers
140 views

Unable to add elements in array

I am trying to adding the available ports on my pc for serial communication between Arduino and the computer. I have created portsList as an array variable and I am pushing those ports in that ...
Ravi Shah's user avatar
0 votes
0 answers
21 views

Change Order of execution : Javascript [duplicate]

Here is the code. commLib.commBegin = function (data) { var returnValue port.open(error => { if (error) { returnValue = [data[0], 'error', error] console....
Teddy Bang's user avatar
0 votes
1 answer
448 views

NodeJS SerialPort Write Format

I am building a prototype automated testing tool for the company I work for that uses a SMAC Controller to move an item in front of a laser micrometer to be measured. I am using the NodeJS SerialPort ...
Justin's user avatar
  • 524
0 votes
1 answer
249 views

What are the definitive Electron/npm steps to rebuild Node serialport?

Until recently, the guidance described in Node - was compiled against a different Node.js version using NODE_MODULE_VERSION 51 has succeeded to overcome the following 'npm start run' failure: App ...
puzzler's user avatar
  • 51
0 votes
1 answer
669 views

Cannot read property 'modules' of undefined at /node_modules/bindings/bindings.js with electron and install serialport

1. npm install -g node-gyp 2. npm install serialport -S 3. npm install electron-rebuild -D 4. ./node_modules/.bin/electron-rebuild.cmd and then, rebuild complete. And when I run this command: npm ...
user15280394's user avatar
1 vote
0 answers
327 views

Module not found in React - serialport error

Hi everyone six month ago I was working designing a UI interface in a We development App with React. This was working fine, but now I run npm start and it show me a lot of errors. I'm trying to load a ...
Eduardo Ortiz's user avatar
1 vote
1 answer
89 views

node-serialport combine chunks of JSON

I have a Raspberry PI connected to an ESP32 controller by serial port I was able to read the data received from the serial (controller sends large JSON as multiple chunks) serial = new SerialPort( ...
Woof's user avatar
  • 1,217
1 vote
1 answer
827 views

How to serial write multiple data to Arduino using NodeJS serialport

I am trying to write multiple data using the same port but I can not do it. But node-serialport provides multiple data read function at the same time. How I write multiple data at the same time This ...
user avatar
1 vote
1 answer
1k views

Nodejs serial port to tcp

Is there a way to establish a host to stream a serial connection over tcp using nodejs - I want to stream the sensor data from the iot device on my computer to a connected computer to a web server. ...
rcpilotp51's user avatar
0 votes
1 answer
941 views

Nodejs how to access SerialPort path on 'data' event

I am using the SerialPort library in nodejs to list the available ports, and send data to each of them. If any of them return "OK", I would like to find out which is the port that returns it:...
Jay's user avatar
  • 161
0 votes
1 answer
3k views

Send message and wait for response in node serialport

I have a device which connects to computer via USB using serial interface. I can properly "talk" to it using npm-serialport with the following code: const SerialPort = require('serialport'); ...
heltonbiker's user avatar
  • 26.9k
0 votes
0 answers
239 views

node package serialport gives garbage output

I'm using this package: https://www.npmjs.com/package/serialport for reading serial data from /dev/ttyUSB0 while running my script i'm getting some data but it's incorrect. To start. When I'm doing: ...
Almer's user avatar
  • 33
1 vote
1 answer
2k views

Error in detecting serial port path automatically

I am new to node-serialport and having some issues in detecting serial port automatically. Below is my code, var serialport = require('serialport'); var portName = " "; Code for detect ...
Mitesh Dube's user avatar
2 votes
1 answer
311 views

Declaring a new SerialPort as a variable doesn't allow me to read data? SerialPort node js

What am I trying to do? For my electron project I am trying to declare my port as a variable so that the path can be changed by the user if necessary. (Need this functionality) I did see the port....
staghaoussi's user avatar
0 votes
1 answer
1k views

Sending bytes with SerialPort Nodejs

I need to send a command to a inverter, which is hooked up to my computer on a COM port. The command needs to be sent in bytes, and I need to get the response too, but I can't seem to figure out how ...
kylebotha's user avatar
3 votes
0 answers
1k views

Electron-Builder installing wrong prebuild for native dependency (serialport)

I've been trying to integrate the serialport npm module into an electron application. I have it imported into my main process and have kept it as an external in my webpack configuration. I'm using the ...
Dardin-dale's user avatar
0 votes
0 answers
140 views

tfmini-plus checksum error on raspberry pi

I had initiated an example for TFMiniplus on Pi - 3. I have installed the tfmnini-plus, serialport, and @serialport/bindings and I have been using the following code: const tfminiplus = require('...
friedFingers's user avatar
2 votes
1 answer
1k views

How to use `serialport` library with `deno`?

while experimenting with deno to get readings from arduino, i got stuck on proper usage of serialport lib. i tried the following: according to an article packages from pika.dev can be used. but from ...
bugrasan's user avatar
  • 397

1
2 3 4 5