R
R
Rishat Sultanov2017-08-23 15:08:06
Arduino
Rishat Sultanov, 2017-08-23 15:08:06

How to parse Arduino buffer to string in Node JS?

Hi all.
There is such a portico COM reader.

var SerialPort = require('serialport');

var port = new SerialPort('/dev/ttyACM0', {
    baudRate: 9600
});

port.on('readable', function () {
    console.log('Data:', port.read());
});



// Open errors will be emitted as an error event
port.on('error', function(err) {
    console.log('Error: ', err.message);
})

How to get a normal string buffer type?)
Data: <Buffer 73 20 46 0d>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
timfcsm, 2017-08-23
@rishatss

Data.toString()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question