Skip to content

Instantly share code, notes, and snippets.

@sidorares
Created August 27, 2016 13:17
Show Gist options
  • Save sidorares/d25a8adf9aa18f50ac726d93ea976d27 to your computer and use it in GitHub Desktop.
Save sidorares/d25a8adf9aa18f50ac726d93ea976d27 to your computer and use it in GitHub Desktop.
var SerialPort = require('serialport');
// /dev/tty.usbserial-FTZ2C9FV
var port = new SerialPort(process.argv[2], {
baudRate: 1200
}, function (err) {
if (err) {
return console.log('Error: ', err.message);
}
port.on('data', function (data) {
console.log('Data: ' + data.toString('hex') );
});
});
{
"name": "dump-smartev-data",
"version": "1.0.0",
"dependencies": {
"serialport": "^4.0.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment