You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I first connect the ESP8266 to the computer, I run my demo and cannot write messages, but if I press the ESP8266 RST reset button once and run the demo again, I can send messages. I don't know why, and Arduino tools don't have this problem.
this is my demo.
const { SerialPort } = require('serialport')
const portName = 'COM3';
const baudRate = 115200;
const port = new SerialPort({ path: portName, baudRate: baudRate })
setInterval(function () {
port.write('D1_300_500_1\n', function(err) {
if (err) {
return console.log('Error on write: ', err.message)
}
console.log('message written')
// port.close(function (err) {
// console.log(err)
// })
})
},1000)
let receivedData = '';
port.on('data', (data) => {
receivedData += data.toString();
if (receivedData.includes('\n')) {
const cleanedData = receivedData.replace(/[\r\n]/g, "");
receivedData = '';
console.log(cleanedData)
}
});
// Open errors will be emitted as an error event
port.on('error', function(err) {
console.log('Error: ', err.message)
})
I tried to use @serialport/parser-ready but it didn't work.
The text was updated successfully, but these errors were encountered:
gmm932
changed the title
When I first connect the ESP8266 to the computer, I run my demo and cannot write messages, but if I press the ESP8266 RST reset button once and run the demo again, I can send messages. I don't know why, and Arduino tools don't have this problem.
ESP8266 Initial Connection Issue: Reset Required for Message Sending
Apr 1, 2024
When I first connect the ESP8266 to the computer, I run my demo and cannot write messages, but if I press the ESP8266 RST reset button once and run the demo again, I can send messages. I don't know why, and Arduino tools don't have this problem.
this is my demo.
I tried to use @serialport/parser-ready but it didn't work.
Originally posted by @gmm932 in #2767
The text was updated successfully, but these errors were encountered: