Hello,
I am using an usbtin adapter through my windows laptop.
I am able to configure and start you program.
However I add to uncomment your commented code:
port.open(function (err) { if (err) { return console.log('Error opening port: ', err.message); } console.log('Serial Port open!'); port.write(canMessage.initMessage(), (err) => console.log('initError?', err)); // Because there's no callback to write, write errors will be emitted on the port: port.write('S2\r', (err) => console.log('w', err)); port.write('O\r', (err) => console.log('ww', err)); });
And also add a console.log on the parser function:
parser.on('data', (line) => { const strLine =${line}.trim().split('\x07').join(''); console.log(strLine);
After that I started receive data on mqtt. Everything seems fine except for the temperature data. I receive 0 as value:
I dont' know if this can help but I am a device with Celsius temperature
Hello, I am using an usbtin adapter through my windows laptop. I am able to configure and start you program. However I add to uncomment your commented code:
port.open(function (err) { if (err) { return console.log('Error opening port: ', err.message); } console.log('Serial Port open!'); port.write(canMessage.initMessage(), (err) => console.log('initError?', err)); // Because there's no callback to write, write errors will be emitted on the port: port.write('S2\r', (err) => console.log('w', err)); port.write('O\r', (err) => console.log('ww', err)); });
And also add a console.log on the parser function:parser.on('data', (line) => { const strLine =
${line}.trim().split('\x07').join(''); console.log(strLine);
After that I started receive data on mqtt. Everything seems fine except for the temperature data. I receive 0 as value: I dont' know if this can help but I am a device with Celsius temperature