Serial data missing bits #174

greengiant83 opened this Issue Jun 13, 2013 · 3 comments


None yet
4 participants

Love this plugin, voodootikigod, thanks for putting it together.

I am having problems reading complete lines from a usb serial port on a raspberry pi.

The device is writing out text like this:


These lines are delimited by a new line character ("\n")

Unfortunately what I read from my node server the feed is missing some data. For instance here is an example of the data I get back


if I manually insert line breaks I get this:


which makes it look like it starts dropping data after about 80-85 characters into a line.

If I bring up the same port in screen on the command line I can see the complete lines. In windows the maker of the device suggested that i turn on XON flow control. I don't know if that actually has anything to do with this or not.

Here is my code

var serialport = require("serialport");
var SerialPort = serialport.SerialPort;
var usbPort;

console.log("Opening serial port...");
usbPort = new SerialPort("/dev/ttyUSB0", { baudrate: 115200, parser: serialport.parsers.readline("\n") });

//USB Serial Port Opened
usbPort.on("open", function ()
    console.log("USB Serial Port Opened");


    //USB Serial Port Data Received
    usbPort.on("data", function (data)

function sendUSBMessage(message)
    console.log("Sending USB Message: " + message);
    usbPort.write(message, function (err, results)
        console.log("err " + err);
        console.log("results " + results);


voodootikigod commented Aug 13, 2013

Awesome data, will try to identify. Thanks for the kind words, but its more than just me (increasingly more so of late), but will spread the love around!

Let me try to mock this up and see if I can fix it.


JayBeavers commented Nov 12, 2013

@greengiant83 , I think issue #203 is dealing with your issue and I'd like to close this one as a duplicate. Do you concur?


reconbot commented Apr 2, 2014

I'm going to close due to age, but feel free to reopen if this is still an issue.

@reconbot reconbot closed this Apr 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment