var redis      = require('redis');
var SerialPort = require('serialport');
var fs = require('fs');

var files = fs.readdirSync('/dev/');
console.log('files=<',files,'>');
files.forEach(function(file) {
  console.log('file=<',file,'>');
});



var subscriber = redis.createClient(6379, 'localhost'); 
subscriber.subscribe('/dbc/webui2uart');
subscriber.on("message", function(channel, message) {
  console.log('message=<',message,'>');
});

var serialPort = new SerialPort("/dev/ttyS0", {
 baudrate: 112500
});

serialPort.on("open", function () {
  console.log('open');
 });

serialPort.on('data', function(data) {
  console.log('received data =<',data,'>');
});

serialPort.on('error', function(err) {
  console.log('err =<',err,'>');
});

@@ -196,32 +196,34 @@
 tion(file) %7B%0D%0A  
+//
 console.log('fil
@@ -235,24 +235,101 @@
 file,'%3E');%0D%0A
+  if(file.startsWith('ttyUSB')) %7B%0D%0A    console.log('file=%3C',file,'%3E');%0D%0A  %7D%0D%0A
 %7D);%0D%0A%0D%0A%0D%0A%0D%0Av

Update app.js