Questions tagged [node-serialport]
a Node.js library for talking to serialports across all major platforms.
201
questions
0
votes
0
answers
11
views
NodeJS - SerialPort - Issue with writing and reading multiple times
i want to build an node-red node, which should talk to an sensor over serialport (RS485).
Here i am using the serialport library for nodejs.
But before i can put the code in the node-red node, i ...
0
votes
0
answers
27
views
Serialport Uncaught (in promise) Error: Opening COM31: Access denied error
I want to send data from serialport for my electron project and I am getting such an error, how can I solve it?
const serialport = require("serialport");
const sport = new serialport....
0
votes
0
answers
37
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 ...
1
vote
0
answers
26
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\...
0
votes
0
answers
14
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 ...
1
vote
1
answer
182
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 ...
0
votes
1
answer
83
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 ...
0
votes
0
answers
25
views
Unable to Resolve Module child_process in Expo App
I'm trying to create a phone app with React and Nodejs that uses an xbee device for communication. In order to connect to the xbee device, I'm using the serialport module that I got from npm. Whenever ...
0
votes
0
answers
17
views
node js how to emmit serialport response to multiple files
I connected Raspberry Pi Zero to CO2 sensor and receive data. I made two file one with serialport connection and second with mysql connection, I want when dbconnect.js calls for data serialport.js ...
0
votes
1
answer
62
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 ...
1
vote
1
answer
154
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: >
...
1
vote
0
answers
344
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:...
0
votes
0
answers
160
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&...
0
votes
0
answers
284
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: ...
0
votes
1
answer
344
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 ...
0
votes
1
answer
62
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 ...
0
votes
1
answer
87
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: ...
0
votes
0
answers
291
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 ...
0
votes
1
answer
151
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, ...
0
votes
2
answers
72
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 ...
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....
0
votes
1
answer
46
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 ...
0
votes
1
answer
175
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 ...
0
votes
1
answer
375
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 ...
0
votes
0
answers
113
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 ...
1
vote
1
answer
35
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(
...
1
vote
1
answer
363
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 ...
1
vote
1
answer
419
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. ...
0
votes
1
answer
377
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:...
0
votes
1
answer
1k
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');
...
0
votes
0
answers
130
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:
...
1
vote
1
answer
567
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 ...
2
votes
0
answers
105
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....
0
votes
1
answer
442
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 ...
3
votes
0
answers
935
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 ...
0
votes
0
answers
86
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('...
2
votes
1
answer
714
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 ...
3
votes
3
answers
1k
views
Quasar Framework, Electron, and Serialport: indexOf Error
I'm setting up a test project with Quasar, Electron, and serialport. When starting the application with a minimal serialport test, I get the following error:
vue-router.esm.js?85f8:2128 TypeError: ...
1
vote
1
answer
972
views
Mac node serial-port not detecting connected USB device
I am using node serialport library in my Simple node console application.
I Installed the required driver for the USB Dongle and seems like its not getting detected.
But when i checked the mac i can ...
0
votes
1
answer
665
views
Read/Write data returns null - Unable to perform any operations - node serialport
I am working with serialport for the first time and trying to establish a read and write connection with an UART device which is a controller of a height adjustment desk by using the below method. The ...
1
vote
0
answers
396
views
FTDI driven USB to RS485 requires a undocumented timeout after write?
I am developing a controller for Mobitec Bus destination panel. The intended communication layer is SBC -> USB 2 RS485 [FTDI] -> Mobitec.
This is also the first time for me working with serial and ...
2
votes
2
answers
56
views
How do i use function if i need to define it later?
So, I'm using node.js, express and serialport. What I need to do is to let user pick serial port which listens to, initialize it by using AJAX request and, hopefully, get some data from serial port.
...
1
vote
1
answer
86
views
How can I access the variables outside this function in node serialport library? [duplicate]
I hope you are well,
Is there any way to access the values outside the function?
My code is
const SerialPort = require("serialport");
const Readline = require("@serialport/parser-readline");
const ...
2
votes
1
answer
419
views
What does dataBits option do in the node-serialport Serialport contructor?
I am using the node-serialport package, and I came across the set of options available to be passed to the constructor of a SerialPort. One of them is called dataBits. The only thing I can find in the ...
0
votes
1
answer
179
views
How to auto detect /dev/ttyUSBx port using nodejs and use that port for reading and writing the data?
I have tried to install udev node module but getting error while installing that.
npm install udev
Followed this link udev
Error:
npm WARN enoent ENOENT: no such file or directory, open '/home/...
1
vote
1
answer
118
views
Getting error while installing udev module in node js
I'm runnig command :
npm install udev
And I'm getting this error:
npm WARN enoent ENOENT: no such file or directory, open '/home/mitesh/package.json'
npm WARN mitesh No description
npm WARN ...
0
votes
1
answer
428
views
Can't get hidraw0 device to open in nodeJS app
Good evening!
I'm trying to setup a barcode scanner app using the Node SerialPort package, used on a Raspberry Pi 4, and I'm having a hard time getting the code to either recognise the device
I've ...
0
votes
0
answers
169
views
Hard Reset ESP32 via NodeJS Application with serialport package
Is there a way to hard reset ESP32 from nodeJs application using their serialport package.
While uploading the code to ESP32, there comes a statement at the end. Hard Resetting via RTS pin. Can we do ...
0
votes
1
answer
1k
views
SyntaxError: Unexpected token ... in serialport in node_modules
I hav been trying to run the vue-electron app. But the following error comes.
App threw an error during load
C:\newFolder02\pos4-desktop\node_modules\@serialport\stream\lib\index.js:103
...