Serial port communication using Node.js
-
I can not make the serial communication using NodeJS work. Is there any success story about getting the serial comms on Omega using NodeJS?
I tried both serialport and much less popular serialport-js packages, but couldn't get to working condition.
The Omega is connected to Arduino using TX and RX pins, and I know there's no problem with the Arduino end, as the tests using Python are working fine. I just can't get anything working under NodeJS.
-
Are you able to import the serialport package into your script?
-
No, haven't succeeded.
-
I am running into this issue as well - the prebuilt SerialPort Module for MIPS does not exist. And I am still trying to figure out how to get the module to compile....
-
Did you try
opkg install node-usb
?I tried this one but doesnt seem to get past
require('usb')
, cant find the files on the filesystem either, npm cant see them and they are not in/usr/bin
.I too would love it if there was an
opkg
package for npm'sserialport
, even if its an older version of the same.
-
@Steven-de-Salas said in Serial port communication using Node.js:
Did you try
opkg install node-usb
?That doesn't seem like it would help, as a USB serial converter isn't a "USB" device from an application perspective, but rather a "serial" one.
-
Hi guys, I just thought you'd like to know that I got
serialport
npm module cross compiled for the Omega2 following instructions here and here.I will try get a more easily consumable version (maybe another npm package?) but for now feel free to download a working version of serialport@3.0.0 on the following link:
https://github.com/sdesalas/robotics/raw/master/omega2/node-serialport-v3.0.0.tar.gz
You just need to untar and move the
node_modules/serialport
andnode_modules/.bin
folders tonode_modules
in your project or global npm folder.
Even better:
Here is a fork containing the cross-compiled binaries:
https://github.com/sdesalas/node-serialport-omega2
Since its in github you can install via npm:
$ npm install github:sdesalas/node-serialport-omega2
Cherio.
S
-
This post is deleted!
-
Steven I am a bit confused on how to install your cross compiled port. Do I have to rebuild it on the Onion for it to work? The files are quite large and I would need an SD card. Is there a way to copy the node rather than building it? Let me know what I am doing wrong.
Thanks