Skip to content

Monitor: show timestamp when receiving messages #2316

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
3 tasks done
alessio-perugini opened this issue Sep 13, 2023 · 1 comment · Fixed by #2336
Closed
3 tasks done

Monitor: show timestamp when receiving messages #2316

alessio-perugini opened this issue Sep 13, 2023 · 1 comment · Fixed by #2336
Assignees
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@alessio-perugini
Copy link
Contributor

Describe the request

When opening the serial monitor with arduino-cli monitor -p /dev/ttyACM0 would be cool to prefix the timestamp of a message received from the serial.
We can add a new flag like --show-timestamp that enables such a feature.

Expected output:

[2023-09-13 16:55:22] Message from serial
[2023-09-13 16:55:25] another message
[2023-09-13 16:55:30] a
[2023-09-13 16:55:35] bcd

Describe the current behavior

When we receive a message from the serial monitor we just show them without prefixing the timestamp.

Arduino CLI version

Operating system

Linux

Operating system version

Ubuntu 23.04

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the nightly build
  • My request contains all necessary details
@alessio-perugini alessio-perugini added the type: enhancement Proposed improvement label Sep 13, 2023
@per1234 per1234 added the topic: code Related to content of the project itself label Sep 14, 2023
zvonler added a commit to zvonler/arduino-cli that referenced this issue Sep 22, 2023
@zvonler
Copy link
Contributor

zvonler commented Sep 22, 2023

Just opened a PR that I believe resolves this issue. This is my first time writing any Go code (except for the sample program I used to work this out), so please check it carefully and let me know what can be better.

The intent is to print a timestamp before the first character of each line. Any characters received without an included newline are still echoed to the output immediately, and only the first character received after each newline will cause the timestamp output.

#2336

zvonler added a commit to zvonler/arduino-cli that referenced this issue Sep 22, 2023
zvonler added a commit to zvonler/arduino-cli that referenced this issue Sep 22, 2023
@alessio-perugini alessio-perugini linked a pull request Sep 25, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants