platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.93k stars 792 forks source link

Error starting Monitor: Clion, Arduino33BLE, #4533

Closed bbar2 closed 1 year ago

bbar2 commented 1 year ago

What kind of issue is this?

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system:

PlatformIO Version (platformio --version):

Description of problem

Steps to Reproduce

1. 2. 3.

Actual Results

Expected Results

If problems with PlatformIO Build System:

The content of platformio.ini:

Insert here...

Source file to reproduce issue:

Insert here...

Additional info

snowy-shadow commented 1 year ago

I am getting a similar issue

/opt/homebrew/bin/platformio -c clion device monitor -e teensy41
Error: Traceback (most recent call last):
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/platformio/__main__.py", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
    ^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/platformio/cli.py", line 71, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/platformio/device/monitor/command.py", line 152, in device_monitor_cmd
    start_terminal(options)
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/platformio/device/monitor/terminal.py", line 54, in start_terminal
    term = new_terminal(options)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/platformio/device/monitor/terminal.py", line 102, in new_terminal
    term = Terminal(
           ^^^^^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/platformio/device/monitor/terminal.py", line 28, in __init__
    super().__init__(*args, **kwargs)
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/serial/tools/miniterm.py", line 395, in __init__
    self.console = Console()
                   ^^^^^^^^^
  File "/opt/homebrew/Cellar/platformio/6.1.6/libexec/lib/python3.11/site-packages/serial/tools/miniterm.py", line 198, in __init__
    self.old = termios.tcgetattr(self.fd)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
termios.error: (25, 'Inappropriate ioctl for device')

I am using Clion with latest version of macos and platformio. This happens when I tries to read from the serial monitor

bbar2 commented 1 year ago

I had this problem when I was trying to use the CLion->Tools->PlatformIO->Monitor command for a serial monitor.
Once I started opening a shell, and issuing a "pio device monitor" command for a serial monitor, I was back in business. You can do this in a separate shell, or a shell window within CLion. It works very reliably.