Questions tagged [node-serialport]

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

This library is the at the core of johnny-five and node-firmata. Help can also be found on it's github issues page.

211 questions
10
votes
4 answers

Serial port not working?

I made a program that sends out data to my arduino which detects what was sent and then turns on the correct pin according to what key is pressed. When using the arduino software from my windows computer the arduino sketch works fine, I can make…
Ryan Walmsley
  • 369
  • 1
  • 4
  • 18
8
votes
3 answers

Cannot Display two String Array Esp8266 on data parser nodejs

I have data measured from ESP8266 which I store in a string array, and I display to my JavaScript HTML using Node.js, but I just get data as one array not as two array. My Arduino code: ... int temp1, hum1, temp2, hum2; ... void…
8
votes
2 answers

node-serialport failing on alpine linux

I am working on a small nodejs (nodejs v4.3) project that is using node-serialport https://github.com/voodootikigod/node-serialport. I wrapped it in a docker image. First I successfully used debian as a base image but it had a total size of about…
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
7
votes
1 answer

SerialPort 'close' event never fire

I'm using nodeJS's SerialPort Package for connecting to computer ports. About Package's close event here. I have created this code, I would like to know why close/disconnect event never fire when I disconnect the COM const express =…
Itzik.B
  • 1,023
  • 2
  • 15
  • 35
5
votes
4 answers

Using Node.js addons in Electron's renderer with Webpack

I have the following renderer: import SerialPort from "serialport"; new SerialPort("/dev/tty-usbserial1", { baudRate: 57600 }); It's built by Webpack, with the following config (trimmed for brevity): const config = { entry: { renderer:…
Alec Mev
  • 4,663
  • 4
  • 30
  • 44
5
votes
4 answers

How to convert incoming buffer data from serial port to nodejs

hello I'am using Arduino and node js I sent and recive data but the data incoming from arduino like this : How can i decode this to UTF8 arduino int…
SAMSOL
  • 90
  • 2
  • 8
5
votes
0 answers

node.js serialport doesn't open port on Windows

var SerialPort = require("serialport"); var port = new SerialPort("COM5"); port.on('open', function() { port.write('main screen turn on', function(err) { if (err) { return console.log('Error on write: ', err.message); } …
5
votes
2 answers

Exposing a TTY device in a docker container with docker for mac

I'm trying to expose an Arduino that's plugged into my mac to a linux instance I'm running in Docker for Mac (no vm). The Arduino exposes itself as /dev/tty.usbserialXXX. I'm using the node docker image which is based upon ubuntu. The command I'm…
reconbot
  • 5,138
  • 6
  • 45
  • 63
5
votes
2 answers

nodejs serialport write issues?

I am using the nodejs serialport module (https://npmjs.org/package/serialport) and I am having issues when I write to the serial port. If I simply write to the port as shown below, the serial device never gets the command. var serialport =…
io2work
  • 61
  • 1
  • 6
4
votes
3 answers

SerialPort lib - "parsers.readline is not a function" Error - NodeJS

I have copied this code: var serialport =require("serialport"); var SerialPort = serialport.SerialPort; var portName = process.argv[2]; var myPort = new SerialPort(portName,{ baudRate: 9600, …
Itzik.B
  • 1,023
  • 2
  • 15
  • 35
4
votes
1 answer

Unable to close serial port in nodejs

I'm using node-serialport available here. Open the port and reading works very well, however I am unable to close the port. I use the following code for that: myserialport.on('close', function (err) { console.log('port closed', err); }); The…
user3358452
  • 77
  • 1
  • 1
  • 5
4
votes
1 answer

SerialPort has no method 'list'

I have a very simple script to just the available serial ports and then connect to one, write a char and put the response on the console. CODE HERE In my scripts directory I did: #npm install serialport #npm list …
uMinded
  • 595
  • 1
  • 9
  • 21
3
votes
2 answers

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 I couldn't find a way to do that. Only one thing…
3
votes
0 answers

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 following: Node 13.2.0 serialport…
3
votes
4 answers

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: Cannot read property 'indexOf' of undefined at…
Fabian Deitelhoff
  • 712
  • 1
  • 7
  • 23
1
2 3
14 15