serialport / node-serialport

Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!
https://serialport.io
MIT License
5.81k stars 1.01k forks source link

Splits Packets #332

Closed RafaelKa closed 10 years ago

RafaelKa commented 10 years ago

i'm trying to read serial port EnOcean Pi(TCM310 as Raspberry Pi module) with this package. This works but not as expected. Each message is splitted in three and sometimes in two parts. The first message(also directly after connection to serial port) is entire/unbroken but second message and following messages are splited in three or two parts.

This works fine with other languages like python, perl or with serial sniffer "jpnevulator" but not with node.js at all. Also i tried: npms "trivial-port" -> the same behvior

Why happens it only with node.js ?

reconbot commented 10 years ago

We'll try to fire data events as soon as we get data. You'll want to use a parser to collect the data into however your device delimits "packets" of data. The raw parser just emits data, the readline parser waits for a \n between emitting data.

voodootikigod commented 10 years ago

I am going to assume this has been resolved, please provide notice and will reopen if not the case.