2

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.

  • 1
    isn't it enough to close Serial Monitor window? – Juraj Nov 7 '18 at 7:47
  • this does work, but is still kind of annoying... Thanks! – Joel Spolsky Nov 7 '18 at 22:08
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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