title: Reading in Multiple Serial Inputs with Node.Js
body: <p>I have been working on a simple script to monitor 6 arduino units in my lab. I seem to have almost got it! </p>
  
  <p>My current issue is getting each dataset nicely bundled all in one string. as it is, I am able to open a connection with all the serial ports, recieve their data, as they spew it out, but lack the code block to organize it into the bundles. I have considered attempting to make a temporary array to append the chunks to, or produce child processes. However, I have had difficulties with child processes, and am not sure how to structure an array in an appropriate way. Once I have a bundled string I will be sending to a database on my server. I do have the feeling I may be doing this in an innapropriate way, any and all advice is much apreciated!</p>
  
  <p>PS: You may notice there are only 5 arduinos showing, that was just to make things a little less complicated due to the 6th arduino also showed up as com9.</p>
  
  <p>Thank you</p>
  
  <p><strong>The Code</strong></p>
  
  <pre><code>var serialport = require('serialport');
  var SerialPort = serialport.SerialPort;
  
  // list serial ports:
  serialport.list(function (err, ports) {
      console.log(" Readout all availiable Com Ports and their pnpID:   ");
      ports.forEach(function(port) {
  
          console.log(port.comName);
          console.log(port.pnpId);
          console.log(port.manufacturer);
  
          var serialPort = new SerialPort(port.comName, {baudrate: 9600
          }, false);
          serialPort.open(function (error) {
          if ( error ) {
              console.log('failed to open: '+error);
          } else {
              console.log('open');
              serialPort.on('data', function(data) {
                  console.log('data received: ' + port.comName+ '   ' + data);
  
                  });
              }
          });
      })
  })
  </code></pre>
  
  <p><strong>The Output</strong></p>
  
  <pre><code>Readout all availiable Com Ports and their pnpID:   
  COM11
  USB\VID_2341&amp;PID_0043\75430333437351517211
  Arduino LLC (www.arduino.cc)
  COM9
  USB\VID_2341&amp;PID_0043\7543033343735151C020
  Arduino LLC (www.arduino.cc)
  COM8
  USB\VID_2341&amp;PID_0043\754363434303516181F0
  Arduino LLC (www.arduino.cc)
  COM7
  USB\VID_2341&amp;PID_0043\7543033313735140B152
  Arduino LLC (www.arduino.cc)
  COM4
  USB\VID_2341&amp;PID_0043\754303334373515162D0
  Arduino LLC (www.arduino.cc)
  open
  open
  open
  open
  open
  data received: COM8   L03 
  data received: COM4   L01
  data received: COM8   , -0.00127 , 8.19188
  
  data received: COM4    , -
  data received: COM7   L02
  data received: COM4   0.00127 , 8.
  data received: COM7    , -0.00
  data received: COM4   19188
  
  data received: COM7   127 , 8.
  data received: COM9   L
  data received: COM7   19188
  </code></pre>