Closed SebCanet closed 5 years ago
For connect button and serialport@7.1.4, I need to change like this:
document.getElementById('btn_connect').onclick = function(event) {
var SerialPort = require("serialport")
var Readline = require('@serialport/parser-readline')
var moniteur = document.getElementById('fenetre_term')
var vit = document.getElementById('vitesse').value
var baud = parseInt(vit)
var _com = localStorage.getItem("com")
s_p = new SerialPort(_com,{baudRate:baud})
var parser = s_p.pipe(new Readline({ delimiter: '\r\n' }))
document.getElementById('btn_connect').disabled=true
document.getElementById('btn_envoi').disabled=false
s_p.on('open', function(){
moniteur.innerHTML += ' démarrage de la communication série<br />'
})
parser.on('data', function(data){
moniteur.innerHTML += data + "<br />"
moniteur.scrollTop = moniteur.scrollHeight;
moniteur.animate({scrollTop: moniteur.scrollHeight})
})
}
Thanks for your help. i don't know why serialport don't work for you. For me it's ok whatever the version. A new version is available with all node modules updated (serialport@7.1.4)
Serialport v4.0.7 cannot download...just typing "npm install" and npm blocks on it. And with v7.1.4 your script term.js cannot read and writefrom serialport. I'll test your new version on different Windows vesion.
With the v7.1.4 there's still the same pb, on different Windows version. This version seems to need more parameters to open connection. Even your v1.3.1 has a bug. Many thanks for your help.
Hi, i think its Ok
Great!!!! It works ! Thanks a lot!
It seems that serial port vesion different than v4.07 does not work properly... Serial console does not do anything. Trying with other versions....