Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the serial ports monitor from within CLion #359

Closed
orome opened this Issue Dec 7, 2015 · 14 comments

Comments

Projects
None yet
5 participants
@orome
Copy link

orome commented Dec 7, 2015

How do I use the serial ports monitor from within CLion?

If I add an external tool and run it I get:

/usr/local/bin/platformio serialports monitor
--- Miniterm on /dev/cu.usbmodem1421: 9600,8,N,1 ---
--- Quit: Ctrl+]  |  Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
Error: (25, 'Inappropriate ioctl for device')

The same command (platformio serialports monitor) works fine in at the command line (OS X Terminal).

@ivankravets ivankravets added the invalid label Dec 7, 2015

@ivankravets ivankravets self-assigned this Dec 7, 2015

@ivankravets

This comment has been minimized.

Copy link
Member

ivankravets commented Dec 7, 2015

Please use special plugin for it https://plugins.jetbrains.com/plugin/8031?pr=clion

@ivankravets ivankravets closed this Dec 7, 2015

@orome

This comment has been minimized.

Copy link
Author

orome commented Dec 8, 2015

Is there no way to get platformio serialports monitor working from within the IDE (perhaps with some configuring or arguments). I like using "External Tools" for things.

@ivankravets ivankravets reopened this Dec 8, 2015

@ivankravets ivankravets removed the invalid label Dec 8, 2015

@itsjustvenky

This comment has been minimized.

Copy link

itsjustvenky commented Dec 9, 2015

@orome Use "Terminal" from Clion which is already available. Check the ICON in botton left of your ide.

@orome

This comment has been minimized.

Copy link
Author

orome commented Dec 9, 2015

@itsjustvenky — Yes, understood. But what I was hoping for was a way to use it alongside other "External Tools" in my workflow.

@ivankravets

This comment has been minimized.

Copy link
Member

ivankravets commented Dec 9, 2015

@orome I don't see in my CLion IDE "External tools" However, I see that exists documentation for it https://www.jetbrains.com/clion/help/external-tools.html

Could you provide me screenshot what do you mean under it?

P.S: I use trial CLion.

@orome

This comment has been minimized.

Copy link
Author

orome commented Dec 9, 2015

I'd like to be able to do something like this:

screen shot 2015-12-09 at 11 17 58 am

Also, while we're at it. It would be great if somehow closing the window it's running in would turn it off/exit. The serial monitor plugin doesn't do that and is therefore almost useless (too much clicking and too easy to forget and leave it connected).

@ivankravets ivankravets added the wontfix label Dec 9, 2015

@ivankravets

This comment has been minimized.

Copy link
Member

ivankravets commented Dec 9, 2015

PlatformIO uses @pyserial for platformio serialports command. Miniterm is used for Serial Monitor. However, miniterm requires to be run within terminal applicaiton. I've just switched directly to @pyserial, see

/Volumes/SOFT/Projects/GitHub/platformio/origin/.tox/develop/bin/python -m serial.tools.miniterm /dev/cu.usbmodemFD1311
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Volumes/SOFT/Projects/GitHub/platformio/origin/.tox/develop/lib/python2.7/site-packages/serial/tools/miniterm.py", line 866, in <module>
    main()
  File "/Volumes/SOFT/Projects/GitHub/platformio/origin/.tox/develop/lib/python2.7/site-packages/serial/tools/miniterm.py", line 838, in main
    filters=filters)
  File "/Volumes/SOFT/Projects/GitHub/platformio/origin/.tox/develop/lib/python2.7/site-packages/serial/tools/miniterm.py", line 315, in __init__
    self.console = Console()
  File "/Volumes/SOFT/Projects/GitHub/platformio/origin/.tox/develop/lib/python2.7/site-packages/serial/tools/miniterm.py", line 123, in __init__
    self.old = termios.tcgetattr(self.fd)
termios.error: (25, 'Inappropriate ioctl for device')

See

Miniterm itself does not implement any terminal features such as VT102 compatibility. However it inherits these features from the terminal it is run.

Try to wrap PlatformIO to shell script, like

# !/bin/bash

/full/path/to/platformio $*

@ivankravets ivankravets closed this Dec 9, 2015

@hpsaturn

This comment has been minimized.

Copy link

hpsaturn commented Sep 6, 2018

Hi,

In the last update of PlatformIO over Atom, I have a similar issue when I go to uploading:

...
Hash of data verified.
Compressed 204368 bytes to 104260...
Wrote 204368 bytes (104260 compressed) at 0x00010000 in 1.9 seconds (effective 855.3 kbit/s)...
Hash of data verified.
 
Leaving...
Hard resetting via RTS pin...
========================= [SUCCESS] Took 7.51 seconds =========================
Error: (25, 'Inappropriate ioctl for device')

but over CLI thats not happen with pio run --target upload:

...
Hash of data verified.
Compressed 204368 bytes to 104260...
Wrote 204368 bytes (104260 compressed) at 0x00010000 in 1.9 seconds (effective 846.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
=================================================================== [SUCCESS] Took 6.76 seconds ===================================================================

PD: my configuration and board are different that initial issue in this thread:

platformio.ini:

[env:lolin32]
platform = espressif32
board = lolin32
framework = arduino

lib_deps =
    1751
    28
@ivankravets

This comment has been minimized.

Copy link
Member

ivankravets commented Sep 6, 2018

@hpsaturn could you reproduce this issue with https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide? I see that a lot of developers abandon Atom's extensions :(

@hpsaturn

This comment has been minimized.

Copy link

hpsaturn commented Sep 6, 2018

Hi @ivankravets, that is a rally bad news for me. 😳😫😭. I don't like Microsoft products, my world is only with Linux, I prefer go back to Vim, but I will try to test it and replicate it on visualstudio for you. Thanks my friend for quicky answer.

@ivankravets

This comment has been minimized.

Copy link
Member

ivankravets commented Sep 6, 2018

VSCode != Microsoft Visual Studio. It is a separate free and open source project under MIT license. It is also based on the same Electron engine which Atom uses.

@hpsaturn

This comment has been minimized.

Copy link

hpsaturn commented Sep 6, 2018

ok, I understand, I got confuse for microsoft link, ok, I will try it.

@jlsalmon

This comment has been minimized.

Copy link

jlsalmon commented Feb 13, 2019

My slightly hacky but reasonably effective workaround for this is to call platformio serialports monitor as part of the CMake upload command, i.e. in CMakeLists.txt:

add_custom_target(
        PLATFORMIO_UPLOAD ALL
        COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload && sleep 1 && ${PLATFORMIO_CMD} serialports monitor
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

@ivankravets ivankravets reopened this Feb 23, 2019

@ivankravets ivankravets added this to the 3.6.5 milestone Feb 23, 2019

@ivankravets ivankravets added feature and removed wontfix labels Feb 23, 2019

@ivankravets

This comment has been minimized.

Copy link
Member

ivankravets commented Feb 23, 2019

We added new targets in e0b9d08

You can run Serial Port Monitor as a build task.

Please re-test with the latest development version via $ pio upgrade --dev.

P.S: Don't forget to install https://plugins.jetbrains.com/plugin/7177-file-watchers plugin. See updated docs > https://docs.platformio.org/en/latest/ide/clion.html

ivankravets added a commit that referenced this issue Feb 23, 2019

Project Generator: add new targets for CLion IDE "BUILD_VERBOSE" and …
…"MONITOR" (serial port monitor) // Resolve #359

@ivankravets ivankravets referenced this issue Mar 7, 2019

Closed

platformio 3.6.5 #37693

5 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.