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

Clear RTS and DTR in serial console #1382

Closed
jbliesener opened this issue Jul 29, 2020 · 8 comments · Fixed by esphome/esphome#2089
Closed

Clear RTS and DTR in serial console #1382

jbliesener opened this issue Jul 29, 2020 · 8 comments · Fixed by esphome/esphome#2089
Labels

Comments

@jbliesener
Copy link

Operating environment/Installation (Hass.io/Docker/pip/etc.):

Windows 10, pip installation

ESP (ESP32/ESP8266, Board/Sonoff):

ESP-07 (512K Flash)

ESPHome version (latest production, beta, dev branch)

1.14.5

Affected component:

https://esphome.io/guides/getting_started_command_line.html

Description of problem:
I'm using the ESP-07 with only 512K Flash, so I can't use OTA updates, which requires me to use the serial cable. Upload works fine, but after uploading I need to disconnect the RTS and DTR pins to the serial converter, because both lines are held active (low) in the serial terminal and therefore the ESP doesn't start. As soon as I quit the serial terminal from esphome or disconnect RTS and DTR, the program starts.

Problem-relevant YAML-configuration entries:

NOT RELATED TO YAML

Logs (if applicable):

NO LOG

Additional information and things you've tried:

I would suggest to change the code of run_miniterm to something like this:

    ...
    backtrace_state = False
    # Not specifying a port name does not open the port
    with serial.Serial(baudrate=baud_rate) as ser: 
      ser.port = port
      ser.rts = False
      ser.dtr = False
      ser.open()  # open port, set DTR and RTS inactive
      while True:
      ...
@stale
Copy link

stale bot commented Nov 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 27, 2020
@jbliesener
Copy link
Author

Still open

@stale stale bot removed the stale label Nov 27, 2020
@stale
Copy link

stale bot commented Mar 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 27, 2021
@jbliesener
Copy link
Author

Bump?

@stale stale bot removed the stale label Mar 27, 2021
@stale
Copy link

stale bot commented Jul 25, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 25, 2021
@jbliesener
Copy link
Author

Any chance to get this implemented?

@stale stale bot removed the stale label Jul 26, 2021
@agners
Copy link

agners commented Jul 28, 2021

Hm, I have a similar case where RTS# (CHIP_EN) and DTR# (GPIO9/boot loader strapping) are directly connected.

image

Normally there is a logic which makes modules ignore active RTS/DTR signals ("active" is low since those are low active signals).

Anyways, unfortunately it seems that pyserial at least in Linux causes a change of RTS/DTR signals when trying to set them to False by default (high). On modules with the regular logic this leads to resets according to my testing.

But maybe adding this feature as an option makes sense.

@agners
Copy link

agners commented Jul 28, 2021

I wasn't able to set RTS/DTR False without causing a toggling (and hence a reset on other ESP boards).

See also: pyserial/pyserial#124

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants