Open Waganama opened 1 year ago
Hi @Waganama, thanks for the ticket!
It will be implemented as a part of the next major release (v5.0) since it is a breaking change for current scripts relying on reading the stdout output.
I will keep this open until then.
Operating System
Python
Esptool Version
V4.6.1
Python Version
Python 3.11
Full Esptool Command Line that Was Run
esptool -p COM9 --chip esp32 read_mac
Esptool Output
What is the Expected Behaviour?
STDOUT : b'esptool.py v4.6.1\r\nSerial port COM9\r\nConnecting......................................\r\n\r\n
STDERR : b''A fatal error occurred: Failed to connect to ESP32: No serial data received.\r\nFor troubleshooting steps visit:
https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html\r\n'"
More Information
Hello guys, I tried to catch esptool error in stderr from subprocess.Popen with the following code :
def read_mac(self, port) : command = [ESPTOOL_PY, '-p', port, '--chip', 'esp32', 'read_mac'] send_command(command)
def send_command(command: list[str]) : out = subprocess.Popen([sys.executable] + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False) stdout, stderr = out.communicate()
Thanks for your help :)
Other Steps to Reproduce
No response