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.
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?
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.