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

Get esptool output to stream #29

Open
goatchurchprime opened this issue Apr 19, 2018 · 1 comment
Open

Get esptool output to stream #29

goatchurchprime opened this issue Apr 19, 2018 · 1 comment

Comments

@goatchurchprime
Copy link
Owner

Running this from command line:

esptool.py --port /dev/ttyUSB4 erase_flash

gives

esptool.py v2.0
Connecting....
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...

Whereas in Python,

import subprocess
process = subprocess.Popen("esptool.py --port /dev/ttyUSB4 erase_flash".split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in process.stdout:
    print([line])

hangs on the second line until you pull the USB cable out. It's as if esptool is not calling flush() on the buffers, but the command line case is able to pull the bytes out anyway.

@goatchurchprime
Copy link
Owner Author

Possibly the holdup is not pressing the PRG button when you should. I have inserted a message into the flow of output that prints when it gets to the "Connecting...." line

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

No branches or pull requests

1 participant