Good afternoon, I need a framework, or some alternative to read data from a COM5 usb port, with bound 115200. Has anyone ever used any type of tool? I have seen many in java, c ++ etc.
I'm working with a sensor libelium waspmote, ac meter, this sensor emits data via usb, and I need to use that data in an angular 5 front-end application that I'm building.
Update: I need to store this data in my database, so any alternative that performs this procedure, is already good for me, thank you for the help.
Update 2, I'm using the serialport library on nodejs
npm install --save-dev serialport
var SerialPort = require('serialport');
var port = new SerialPort("COM5", {
baudRate: 115200
});
port.on('open', function() {
port.write('main screen turn on', function(err) {
if (err) {
return console.log('O cabo usb não está conectado: ', err.message);
}
console.log('message written');
});
});
// open errors will be emitted as an error event
port.on('data', function (data) {
// var dados = data;
// console.log(dados.toString());
var stringDatas = data.toString();
// var numberDatas = Number(stringDatas);
if (stringDatas !== 'start'){
console.log(stringDatas);
lenghtData(stringDatas);
}
});
function lenghtData(value) {
var result = value.lenght;
return result;
}