PlatformIO Community

Weird problem with win10 and usb to serial port


Just started having a weird issue with the serial port monitoring. If it’s connected to the esp8266 chip thru a standard usb to serial (eg. FTDI232) and I reboot the chip I get the following in the terminal window and it closes. If I close vscode, disconnect, then reconnect and open arduino and open the serial port it’s fine again, then I reopen PIO and the serial port is fine again for awhile.

Traceback (most recent call last):
File “C:\Users\Bill.platformio\python27\Lib\”, line 801, in __bootstrap_inner
File “C:\Users\Bill.platformio\python27\Lib\”, line 754, in run self.__target(*self.__args, **self.__kwargs)
File “c:\users\bill.platformio\penv\lib\site-packages\serial\tools\”, line 445, in reader data = or 1)
File “c:\users\bill.platformio\penv\lib\site-packages\serial\”, line 257, in in_waiting raise SerialException(“ClearCommError failed ({!r})”.format(ctypes.WinError()))
SerialException: ClearCommError failed (WindowsError(5, ‘Access is denied.’))

Any help would be great! When it displays this weirdness the serial port monitor closes/crashes. I can reopen and it works fine until I reboot the device, and then same issue.


Exact same problem on Adafruit Feather M0. Identical serial output except for last line of output. For me,the last kine of the error message is:
SerialException: ClearCommError failed (WindowsError(22, ‘The device does not recognize the command.’))

The device then crashes and restarts…



Have now determined that the error occurs when the MCU resets while a connection to the Serial Monitor is active.
Now I just have to find out why my code keeps restarting…