PlatformIO Community

Does Serial Monitor work when there are two devices connected?

I have connected two ESP8266’s for ESP NOW testing. One is using COM4, and the other is using COM5. I have specified the ports in the ini file like so:

monitor_port = COM[5]
upload_port = COM[5]

PlatformIO can successfully upload the binary, but after the upload, if I start the serial monitor, I get the following error. I have tried restarting PlatformIO (VS Code) multiple times, but nothing changed. If I open the other project and see the serial monitor (the one that uses COM4), it is working (keep printing messages). What is the problem? Is PlatformIO’s serial monitor supposed to work when two devices are connected and both of them are printing texts to the computer (on different COM ports)?

> Executing task: [MY_DIRECTORY]\.platformio\penv\Scripts\platformio.exe device monitor <

--- Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Miniterm on COM5  115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
Exception in thread rx:
Traceback (most recent call last):
  File "[MY_PYTHON]\Lib\threading.py", line 973, in _bootstrap_inner
    self.run()
  File "[MY_PYTHON]\Lib\threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "[MY_DIRECTORY]\.platformio\penv\lib\site-packages\serial\tools\miniterm.py", line 499, in reader
    data = self.serial.read(self.serial.in_waiting or 1)
  File "[MY_DIRECTORY]\.platformio\penv\lib\site-packages\serial\serialwin32.py", line 295, in read
    raise SerialException("GetOverlappedResult failed ({!r})".format(ctypes.WinError()))
serial.serialutil.SerialException: GetOverlappedResult failed (PermissionError(13, 'Access is denied.', None, 5))

Are you 100% sure that COM5 isn’t open anywhere else? Does the other serial monitor show Miniterm on COM4 at the start?

Seems like the unpowered USB 2.0 hub was not able to provide enough current to the ESP device. Strange how uploading still worked when I cannot connect to the serial to see the text.