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

Failing in a pipx environment (ESPTOOL-966) #1036

Closed
wilmer-suarez-simplisafe opened this issue Nov 20, 2024 · 3 comments
Closed

Failing in a pipx environment (ESPTOOL-966) #1036

wilmer-suarez-simplisafe opened this issue Nov 20, 2024 · 3 comments

Comments

@wilmer-suarez-simplisafe

Operating System

Windows 11 VM

Esptool Version

4.8.1

Python Version

3.12.7

Full Esptool Command Line that Was Run

subprocess.check_output("esptool -p COM3 -b 115200 --after no_reset erase_region 0x10000 0x2000", shell=True).decode()

Esptool Output

Exception Output:

CalledProcessError:
esptool -p COM3 -b 115200 --after no_reset erase_region 0x10000 0x2000' returned non-zero exit status 1.

stdout: b''
stderr: None

What is the Expected Behaviour?

I'm running a Python application that is installed using a pyproject wheel with pipx. I'm calling a series of subprocess check_output calls to erase and write to and ESP device. I keep getting the above error.

If I run the application manually/locally in my own virtual environment, it is successful. I've ensured the dependencies are identical.

More Information

Edition - Windows 11 Pro (Virtual Machine)
Version - 23H2
OS build - 22631.4460
Experience - Windows Feature Experience Pack 1000.22700.1047.0

Other Steps to Reproduce

No response

@github-actions github-actions bot changed the title Failing in a pipx environment Failing in a pipx environment (ESPTOOL-966) Nov 20, 2024
@dobairoland
Copy link
Collaborator

Hi @wilmer-suarez-simplisafe.

start it with subprocess.run() and without shell=True and you will see the full error output.

But if you use esptool from a Python script then it would be better to import esptool and use it that way without creating separate processes.

@wilmer-suarez-simplisafe
Copy link
Author

What would the equivalent calls using esptool directly be?
Also, do you know if it's possible to monitor the progress of writing to flash without using subprocess call (that's the main reason I'm using it here)?

@dobairoland
Copy link
Collaborator

dobairoland commented Nov 22, 2024

You can see here an example of using read_flash. You can use others the same way. There is a more comprehensive example in #1029.

I'm closing this because this is not an esptool issue.

@dobairoland dobairoland closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants