Serial Monitor Slow Startup (Still)

I’m opening a new topic because the old topic wasn’t getting any responses. Here’s what I added to that topic a month ago:

I’m the guy who started this thread back in August. Sorry, I’ve been distracted and haven’t been able to fully follow all the developments, but it seemed like the issue was resolved. But now that I’m back to using PIO, I have to report that the problem remains, and is actually a bit worse than before. I tried “pio upgrade --dev” to upgrade to 6.1.6a4 from 6.1.5, but that didn’t make a difference.

The behavior that I’m seeing now is more inconsistent/unpredictable than before: After uploading code, regardless of whether the serial monitor was previously running for not, the serial monitor startup time varies from a couple of seconds to about 12 seconds. But now, when the startup time is long, the serial monitor is completely unresponsive to messages from the target. If I kill and restart the serial monitor, it usually (not always) starts working, but by then I’ve missed a bunch of messages.

It’s gotten even worse since then. Now the code upload process gets stalled for a random amount of time (up to ~15 seconds), and when it eventually finishes, the serial monitor is always unresponsive.

The only reliable workaround I’ve found is to kill the Teensy Loader program before I compile/upload the code (every time). The Loader gets automatically restarted, but it puts VSCode into the background. So I quickly bring VsCode to the foreground, and the serial monitor seems to work every time. Really awkward process, and I’m anxious to find a real fix for this problem. Thanks!

Interesting - I noticed a significant increase in time for the serial monitor to connect with ESP32s a few months back, but I haven’t seen it hang so have never done anything about it.

I always use the CLI (pio run -t upload -t monitor or pio run -t upload && pio device monitor) so haven’t tried any VSCode workardounds.

The thing that’s prompted me to reply is that that I’ve also started seeing the upload process bomb-out every now and then, when it NEVER used to. I put it down to EMI/ noise and the USB cable I’m using though. The upload fail is definitely worse when I’ve got my phone plugged into the computer too for debugging a client app at the same time.