esp-web-tools icon indicating copy to clipboard operation
esp-web-tools copied to clipboard

Improv works but serial log does not

Open thenewwazoo opened this issue 2 years ago • 3 comments

I have kind of a weird situation. I am using esp web tools to flash devices in my project, and flashing devices works fine. So does provisioning WiFi, and visiting the device. But the serial log page doesn't.

The logs aren't anything weird. Lines are terminated with \n, and are prepended with >>> or !!! depending on severity. There are no escape codes/control characters. I can easily monitor serial log lines with any other method pio run monitor or screen(1) or even a python script that uses pyserial.

Any suggestions?

thenewwazoo avatar Dec 08 '23 05:12 thenewwazoo

A user reported CRLF weirdness in screen(1), which led me to do some experimentation. My line endings are, right now, \n. I changed the ones I controlled to \r\n, and the serial log worked, for a short time. I have a suspicion that it stopped working when a line with only \n came through, but I haven't extensively tested it yet.

I can't find anything in documentation about line endings.

thenewwazoo avatar Dec 08 '23 19:12 thenewwazoo

Looking at this line:

const lines = this.chunks.split("\r\n");

this implies to me that line endings must be \r\n, but the definition of LOG_FORMAT does not include \r.

thenewwazoo avatar Dec 08 '23 19:12 thenewwazoo

hm ya, I wrote that logging based on the ESPHome output and it seemed to always work for everything else.

balloob avatar Jan 18 '24 02:01 balloob