node-serialport

Can't get hidraw0 device to open in nodeJS app

隐身守侯 提交于 2021-01-29 14:48:04
问题 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 identified that the path is /dev/hidraw0 as this is what I was able to ascertain from a dmesg output. When I run cat /dev/hidraw0 it opens and when I scan a barcode it outputs %""'#''!'&" to the console (I know it's gibberish, but different problem for a different day) . BUT, when I reference this

Custom parser for node-serialport?

我怕爱的太早我们不能终老 提交于 2021-01-27 20:05:36
问题 With incomming data like STX(0x02)..Data..ETX(0x03) I can process data by byte sequence parser : var SerialPort = require('serialport'); var port = new SerialPort('/dev/tty-usbserial1', { parser: SerialPort.parsers.byteDelimiter([3]) }); port.on('data', function (data) { console.log('Data: ' + data); }); But my actual incomming data is STX(0x02)..Data..ETX(0x03)..XX(plus 2 characters to validate data) How can I get appropriate data? Thanks! 回答1: Since version 2 or 3 of node-serialport,

Read/Write data returns null - Unable to perform any operations - node serialport

耗尽温柔 提交于 2020-05-17 07:04:45
问题 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 application is a desktop application using electron. const SerialPort = require('serialport') const Readline = require('@serialport/parser-readline') const parser = new Readline() const port = new SerialPort("COM4", { baudRate: 9600 }) This is the code I have used and port.read() always returns

Can't install node-serialport on linux

↘锁芯ラ 提交于 2020-01-25 10:58:08
问题 I am trying to install node-serialport package using: nmp install serialport But unfortunately its not working, the version os nodejs installed in 10.0.0-1. Following is the error message I get: [user@home ~]$ npm install serialport npm http GET https://registry.npmjs.org/serialport npm http 304 https://registry.npmjs.org/serialport npm http GET https://registry.npmjs.org/sf/0.1.3 npm http GET https://registry.npmjs.org/optimist npm http GET https://registry.npmjs.org/node-gyp/0.6.2 npm http

NodeJS using node-serialport sometimes becomes unresponsive

那年仲夏 提交于 2020-01-24 17:05:40
问题 I'm using NodeJS to connect a barcode scanner to a web front-end. The barcode scanner's serial port runs to the PC (Windows7 pro x64) through a usb-to-serial converter. I'm using node-serialport. This setup is running at an installation in a museum. The computers reboot daily and sometimes the barcode scanner will work fine the whole day, but about 25% of the time it will stop working throughout the day. With stop working I mean that NodeJS isn't relaying the incoming serial stream anymore.

NodeJS using node-serialport sometimes becomes unresponsive

烈酒焚心 提交于 2020-01-24 17:04:55
问题 I'm using NodeJS to connect a barcode scanner to a web front-end. The barcode scanner's serial port runs to the PC (Windows7 pro x64) through a usb-to-serial converter. I'm using node-serialport. This setup is running at an installation in a museum. The computers reboot daily and sometimes the barcode scanner will work fine the whole day, but about 25% of the time it will stop working throughout the day. With stop working I mean that NodeJS isn't relaying the incoming serial stream anymore.

node-serialport only communicates with Arduino if another app has already connected to the port

蹲街弑〆低调 提交于 2020-01-17 01:39:06
问题 Running on node in OS X, I am trying to use node-serialport to talk to an Arduino. All communication to the Arduino works as expected when using Arduino IDE's Serial Monitor, or the OS X utility SerialTools. However, when just running my node app, node-serialport tells me the connection is successful, but I get no communication. If I first make a connection to the arduino with Arduino IDE's Serial Monitor or SerialPorts, then run my node app, the node app sends and receives data just fine

electron串口通讯

冷暖自知 提交于 2020-01-07 12:10:45
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1、已管理员身份安装 windows-build-tools npm install --global windows-build-tools 2、安装 node-serialport npm install serialport 3、重新编译项目 .\node_modules\.bin\electron-rebuild.cmd 来源: oschina 链接: https://my.oschina.net/u/2262481/blog/3154282

How to execute node function using html button

孤街浪徒 提交于 2019-12-25 08:41:23
问题 I'm new at nodejs and I want to write to a serial port using node but now I want it to be triggered by a button. And the data is coming from a textbox. My node script is doing fine when I run it in the console/terminal. But can't do it with a button in a webpage. Here's my nodejs embedded in html <!DOCTYPE html> <html> <head> <title>Node x HTML</title> </head> <body> <script> function write_serial() { var serialport = require("serialport"); var SerialPort = serialport.SerialPort; var sp = new

node-serialport failing on alpine linux

☆樱花仙子☆ 提交于 2019-12-12 09:38:10
问题 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 600MB. Then I switched to alpine linux https://hub.docker.com/_/alpine/ and achieved 100MB of image size. However the nodejs project stopped working with alpine as base image. Here are some logs: Install node-serialport log: > serialport@2.0.6