Reputation: 5115
None of the solutions from this similar problem help: Socat virtual serial port not recognized
I'm creating a virtual serial port using socat and then linking it properly, but node-serialport is not picking it up.
$ sudo socat -d -d pty,raw,echo=0,link=/dev/ttyS10 pty,raw,echo=0,link=/dev/ttyS11
2015/09/01 01:36:44 socat[22927] N PTY is /dev/pts/9
2015/09/01 01:36:44 socat[22927] N PTY is /dev/pts/10
2015/09/01 01:36:44 socat[22927] N starting data transfer loop with FDs [3,3] and [5,5]
In node using node-serialport:
$ cat test.js
var serialPort = require("serialport");
serialPort.list(function (err, ports) {
if (err) {
console.log(err);
return;
}
ports.forEach(function(port) {
console.log(port.comName);
console.log(port.pnpId);
console.log(port.manufacturer);
});
});
$ node test.js
{ [Error: ENOENT, scandir '/dev/serial/by-id'] errno: -2, code: 'ENOENT', path: '/dev/serial/by-id' }
You'll notice that no serial port is being picked up. What can I do to be able to list this port?
Upvotes: 1
Views: 510