goliatone / node-esp

An ESP8266 command line interface.
5 stars 1 forks source link

Handle esptool error when port is busy #19

Closed goliatone closed 8 years ago

goliatone commented 8 years ago

Check the port is available before issuing the esp flash command- new issue.

PYTHON ERROR:
Traceback (most recent call last):
  File "/Users/goliatone/.nvm/versions/node/v0.12.4/lib/node_modules/node-esp/scripts/esptool.py", line 724, in <module>

PYTHON ERROR:
    main()
  File "/Users/goliatone/.nvm/versions/node/v0.12.4/lib/node_modules/node-esp/scripts/esptool.py", line 575, in main
    esp = ESPROM(args.port, args.baud)
  File "/Users/goliatone/.nvm/versions/node/v0.12.4/lib/node_modules/node-esp/scripts/esptool.py", line 66, in __init__
    self._port = serial.Serial(port)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyserial-2.7-py2.7.egg/serial/serialutil.py", line 282, in __init__
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyserial-2.7-py2.7.egg/serial/serialposix.py", line 289, in open
OSError: [Errno 16] Resource busy: '/dev/cu.SLAB_USBtoUART'
goliatone commented 8 years ago

Also, note that if you have RST mapped to DO for deep-sleep, then esptool will fail.