Skip to content

Feature Request: Serial Monitor #876

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

Closed
sohnryang opened this issue Jul 27, 2020 · 13 comments
Closed

Feature Request: Serial Monitor #876

sohnryang opened this issue Jul 27, 2020 · 13 comments
Assignees
Labels
conclusion: resolved Issue was resolved topic: CLI Related to the command line interface topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@sohnryang
Copy link

A built-in serial monitor in arduino-cli would be great.

@ubidefeo ubidefeo self-assigned this Jul 28, 2020
@ubidefeo
Copy link

hi @sohnryang
Being this a command line tool we believe it's up to the user to choose their preferred way of interacting with the serial connection.
If we were to integrated it into the CLI we'd end up putting a tool inside a tool, and this would be something that we're trying to avoid.
CLI is for users who want to extend their workflows and introduce Arduino into them.
On Linux and Mac OS you can use command line tools to connect to serial ports, screen is stock in both, I believe, or it can be installed quickly via a package manager.

We welcome this feature request nonetheless, as it will be part of our upcoming FAQ.
I'd suggest you use Putty on Windows and I personally use Serial on Mac OS (it seems they released a v2 which I look forward to upgrading to).

Anyway if you search the web for "serial communication app" and add your OS you'll get a lot of options.
Again, if your workflow is terminal based, I'd suggest you implement it through screen.
I often just pull that screen /dev/cu.xxxxxxxx 9600 and it gets the job done if I only need to receive data.
You can of course use this tool to send data to your board.
Look up a tutorial, the terminal can let you do so many beautiful and powerful things :)

@per1234 per1234 added the type: enhancement Proposed improvement label Jul 28, 2020
@sohnryang
Copy link
Author

@ubidefeo I know tools like screen can be used as serial monitor. I thought that serial monitor integrated to arduion-cli can give users more "Arduino IDE-like" features, such as setting line ending characters on the fly, and showing timestamps in outputs.

@ubidefeo
Copy link

I can see the usefulness for a few users. We'd have to implement cross-platform solutions for this, but we can't yet give way for these features, we've definitely talked about this but we're leaning towards adding this to an FAQ and advising users to choose a terminal communication mean, and if we get a lot of requests we might being it to the roadmap :)

@swankun
Copy link

swankun commented Aug 27, 2020

Might not be the exact replacement for Serial Monitor, but this is a software that I find very useful. It reads and plots data from your serial port, and also lets you send commands to the board in ASCII or binary format.

@sohnryang
Copy link
Author

Thanks for responding!

@giripriyadarshan
Copy link

One advantage of adding a Serial monitor to arduino-cli is that we could keep the serial monitor open when uploading the sketch just like Arduino IDE.

With 3rd party software, it doesn't know when to stop accessing the port and let the arduino-cli upload the sketch.

It is annoying to close and open the serial monitor every time you want to upload a sketch, especially when the sketch has a bug and you're occupied in trying to debug it

@ubidefeo
Copy link

ubidefeo commented Apr 6, 2021

@giripriyadarshan
This would imply having one arduino-cli running as a process doing the Serial Monitor and another one doing your compile/upload.
We should make the two processes be aware of each other and it's out of the scope of the CLI.
Offering Serial Monitor is in our roadmap, but you'll have to stop it to continue the operations on the same board anyway

@giripriyadarshan
Copy link

giripriyadarshan commented Apr 6, 2021

@ubidefeo

but you'll have to stop it to continue the operations on the same board anyway

Not really.... currently, Arduino IDE offers a Serial monitor which is stopped by the IDE (without erasing the previous outputs) when we are uploading to the board and continues the Serial monitor when the board restarts(after upload).

This would imply having one arduino-cli running as a process doing the Serial Monitor and another one doing your compile/upload.

Yes, probably that's what the IDE does too right?

@ubidefeo
Copy link

ubidefeo commented Apr 6, 2021

@giripriyadarshan
the IDE does some behind-the-scene gymnastics to do that
The CLI is meant to do one operation at the time.
Even IDE 2 has a GUI handling the disconnection of the Serial Monitor when it needs to upload.

@giripriyadarshan
Copy link

True that ..... But this was a suggestion ...... When implementing the serial monitor, please implement it like the IDE version not like a 3rd party serial monitor (as they already exist).

@ubidefeo
Copy link

ubidefeo commented Apr 6, 2021

we'll do our best :D

@notcos
Copy link

notcos commented Jul 30, 2022

For anyone looking for a simple solution to handling serial monitoring on Linux automatically, just write a simple bash script. Here is an example that can be used inside of tmux to compile, upload, and automatically handle serial monitoring with screen. It kills and restarts screen inside of the second window of tmux.

#!/bin/bash
arduino-cli compile --fqbn espressif:esp32:adafruit_feather_esp32_v2 httpget.ino
pkill screen
arduino-cli upload -p /dev/ttyACM0 --fqbn espressif:esp32:adafruit_feather_esp32_v2 httpget.ino
tmux send-keys -t 2 C-z 'screen /dev/ttyACM0 115200' Enter

@per1234
Copy link
Contributor

per1234 commented Jul 30, 2022

Resolved by #1495

@per1234 per1234 added conclusion: resolved Issue was resolved topic: code Related to content of the project itself topic: CLI Related to the command line interface labels Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: CLI Related to the command line interface topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

6 participants