I'm new how to use the Serial Monitor

In my VS terminal this is what I get maybe I don’t have something setup correctly? Any help will do:

Executing task in folder LightInductLED: C:\Users\babyg.platformio\penv\Scripts\platformio.exe device monitor <

— Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting...
could not open port ‘COM4’: could not open port ‘COM4’: PermissionError(13, ‘Access is denied.’, None, 5)
The terminal process “C:\Users\babyg.platformio\penv\Scripts\platformio.exe ‘device’, ‘monitor’” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Serial monitor is the second button from the right at the bottom of the page, along with the build button.


Oh. Open Device Manager, and see which port your device is connected to.

‘access denied’ means something else is using COM4.

1 Like

The only thing on Com4 is the Arduino board it shows in the device manager with no problems. All of my other programs work with no problem. Just this one where the Serial Monitor is used for viewing feedback does not work. I placed it in the Arduino IDE and with it’s serial monitor it worked fine. I don’t understand the permissions error, where do I need to go to give permission for it to work?

Is Arduino still open? It may keep the serial port tied up.

No, I don’t use both programs at the same time. When I put the code into the Arduino IDE after I closed VS Code.

Is it TX/RX?

I restart when I have trouble connecting.

No, I’m talking about the Serial Monitor in the program (second before last icon from the right at the bottom.

I’d follow the link. Something about something in that list is causing a problem.

Morning @etcwebdesigns,

The error you are seeing means that “something else” has the com port open already. Things to consider:

  • Do you have any monitor_ settings in your platformio.ini?
  • Open a command session and execute the Windows mode command which, apparently, lists the ports. I’m on Linux so can’t test it.
  • Does the problem persist when you restart VSCode?
  • Are other programs using the com port? The Arduino IDE?
  • In VSCode, click the drop down just above the monitor screen. It’s a list of open terminals. Usually one for the build, one for the upload and one for the monitor. Have you got any others open?
  • Even if the Arduino IDE is closed, does the Windows task manager show any processes running for it? Sometimes the application doesn’t close properly and leaves processes running in the background. Kill them if so.


IT’s working!!! I have no idea what changed but it’s working now. It’s weird, it didn’t work yesterday but today it’s working. I have 2 different UNO boards and it started working after plugging in the new board and now it works with the first board. I wish I knew how it started working so I may help someone else.


Welcome to the world of IT WORKS(and I don’t know why it didn’t or now does)!!

1 Like