You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Correctly returns an instance if the ESP device is connected.
However, if there is no ESP device attached to the ESP-PROG the function timeouts and raises FatalError.
This is totally expected behaviour.
The problem is that when this happens the serial port is not correctly closed and so if get_default_connected_device() is placed inside a loop the following calls to said function will never work. Even if you connect an ESP device. /dev/ttyUSB1 failed to connect: Could not open /dev/ttyUSB1, the port is busy or doesn't exist.
I have tried numerous ways to manually close the port. But the serial instance is not available to me.
Is this an issue or am I doing something wrong?
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Behaviour when no ESP device connected using esptool as a module
Behaviour when no ESP device connected using esptool as a module (ESPTOOL-980)
Dec 20, 2024
Hi @mbastida123, the esptool as python package can be used with context manager. We recently added the section into the documentation, so you can take a look here. It should ensure that port is properly closed afterwards. Hope it helps.
Operating System
Debian GNU/Linux 12 (bookworm)
Esptool Version
esptool==4.8.1
Python Version
Python 3.11.2
Full Esptool Command Line that Was Run
No response
Esptool Output
I'm making a script on python to program some ESP devices via a GUI.
The line:
Correctly returns an instance if the ESP device is connected.
However, if there is no ESP device attached to the ESP-PROG the function timeouts and raises
FatalError
.This is totally expected behaviour.
The problem is that when this happens the serial port is not correctly closed and so if
get_default_connected_device()
is placed inside a loop the following calls to said function will never work. Even if you connect an ESP device./dev/ttyUSB1 failed to connect: Could not open /dev/ttyUSB1, the port is busy or doesn't exist.
I have tried numerous ways to manually close the port. But the serial instance is not available to me.
Is this an issue or am I doing something wrong?
The text was updated successfully, but these errors were encountered: