3

I'm using the Visual Studio Code extension to develop for Arduino which works great.

It doesn't have a Serial Plotter like the regular Arduino IDE, which I need to debug this project. I can run the Arduino IDE's Serial Plotter alongside Visual Studio Code without too much of a problem.

However, if I try to compile and upload from Visual Studio Code while the Arduino IDE is running, the port is busy (not a surprise):

avrdude: ser_open(): can't open device "/dev/cu.usbmodem14201": Resource busy
An error occurred while uploading the sketch 

So I have to keep exiting and relaunching the Arduino IDE every time I build.

Anyone have a suggestion for how to work around this? Using an iMac as development environment.

2
  • 1
    isn't it enough to close Serial Monitor window?
    – Juraj
    Nov 7, 2018 at 7:47
  • this does work, but is still kind of annoying... Thanks! Nov 7, 2018 at 22:08

2 Answers 2

3

Without very specialized software that can create two new devices with the correct "teeing" policy, it's not going to be possible. Only one program can open a serial port at a time (certainly and have it get anything intelligible out of it...)

I would suggest you may want to add a second serial port. Use an FT232 adaptor to communicate on another serial connection (or a SoftwareSerial connection at a pinch) for your debugging information. You really want a board with more than one serial port for this - or a board with a native USB for programming and a hardware serial port for data communication.

Another alternative is to ditch the serial for programming altogether and program your board through a dedicated programmer, thus leaving your serial port free for data communication.

-1

Try teleplot extension in vscode

2
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – VE7JRO
    Apr 19, 2023 at 23:45
  • Please edit so you can expand on your answer. As it currently stands, you answer does not meet the quality standards for this site. EG. Add a link, provide a summary of teleplot, answer how this extension solves the problem the OP was having.
    – sa_leinad
    Apr 26, 2023 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.