Hello,
I am trying to use python library to read/write to serial of ESP. The interface is initialized as below, however ESP32 resets when I run the code. How can I fix this? I am running the code on Windows PC. Many thanks!
ser = serial.Serial(
port = com_port,\
baudrate = baud_rate,\
parity=serial.PARITY_NONE,\
stopbits=serial.STOPBITS_ONE,\
bytesize=serial.EIGHTBITS,\
dsrdtr=0,\
rtscts=0,\
xonxoff =1,\
timeout=2)
[solved] ESP32 resets when using python Serial library
[solved] ESP32 resets when using python Serial library
Last edited by natdf2d on Thu Aug 17, 2023 11:11 am, edited 1 time in total.
-
- Posts: 1708
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: ESP32 resets when using python Serial library
https://stackoverflow.com/a/68914329
"You need to set RTS and DTR to False before opening the port"
"You need to set RTS and DTR to False before opening the port"
Re: ESP32 resets when using python Serial library
Hi, yes, I also tried that:
ser = serial.Serial(
port = com_port,\
baudrate = baud_rate,\
parity=serial.PARITY_NONE,\
stopbits=serial.STOPBITS_ONE,\
bytesize=serial.EIGHTBITS,\
timeout=2,\
dsrdtr=False,\
rtscts=False)
Still the same behavior.
I also tried this https://heepy.net/index.php/Prevent_win ... trol_lines but also no improvement.
ser = serial.Serial(
port = com_port,\
baudrate = baud_rate,\
parity=serial.PARITY_NONE,\
stopbits=serial.STOPBITS_ONE,\
bytesize=serial.EIGHTBITS,\
timeout=2,\
dsrdtr=False,\
rtscts=False)
Still the same behavior.
I also tried this https://heepy.net/index.php/Prevent_win ... trol_lines but also no improvement.
-
- Posts: 1708
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: ESP32 resets when using python Serial library
Just tried, thanks so much, that does seem to work. I thought that setting dsrdtr=False is the same as ser.setDTR(False), my bad. Appreciate your help!
Who is online
Users browsing this forum: Baidu [Spider] and 110 guests