Join GitHub today
Monitoring a serial port breaks upload #384
platformio run -t upload && platformio serialports monitor
If I attach to a serial port to monitor the output, it will prevent upload from working. Not sure what can be done here, but other environments manage to somehow do it. Reverse is true - if I start the upload process and attach to a serial port in another terminal window, it will fail the upload (and attach too).
Ideally, we'd like to keep the monitor open and attached and keep re-uploading the firmware iteratively. This way the monitor won't be skipping some init output and have us re-attach after every upload.
Nothing can be done here
Do you mean Arduino IDE? They have PID of opened serial monitor and can close/kill it before uploading and then restore it.
PlatformIO is full flexible and independent toolkit. We don't limit users in their actions. Someone likes to use external Serial Monitor with GUI, others like platformio serialports monitor. We don't force users to use all our tools from @platformio. Our aim is to develop useful tools and improve obsolete practice with embedded development. User have ability to decide what is comfortable for him.
As for me, I use CoolTerm. Of course, each time before uploading I manually disconnect/connect to SerialPort in GUI.
The Sming framework does this similar to arduino IDE from command line when used "make flash".
Sorry I don't want to mention other frameworks here, but just for example/reference purpose I providing the idea.
If it all this is possible to implement with a extra option to platformio command line, then it will be a great feature.
I've explained above the problem. All these IDEs work in own isolated space where they spawn child process and have their PIDs. You can reproduce same logic using own "isolated space" via script
What is more, you can put these line into infinite loop.
I understand your point, Ivan. Was really checking if there was any trick or obvious omission, but was on a cautious side.
For my purposes this one works quite well:
As soon as upload is done - it connects to the monitor, so I don't skip any early init output. Maybe we can put it in a FAQ as a best practice?