Closed mikehall314 closed 7 years ago
SerialPort version: 5.0.0-beta3 NodeJS Version: 6.9.2
Also having this problem code below:
const port = new SerialPort('/dev/tty.usbserial-FT9JAO38', {
baudRate: 115200,
});
const Readline = SerialPort.parsers.Readline;
const parser = port.pipe(new Readline());
parser.on('data', (data) => {
console.log(data);
});
port.on('open', () => {
console.log('Opened Port')
write();
})
function write() {
port.write('Hello', function () {
port.drain();
});
port.write('World', function () {
port.drain();
});
}
Error:
Abort Trap: 6
SerialPort version: 4.0.7 babel-node 6.11.4 macOS Sierra 10.12.4
Same issue when writing more than one time.
calling drain()
as described here https://github.com/EmergingTechnologyAdvisors/node-serialport/issues/660#issuecomment-259525365 fixed it.
This is probably fixed in serialport@5.0.0-beta6
I'm going to close this in favor of #1188 which is a duplicate but active issues to this one.
SerialPort version: 5.0.0-beta3 NodeJS Version: 7.4.0 Operating System and Hardware Platform: macOS Sierra. Also observed on Ubuntu 16.04 (ia32) Are you using an alternative NodeJS runtime? (eg Electron): Both vanilla node and Electron
Summary of Problem
Two successive writes to a thermal printer causes node to crash with
Abort Trap: 6
Steps and Code to Reproduce the Issue
Expected result
Printer prints
Actual result
Printer prints
Then node crashes with the error
Abort Trap: 6