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

Release COM port when flash process is finished #37

Closed
amb-jarek opened this issue Oct 4, 2018 · 5 comments
Closed

Release COM port when flash process is finished #37

amb-jarek opened this issue Oct 4, 2018 · 5 comments

Comments

@amb-jarek
Copy link

amb-jarek commented Oct 4, 2018

OS
Windows 7, Windows 10

NodeMCU-PyFlasher version
3.0

Description
When I upload the firmware I'm not able to use Esplorer until I close the flasher. It looks that COM port is still locked.

Expected behavior
COM port can be used by any other app as soon as Flasher finish his job - without closing it.

@marcelstoer
Copy link
Owner

marcelstoer commented Oct 21, 2018

The PyFlasher doesn't do a hard reset after flashing on purpose. This was changed about a year ago after discussions in #22. Please see if the reasons stated there make sense to you as well.

Note that hard reset and locked COM port are related but not exactly the same. On my Mac for example the serial port is not locked after flashing; even w/o the hard reset.

@amb-jarek
Copy link
Author

amb-jarek commented Oct 21, 2018

I'm not sure if this is my case. When I flash new firmware using nodemcu-pyflasher the port is locked even if I restart my ESP module or even power it off and on.

The important thing which I forgot to mention is that I'm not using Nodemcu Board but regular ESP-07 module connected through USB to TTL Serial adapter (FTDI).

The problem here is that not ESP module itself but USB serial adapter is locked and can't be opened by any app (ESPlorer, putty, or any other terminal client) untill nodemcu-pyflasher is closed.

So if hard reset has been removed from flasher and esptool.py doesn't hung up on the serial connection anymore, something else has to hold serial locked.

@marcelstoer
Copy link
Owner

I'm afraid there's nothing I can do here, sorry. I'll close it for a number of reasons:

  • too many variables
    • OS
    • driver
    • serial adapter
  • none of my test devices ever showed this behavior
  • the PyFlasher is just a GUI for esptool.py, maybe search for open issues or help there

@amb-jarek
Copy link
Author

@marcelstoer
I'm using newest version of esptool (v2.5.1) without any issues, but it looks that problem maybe located there indeed. As I see you are using esptool v2.2 in the flasher, right?

I just checked the esptool changelog and I found interesting entry in v2.4.0 which is:

Explicitly close the serial port at end of main() function (allows calling
esptool.main() from another Python program for basic scripting.)

so it could be the reason that flasher locks the serial port while esptool (newest) executed directly not.

@marcelstoer
Copy link
Owner

Right, currently still on 2.2.1. I had wanted to upgrade for quite a while as v2.4 brought auto-serial port detection (which means I could potentially remove a GUI field).

In a fork I maintain for my side business I already upgraded to 2.5 - was straight forward.

I created #38 for that.

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

2 participants