Created
August 27, 2016 13:17
-
-
Save sidorares/d25a8adf9aa18f50ac726d93ea976d27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') ); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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