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

Add deassert_rts_dtr option to force RTS/DTR low when using miniterm #2089

Merged
merged 2 commits into from Aug 10, 2021

Conversation

agners
Copy link
Contributor

@agners agners commented Jul 28, 2021

What does this implement/fix?

By default RTS/DTR seem to be True (-> 0 since low active). Most ESP32
boards have a pair of transistors to keep Reset/strapping GPIO as-is
when both RTS/DTR are either True or False.
See: https://raw.githubusercontent.com/nodemcu/nodemcu-devkit/master/Documents/NODEMCU_DEVKIT_SCH_BIG.png

If RTS/DTR are connected to Reset/strapping GPIO directly we'd prefer to have
RTS/DTR False (-> 1 since low active). In theory, we could set it to False
always, since the above mentioned logic makes sure nothing happens if both
signals are False.

However, on some platforms (e.g. Linux) setting them to False leads to toggling
when opening which causes a reset.

This introduces a new config "low_rts_dtr" which allows to set the
signals low if required by the board.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes esphome/issues#1382

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#1348

Test Environment

  • ESP32
  • ESP8266

Example entry for config.yaml:

logger:
  deassert_rts_dtr: true

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

By default RTS/DTR seem to be True (-> 0 since low active). Most ESP32
boards have a pair of transistors to keep Reset/strapping GPIO as-is
when both RTS/DTR are either True _or_ False.
See: https://raw.githubusercontent.com/nodemcu/nodemcu-devkit/master/Documents/NODEMCU_DEVKIT_SCH_BIG.png

If RTS/DTR are connected to Reset/strapping GPIO directly we'd prefer to have
RTS/DTR False (-> 1 since low active). In theory, we could set it to False
always, since the above mentioned logic makes sure nothing happens if both
signals are False.

However, on some platforms (e.g. Linux) setting them to False leads to toggling
when opening which causes a reset.

This introduces a new config "low_rts_dtr" which allows to set the
signals low if required by the board.
@probot-esphome
Copy link

Hey there @esphome/core, mind taking a look at this pull request as its been labeled with an integration (logger) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@project-bot project-bot bot added this to Needs Review in ESPHome Dev Jul 28, 2021
Copy link
Member

@OttoWinter OttoWinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Docs need to be updated though

ESPHome Dev automation moved this from Needs Review to Reviewer Approved Jul 29, 2021
@agners
Copy link
Contributor Author

agners commented Jul 29, 2021

Now that I write the documentation, I don't like low_rts_dtr: RTS and DTR are often low active in TTL. So setting the signals to false leads to a high voltage level on the effective TTL lines. How about deassert_rts_dtr?

@agners agners changed the title Add low_rts_dtr option to force RTS/DTR low when using miniterm Add deassert_rts_dtr option to force RTS/DTR low when using miniterm Jul 29, 2021
@OttoWinter
Copy link
Member

OttoWinter commented Jul 29, 2021

How about deassert_rts_dtr?

Works for me 👍

Copy link
Member

@jesserockz jesserockz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked for my C3

@jesserockz jesserockz merged commit e5366db into esphome:dev Aug 10, 2021
ESPHome Dev automation moved this from Reviewer Approved to Done Aug 10, 2021
This was referenced Aug 11, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2021
ESPHome Dev automation moved this from Done to Reviewer Approved Sep 23, 2023
ESPHome Dev automation moved this from Reviewer Approved to Done Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging this pull request may close these issues.

Clear RTS and DTR in serial console
3 participants