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

[Bug Report]: Monitor fails in vscode after updating to 0.6.0 (VSC-526) #266

Closed
bpietsch opened this issue Jan 4, 2021 · 33 comments · Fixed by #274 or #337
Closed

[Bug Report]: Monitor fails in vscode after updating to 0.6.0 (VSC-526) #266

bpietsch opened this issue Jan 4, 2021 · 33 comments · Fixed by #274 or #337
Assignees
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue)
Milestone

Comments

@bpietsch
Copy link

bpietsch commented Jan 4, 2021

Describe the bug
After flashing (successfully), the Monitor terminal appears and prints out a couple of lines showing what appears to be the PATH environment variable. After that, no additional output. Reverting to the 0.5.1 plugin allows it to work again.

To Reproduce
Choose the build, flash and monitor option (or just monitor if device is already flashed)
View monitor output terminal in vscode - notice nothing is shown (beyond some environment variable output)

Expected behavior
Monitor to show serial output as it did in 0.5.1

Screenshots
Screen Shot 2021-01-04 at 10 23 13 AM

Environment (please complete the following information):

  • OS Name & Version: MacOS X 11.1
  • VSCode Version: 1.52.1
  • ESP-IDF Version: v4.1
  • Python Version: 3.8

Logs
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Socket. (internal/child_process.js:430:11)\n\tat Socket.emit (events.js:223:5)\n\tat Pipe. (net.js:664:12)","level":"error","timestamp":"2021-01-04T17:40:48.171Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Socket. (internal/child_process.js:430:11)\n\tat Socket.emit (events.js:223:5)\n\tat Pipe. (net.js:664:12)","level":"error","timestamp":"2021-01-04T17:45:58.002Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)","level":"error","timestamp":"2021-01-04T17:51:40.458Z"}
{"message":"ESP-IDF Terminal process ended with exit code 1.","stack":"Error: ESP-IDF Terminal process ended with exit code 1.\n\tat ChildProcess. (/Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:258876)\n\tat ChildProcess.emit (events.js:223:5)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)","level":"error","timestamp":"2021-01-04T17:51:47.609Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Socket. (internal/child_process.js:430:11)\n\tat Socket.emit (events.js:223:5)\n\tat Pipe. (net.js:664:12)","level":"error","timestamp":"2021-01-04T17:52:35.726Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)","level":"error","timestamp":"2021-01-04T17:52:54.844Z"}
{"message":"ESP-IDF Terminal process ended with exit code 1.","stack":"Error: ESP-IDF Terminal process ended with exit code 1.\n\tat ChildProcess. (/Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:258876)\n\tat ChildProcess.emit (events.js:223:5)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)","level":"error","timestamp":"2021-01-04T17:53:01.187Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)","level":"error","timestamp":"2021-01-04T17:53:25.213Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Socket. (internal/child_process.js:430:11)\n\tat Socket.emit (events.js:223:5)\n\tat Pipe. (net.js:664:12)","level":"error","timestamp":"2021-01-04T17:55:22.215Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-01-04T17:56:25.385Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Socket. (internal/child_process.js:430:11)\n\tat Socket.emit (events.js:223:5)\n\tat Pipe. (net.js:664:12)","level":"error","timestamp":"2021-01-04T17:56:25.507Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-01-04T17:57:25.667Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)","level":"error","timestamp":"2021-01-04T17:57:25.787Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-01-04T17:58:36.425Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)","level":"error","timestamp":"2021-01-04T17:58:36.547Z"}
{"user":true,"message":"Failed to get the eFuse Summary from the chip, please make sure you have selected a valid port","stack":"SyntaxError: /var/folders/m1/ksjmzff53q317v2r9j3j03280000gp/T/espefusejsondump.tmp: Unexpected end of JSON input\n\tat JSON.parse ()\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:8:486068\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:42996\n\tat FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)","level":"error","timestamp":"2021-01-04T18:08:28.181Z"}
{"message":"non zero exit code 1\n\nespefuse.py v2.9-dev\nConnecting.....\nTraceback (most recent call last):\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1017, in \n _main()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1010, in _main\n main()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1004, in main\n efuses = EspEfuses(esp)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 151, in init\n if self["BLK3_PART_RESERVE"].get():\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 253, in get\n return self.get_raw()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 248, in get_raw\n value = self.parent.read_efuse(self.data_reg_offs)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 195, in read_efuse\n return self._esp.read_efuse(addr)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 1362, in read_efuse\n return self.read_reg(self.EFUSE_REG_BASE + (4 * n))\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 520, in read_reg\n val, data = self.command(self.ESP_READ_REG, struct.pack('<I', addr))\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 373, in command\n p = self.read()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 318, in read\n return next(self._slip_reader)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 2190, in slip_reader\n read_bytes = port.read(1 if waiting == 0 else waiting)\n File "/Users/brian/Tools/Espressif/python_env/idf4.1_py3.8_env/lib/python3.8/site-packages/serial/serialposix.py", line 595, in read\n raise SerialException(\nserial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)\n","stack":"Error: non zero exit code 1\n\nespefuse.py v2.9-dev\nConnecting.....\nTraceback (most recent call last):\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1017, in \n _main()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1010, in _main\n main()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1004, in main\n efuses = EspEfuses(esp)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 151, in init\n if self["BLK3_PART_RESERVE"].get():\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 253, in get\n return self.get_raw()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 248, in get_raw\n value = self.parent.read_efuse(self.data_reg_offs)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 195, in read_efuse\n return self._esp.read_efuse(addr)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 1362, in read_efuse\n return self.read_reg(self.EFUSE_REG_BASE + (4 * n))\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 520, in read_reg\n val, data = self.command(self.ESP_READ_REG, struct.pack('<I', addr))\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 373, in command\n p = self.read()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 318, in read\n return next(self._slip_reader)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 2190, in slip_reader\n read_bytes = port.read(1 if waiting == 0 else waiting)\n File "/Users/brian/Tools/Espressif/python_env/idf4.1_py3.8_env/lib/python3.8/site-packages/serial/serialposix.py", line 595, in read\n raise SerialException(\nserial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)\n\n\tat ChildProcess. (/Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:5233)\n\tat ChildProcess.emit (events.js:223:5)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)","level":"error","timestamp":"2021-01-04T18:08:57.846Z"}
{"user":true,"message":"Failed to get the eFuse Summary from the chip, please make sure you have selected a valid port","level":"error","timestamp":"2021-01-04T18:08:57.847Z"}
{"user":true,"message":"Failed to get the eFuse Summary from the chip, please make sure you have selected a valid port","stack":"SyntaxError: /var/folders/m1/ksjmzff53q317v2r9j3j03280000gp/T/espefusejsondump.tmp: Unexpected end of JSON input\n\tat JSON.parse ()\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:8:486068\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:42996\n\tat FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)","level":"error","timestamp":"2021-01-04T18:09:00.380Z"}
{"message":"non zero exit code 1\n\nespefuse.py v2.9-dev\nConnecting......\nTraceback (most recent call last):\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1017, in \n _main()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1010, in _main\n main()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1001, in main\n esp.connect(args.before)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 505, in connect\n last_error = self._connect_attempt(mode=mode, esp32r0_delay=False)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 485, in _connect_attempt\n self.sync()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 423, in sync\n self.command(self.ESP_SYNC, b'\x07\x07\x12\x20' + 32 * b'\x55',\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 373, in command\n p = self.read()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 318, in read\n return next(self._slip_reader)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 2190, in slip_reader\n read_bytes = port.read(1 if waiting == 0 else waiting)\n File "/Users/brian/Tools/Espressif/python_env/idf4.1_py3.8_env/lib/python3.8/site-packages/serial/serialposix.py", line 595, in read\n raise SerialException(\nserial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)\n","stack":"Error: non zero exit code 1\n\nespefuse.py v2.9-dev\nConnecting......\nTraceback (most recent call last):\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1017, in \n _main()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1010, in _main\n main()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/espefuse.py", line 1001, in main\n esp.connect(args.before)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 505, in connect\n last_error = self._connect_attempt(mode=mode, esp32r0_delay=False)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 485, in _connect_attempt\n self.sync()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 423, in sync\n self.command(self.ESP_SYNC, b'\x07\x07\x12\x20' + 32 * b'\x55',\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 373, in command\n p = self.read()\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 318, in read\n return next(self._slip_reader)\n File "/Users/brian/Tools/Espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 2190, in slip_reader\n read_bytes = port.read(1 if waiting == 0 else waiting)\n File "/Users/brian/Tools/Espressif/python_env/idf4.1_py3.8_env/lib/python3.8/site-packages/serial/serialposix.py", line 595, in read\n raise SerialException(\nserial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)\n\n\tat ChildProcess. (/Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:5233)\n\tat ChildProcess.emit (events.js:223:5)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)","level":"error","timestamp":"2021-01-04T18:09:12.669Z"}
{"user":true,"message":"Failed to get the eFuse Summary from the chip, please make sure you have selected a valid port","level":"error","timestamp":"2021-01-04T18:09:12.670Z"}
{"user":true,"message":"Failed to get the eFuse Summary from the chip, please make sure you have selected a valid port","stack":"SyntaxError: /var/folders/m1/ksjmzff53q317v2r9j3j03280000gp/T/espefusejsondump.tmp: Unexpected end of JSON input\n\tat JSON.parse ()\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:8:486068\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:42996\n\tat FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)","level":"error","timestamp":"2021-01-04T18:09:15.210Z"}
{"user":true,"message":"Failed to get the eFuse Summary from the chip, please make sure you have selected a valid port","stack":"SyntaxError: /var/folders/m1/ksjmzff53q317v2r9j3j03280000gp/T/espefusejsondump.tmp: Unexpected end of JSON input\n\tat JSON.parse ()\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:8:486068\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:42996\n\tat FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)","level":"error","timestamp":"2021-01-04T18:09:44.366Z"}
{"user":true,"message":"Failed to get the eFuse Summary from the chip, please make sure you have selected a valid port","stack":"SyntaxError: /var/folders/m1/ksjmzff53q317v2r9j3j03280000gp/T/espefusejsondump.tmp: Unexpected end of JSON input\n\tat JSON.parse ()\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:8:486068\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:42996\n\tat FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)","level":"error","timestamp":"2021-01-04T18:10:06.556Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Socket. (internal/child_process.js:430:11)\n\tat Socket.emit (events.js:223:5)\n\tat Pipe. (net.js:664:12)","level":"error","timestamp":"2021-01-04T18:10:29.516Z"}
{"user":true,"message":"Failed to get the eFuse Summary from the chip, please make sure you have selected a valid port","stack":"SyntaxError: /var/folders/m1/ksjmzff53q317v2r9j3j03280000gp/T/espefusejsondump.tmp: Unexpected end of JSON input\n\tat JSON.parse ()\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:8:486068\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:42996\n\tat FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)","level":"error","timestamp":"2021-01-04T18:10:42.890Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-01-04T18:15:38.802Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Socket. (internal/child_process.js:430:11)\n\tat Socket.emit (events.js:223:5)\n\tat Pipe. (net.js:664:12)","level":"error","timestamp":"2021-01-04T18:15:38.930Z"}
{"message":"Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.10.0-esp32-20191114 (2019-11-14-14:19)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/brian/.vscode/extensions/espressif.esp-idf-extension-0.6.0/dist/extension.js:1:7720\n\tat ChildProcess.exithandler (child_process.js:295:7)\n\tat ChildProcess.emit (events.js:223:5)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Socket. (internal/child_process.js:430:11)\n\tat Socket.emit (events.js:223:5)\n\tat Pipe. (net.js:664:12)","level":"error","timestamp":"2021-01-04T18:22:16.056Z"}

@bpietsch bpietsch added the bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue) label Jan 4, 2021
@github-actions github-actions bot changed the title [Bug Report]: Monitor fails in vscode after updating to 0.6.0 [Bug Report]: Monitor fails in vscode after updating to 0.6.0 (VSC-526) Jan 4, 2021
@kosnox
Copy link

kosnox commented Jan 4, 2021

I have the same problem but this is my log

C:\Users\Michal\Desktop\esp-idf-webserver>C:\Users\Michal\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe C:\Users\Michal\esp-idf\tools\idf.py -p COM3 monitor Traceback (most recent call last): File "C:\Users\Michal\esp-idf\tools\idf.py", line 784, in <module> main() File "C:\Users\Michal\esp-idf\tools\idf.py", line 700, in main checks_output = check_environment() File "C:\Users\Michal\esp-idf\tools\idf.py", line 68, in check_environment print_idf_version() File "C:\Users\Michal\esp-idf\tools\idf.py", line 117, in print_idf_version version = idf_version() File "C:\Users\Michal\esp-idf\tools\idf_py_actions\tools.py", line 56, in idf_version "--git-dir=%s" % os.path.join(os.environ["IDF_PATH"], '.git'), File "E:\PYTHON3\lib\os.py", line 673, in __getitem__ raise KeyError(key) from None KeyError: 'IDF_PATH'

@Asteliks
Copy link

Asteliks commented Jan 4, 2021

I also have the same problem - the monitor dose not open and my log is:

PS C:\Users\axels\Desktop\hello_world> c:\ESP\python_env\idf4.2_py3.9_env\Scripts\python.exe c:\ESP\esp-idf\tools\idf.py -p COM3 monitor Traceback (most recent call last): File "c:\ESP\esp-idf\tools\idf.py", line 784, in <module> main() File "c:\ESP\esp-idf\tools\idf.py", line 700, in main checks_output = check_environment() File "c:\ESP\esp-idf\tools\idf.py", line 68, in check_environment print_idf_version() File "c:\ESP\esp-idf\tools\idf.py", line 117, in print_idf_version version = idf_version() File "c:\ESP\esp-idf\tools\idf_py_actions\tools.py", line 54, in idf_version version = subprocess.check_output([ File "C:\Users\axels\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 420, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Users\axels\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 501, in run with Popen(*popenargs, **kwargs) as process: File "C:\Users\axels\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 947, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\axels\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1416, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] Nie można odnaleźć określonego pliku

VSCode Version: 1.52.1
ESP-IDF Version: v4.2
Python Version: 3.9.1

@marcpiulachs
Copy link

I also have problems.

No error is show but nothing happens:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Source\WiFiStationFirmware> $Env:Path = "

$Env:IDF_PATH = "
PS C:\Source\WiFiStationFirmware> $Env:IDF_TARGET = "
$Env:PYTHON = "
PS C:\Source\WiFiStationFirmware> $Env:IDF_PYTHON_ENV_PATH = "
cls
C:\Users\Marc.espressif\python_env\idf4.3_py3.9_env\Scripts\python.exe C:\Users\Marc\esp\esp-idf\tools\idf.py -p COM9 monitor

@gost-serb
Copy link

Have the same issue.

As a workaround I am able to use user task: CTRL + SHIP + P -> Tasks: Run Task -> Monitor: Start the monitor
Also created a similar task without flash dependency (in case if someone also needs this)

@bpietsch
Copy link
Author

bpietsch commented Jan 4, 2021

OK, after messing around I discovered that re-running the onboarding flow for the extension seems to have resolved the issue. (ESP-IDF: Configure ESP-IDF Extension) Maybe something in the configuration isn't being automatically updated / converted when the new extension version is run the fist time?

@Asteliks
Copy link

Asteliks commented Jan 4, 2021

OK, after messing around I discovered that re-running the onboarding flow for the extension seems to have resolved the issue. (ESP-IDF: Configure ESP-IDF Extension) Maybe something in the configuration isn't being automatically updated / converted when the new extension version is run the fist time?

Unfortunately this did not help in my case

@amalabey
Copy link

amalabey commented Jan 5, 2021

I have the same issue. Serial monitor shows below output:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

C:\Users\username\.vscode\extensions\espressif.esp-idf-extension-0.6.0> $Env:Path = "
>> $Env:IDF_PATH = "
C:\Users\username\.vscode\extensions\espressif.esp-idf-extension-0.6.0> $Env:IDF_TARGET = "
>> $Env:PYTHON = "
C:\Users\username\.vscode\extensions\espressif.esp-idf-extension-0.6.0> $Env:IDF_PYTHON_ENV_PATH = "
>> cls
>> C:\Users\username\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe C:\Users\amal\esp\esp-idf\tools\idf.py -p COM1 monitor

@brainstorm
Copy link

brainstorm commented Jan 5, 2021

Same in OSX, it just writes out a couple of exports and stops:

export PATH="/Users/romanvg/dev/esp-idf/components/esptool_py/esptool:/Users/romanvg/dev/esp-idf/components/espcoredump:/Users/romanvg/dev/esp-idf/components/partition_table:.:/Users/romanvg/.miniconda3/envs/espressif/bin:/Users/romanvg/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin:/Users/romanvg/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin:/Users/romanvg/.espressif/tools/xtensa-esp32s3-elf/esp-2020r3-8.4.0/xtensa-esp32s3-elf/bin:/Users/romanvg/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/Users/romanvg/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/Users/romanvg/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/bin:.:/Users/romanvg/dev/esp-idf/tools:/usr/local/opt/curl/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/[email protected]/bin:/Users/romanvg/.miniconda3/bin:/Users/romanvg/.miniconda3/condabin:/Users/romanvg/.cargo/bin:/usr/local/sbin:/usr/local/heroku/bin:/usr
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.

$ export PATH="/Users/romanvg/dev/esp-idf/components/esptool_py/esptool:/Users/romanvg/dev/esp-idf/components/espcoredump:/Users/romanvg/dev/esp-idf/components/partition_table:.:/Users/romanvg/.miniconda3/envs/espressif/bin:/Users/romanvg/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin:/Users/romanvg/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin:/Users/romanvg/.espressif/tools/xtensa-esp32s3-elf/esp-2020r3-8.4.0/xtensa-esp32s3-elf/bin:/Users/romanvg/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/Users/romanvg/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/Users/romanvg/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/bin:.:/Users/romanvg/dev/esp-idf/tools:/usr/local/opt/curl/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/[email protected]/bin:/Users/romanvg/.miniconda3/bin:/Users/romanvg/.miniconda3/condabin:/Users/romanvg/.cargo/bin:/usr/local/sbin:/usr/local/heroku/bin:/usr

And still does not respect the tasks.json definition since I have a conda activate espressif command defined there (see issue #256 and there's none of that in the output after clicking the monitor button :/

In fact, none of the tasks work after the update :/

EDIT: Fixed all the other tasks by getting rid of Conda environments, but Monitor still does not work after reinstalling.

@brianignacio5
Copy link
Collaborator

Can you share which powershell version (pscore?) terminal are you guys using ? It seems terminal is breaking the PATH somewhere so is not an actual executable line.

@gost-serb
Copy link

Major  Minor  Build  Revision  
-----  -----  -----  --------  
5      1      18362  1171  

Also experiencing the same behavior in the command prompt.

@MisterScience5
Copy link

MisterScience5 commented Jan 5, 2021

Version

5.1.19041.610

Same behaviour for me:

PS E:\ESP\projects\ilume_powersave> $Env:Path = "
>> $Env:IDF_PATH = "
PS E:\ESP\projects\ilume_powersave> $Env:IDF_TARGET = "
>> $Env:PYTHON = "
PS E:\ESP\projects\ilume_powersave> $Env:IDF_PYTHON_ENV_PATH = "
>> cls
>> c:\Users\prebe\esp-tools\python_env\idf4.2_py3.8_env\Scripts\python.exe C:\Users\prebe\esp-idf\tools\idf.py -p COM10 monitor

@kosnox
Copy link

kosnox commented Jan 5, 2021

I have the same problem but this is my log

C:\Users\Michal\Desktop\esp-idf-webserver>C:\Users\Michal\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe C:\Users\Michal\esp-idf\tools\idf.py -p COM3 monitor Traceback (most recent call last): File "C:\Users\Michal\esp-idf\tools\idf.py", line 784, in <module> main() File "C:\Users\Michal\esp-idf\tools\idf.py", line 700, in main checks_output = check_environment() File "C:\Users\Michal\esp-idf\tools\idf.py", line 68, in check_environment print_idf_version() File "C:\Users\Michal\esp-idf\tools\idf.py", line 117, in print_idf_version version = idf_version() File "C:\Users\Michal\esp-idf\tools\idf_py_actions\tools.py", line 56, in idf_version "--git-dir=%s" % os.path.join(os.environ["IDF_PATH"], '.git'), File "E:\PYTHON3\lib\os.py", line 673, in __getitem__ raise KeyError(key) from None KeyError: 'IDF_PATH'

I’ve tried reinstalling ESP-idf but that didn’t help. Still having the same problem

And my version powershell: 5.1.19041.610

@araafario
Copy link

I have the same issue. Serial monitor shows below output:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

C:\Users\username\.vscode\extensions\espressif.esp-idf-extension-0.6.0> $Env:Path = "
>> $Env:IDF_PATH = "
C:\Users\username\.vscode\extensions\espressif.esp-idf-extension-0.6.0> $Env:IDF_TARGET = "
>> $Env:PYTHON = "
C:\Users\username\.vscode\extensions\espressif.esp-idf-extension-0.6.0> $Env:IDF_PYTHON_ENV_PATH = "
>> cls
>> C:\Users\username\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe C:\Users\amal\esp\esp-idf\tools\idf.py -p COM1 monitor

Me too , reinstalling doesnt solve the problem.

@NikitaSyrovatnikov
Copy link

NikitaSyrovatnikov commented Jan 6, 2021

The problem is in file src/extension.ts

Method getTxtCmd on line 2450

The correct code for Window and Linux will

function getTxtCmd(variable: string, modifiedEnv: { [key: string]: string }) {
  if (process.platform === "win32") {
    const shellExecutable = path.basename(vscode.env.shell);
    switch (shellExecutable) {
      case "cmd.exe":
        return `set "${variable}=${modifiedEnv[variable]}`;
      case "powershell.exe":
      case "pwsh.exe":
        return `$Env:${variable}="${modifiedEnv[variable]}"`;
    }
  }
  return `export ${variable}="${modifiedEnv[variable]}"`;
}

You may manually fix this for now and install extension locally. All instructions could be found on official extension page.

@fahadalisarwar1
Copy link

Have the same issue.

As a workaround I am able to use user task: CTRL + SHIP + P -> Tasks: Run Task -> Monitor: Start the monitor
Also created a similar task without flash dependency (in case if someone also needs this)

Not working for me!

@chandini29
Copy link

getTxtCmd

Where is src/extension.ts file located?

@pwmb pwmb removed the help wanted Extra attention is needed label Jan 6, 2021
@pwmb pwmb added this to the v0.6.1 milestone Jan 6, 2021
@gost-serb
Copy link

@chandini29 In this repo. If you want to manually fix this you need to clone this repo, make the fix as @NikitaSyrovatnikov described, and build using this guide: https://github.com/espressif/vscode-esp-idf-extension#build-from-source-code

or just wait till version v0.6.1 will be available 😉

@fahadalisarwar1
Copy link

@chandini29 In this repo. If you want to manually fix this you need to clone this repo, make the fix as @NikitaSyrovatnikov described, and build using this guide: https://github.com/espressif/vscode-esp-idf-extension#build-from-source-code

or just wait till version v0.6.1 will be available 😉

And when will version v0.6.1 be released ?

@Asteliks
Copy link

Asteliks commented Jan 6, 2021

@chandini29 In this repo. If you want to manually fix this you need to clone this repo, make the fix as @NikitaSyrovatnikov described, and build using this guide: https://github.com/espressif/vscode-esp-idf-extension#build-from-source-code
or just wait till version v0.6.1 will be available 😉

And when will version v0.6.1 be released ?

Probably when all v0.6.1 tickets are closed: https://github.com/espressif/vscode-esp-idf-extension/milestone/17

@brainstorm
Copy link

brainstorm commented Jan 8, 2021

EDIT: Nevermind, fixed the extension debug issue on #276 (comment)

@GOST-UA I'm trying to fix another issue and I'm finding that the extension is not so easy to debug, see #276 (comment)

Did you manage to switch to development mode (via yarn debugPreTask?).

@gost-serb
Copy link

@brainstorm I didn't debug this extension on my own - just left a bit more detailed description of how to run it from sources.

@vlad-ivanov-name
Copy link

Somehow I'm still having this problem on 0.6.1 - but only with zsh and omz

@brianignacio5
Copy link
Collaborator

brianignacio5 commented Feb 18, 2021

I've tested on zsh and it was working. Any logs or errors @resetnow ?

@vlad-ivanov-name
Copy link

vlad-ivanov-name commented Feb 18, 2021

Here's how it looks:

image

image

image

Usually I press ctrl-C to reset the shell prompt and then start monitor mode again - second time it works. No error messages appear.

@brianignacio5
Copy link
Collaborator

Which shell are you using for Visual Studio Code ? Apparently is truncating received command text somehow.

@vlad-ivanov-name
Copy link

It's system default - zsh. And it looks to me like it's very similar to the first screenshot in this thread

@brianignacio5
Copy link
Collaborator

I tested it using VSCodium and zsh also but could not reproduce on MacOS.

Maybe you can provide additional information for your setup to further debug the issue

Logs
If applicable, please share the log file which can be obtained from

  • Windows: %USERPROFILE%\.vscode\extensions\espressif.esp-idf-extension-VERSION\esp_idf_vsc_ext.log
  • Linux & MacOSX: $HOME/.vscode/extensions/espressif.esp-idf-extension-VERSION/esp_idf_vsc_ext.log

Extension Configuration settings
Open Command Palette (F1) and type Preferences: Open Settings (JSON) or use {CURRENT_PROJECT}/.vscode/settings.json to get the following extension configuration settings value:

  • idf.espIdfPath (MacOS or Linux) or idf.espIdfPathWin (Windows) also called Path to locate ESP-IDF framework (IDF_PATH) in Preferences: Open Settings (UI).
  • idf.pythonBinPath (MacOS or Linux) or idf.pythonBinPathWin (Windows) also called Python absolute binary path used to execute ESP-IDF Python Scripts in Preferences: Open Settings (UI).
  • idf.openOcdConfigs also called List of configuration files inside OpenOCD Scripts directory in Preferences: Open Settings (UI).
  • idf.customExtraPaths also called Paths to be appended to PATH in Preferences: Open Settings (UI).
  • idf.customExtraVars also called Variables to be added to system environment variables in Preferences: Open Settings (UI).
  • idf.adapterTargetName also called Target name for ESP-IDF Debug Adapter in Preferences: Open Settings (UI).

@vlad-ivanov-name
Copy link

Wow, thank you for going the extra mile to debug it. I'll try to collect all of this this evening.

@vlad-ivanov-name
Copy link

vlad-ivanov-name commented Feb 19, 2021

Here are some additional details:

esp_idf_vsc_ext.log
{"message":"Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:7755\n\tat ChildProcess.exithandler (child_process.js:303:7)\n\tat ChildProcess.emit (events.js:315:20)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)","level":"error","timestamp":"2021-02-14T13:48:35.851Z"}
{"message":"Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:7755\n\tat ChildProcess.exithandler (child_process.js:303:7)\n\tat ChildProcess.emit (events.js:315:20)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Socket.<anonymous> (internal/child_process.js:443:11)\n\tat Socket.emit (events.js:315:20)\n\tat Pipe.<anonymous> (net.js:674:12)","level":"error","timestamp":"2021-02-14T14:48:01.647Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-02-14T15:14:42.422Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-02-14T15:17:43.863Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-02-14T15:18:28.099Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-02-14T15:18:43.272Z"}
{"message":"ESP-IDF Terminal process ended with exit code 1.","stack":"Error: ESP-IDF Terminal process ended with exit code 1.\n\tat ChildProcess.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:264560)\n\tat ChildProcess.emit (events.js:315:20)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)","level":"error","timestamp":"2021-02-14T19:29:25.165Z"}
{"user":true,"message":"Something went wrong while trying to build the project","stack":"Error: Task ESP-IDF Build exited with code 1\n\tat Function.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:47123)\n\tat Generator.next (<anonymous>)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46231\n\tat new Promise (<anonymous>)\n\tat o (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:45976)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46966\n\tat v.fire (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:1836)\n\tat b.$onDidEndTaskProcess (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:48187)\n\tat runMicrotasks (<anonymous>)\n\tat processTicksAndRejections (internal/process/task_queues.js:97:5)","level":"error","timestamp":"2021-02-14T19:29:25.189Z"}
{"message":"ESP-IDF Terminal process ended with exit code 1.","stack":"Error: ESP-IDF Terminal process ended with exit code 1.\n\tat ChildProcess.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:264560)\n\tat ChildProcess.emit (events.js:315:20)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)","level":"error","timestamp":"2021-02-14T19:30:06.262Z"}
{"user":true,"message":"Something went wrong while trying to build the project","stack":"Error: Task ESP-IDF Build exited with code 1\n\tat Function.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:47123)\n\tat Generator.next (<anonymous>)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46231\n\tat new Promise (<anonymous>)\n\tat o (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:45976)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46966\n\tat v.fire (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:1836)\n\tat b.$onDidEndTaskProcess (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:48187)\n\tat runMicrotasks (<anonymous>)\n\tat processTicksAndRejections (internal/process/task_queues.js:97:5)","level":"error","timestamp":"2021-02-14T19:30:06.285Z"}
{"message":"ESP-IDF Terminal process ended with exit code 1.","stack":"Error: ESP-IDF Terminal process ended with exit code 1.\n\tat ChildProcess.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:264560)\n\tat ChildProcess.emit (events.js:315:20)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)","level":"error","timestamp":"2021-02-14T19:30:55.197Z"}
{"user":true,"message":"Something went wrong while trying to build the project","stack":"Error: Task ESP-IDF Build exited with code 1\n\tat Function.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:47123)\n\tat Generator.next (<anonymous>)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46231\n\tat new Promise (<anonymous>)\n\tat o (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:45976)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46966\n\tat v.fire (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:1836)\n\tat b.$onDidEndTaskProcess (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:48187)\n\tat runMicrotasks (<anonymous>)\n\tat processTicksAndRejections (internal/process/task_queues.js:97:5)","level":"error","timestamp":"2021-02-14T19:30:55.222Z"}
{"message":"ESP-IDF Terminal process ended with exit code 1.","stack":"Error: ESP-IDF Terminal process ended with exit code 1.\n\tat ChildProcess.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:264560)\n\tat ChildProcess.emit (events.js:315:20)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)","level":"error","timestamp":"2021-02-14T19:33:20.127Z"}
{"user":true,"message":"Something went wrong while trying to build the project","stack":"Error: Task ESP-IDF Build exited with code 1\n\tat Function.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:47123)\n\tat Generator.next (<anonymous>)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46231\n\tat new Promise (<anonymous>)\n\tat o (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:45976)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46966\n\tat v.fire (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:1836)\n\tat b.$onDidEndTaskProcess (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:48187)\n\tat runMicrotasks (<anonymous>)\n\tat processTicksAndRejections (internal/process/task_queues.js:97:5)","level":"error","timestamp":"2021-02-14T19:33:20.149Z"}
{"user":true,"level":"warn","message":"There is no build directory to clean, exiting!","timestamp":"2021-02-14T19:33:33.683Z"}
{"message":"ESP-IDF Terminal process ended with exit code 1.","stack":"Error: ESP-IDF Terminal process ended with exit code 1.\n\tat ChildProcess.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:264560)\n\tat ChildProcess.emit (events.js:315:20)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)","level":"error","timestamp":"2021-02-14T19:40:56.764Z"}
{"user":true,"message":"Something went wrong while trying to build the project","stack":"Error: Task ESP-IDF Compile exited with code 1\n\tat Function.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:47123)\n\tat Generator.next (<anonymous>)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46231\n\tat new Promise (<anonymous>)\n\tat o (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:45976)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46966\n\tat v.fire (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:1836)\n\tat b.$onDidEndTaskProcess (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:48187)\n\tat runMicrotasks (<anonymous>)\n\tat processTicksAndRejections (internal/process/task_queues.js:97:5)","level":"error","timestamp":"2021-02-14T19:40:56.791Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-02-14T20:03:55.310Z"}
{"message":"ESP-IDF Terminal process ended with exit code 1.","stack":"Error: ESP-IDF Terminal process ended with exit code 1.\n\tat ChildProcess.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:264560)\n\tat ChildProcess.emit (events.js:315:20)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)","level":"error","timestamp":"2021-02-14T20:12:29.217Z"}
{"user":true,"message":"Something went wrong while trying to build the project","stack":"Error: Task ESP-IDF Compile exited with code 1\n\tat Function.<anonymous> (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:47123)\n\tat Generator.next (<anonymous>)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46231\n\tat new Promise (<anonymous>)\n\tat o (/Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:45976)\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:46966\n\tat v.fire (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:1836)\n\tat b.$onDidEndTaskProcess (/Applications/VSCodium.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:48187)\n\tat runMicrotasks (<anonymous>)\n\tat processTicksAndRejections (internal/process/task_queues.js:97:5)","level":"error","timestamp":"2021-02-14T20:12:29.220Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-02-14T20:13:41.939Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-02-18T00:00:03.456Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-02-18T00:06:32.602Z"}
{"user":true,"level":"warn","message":"ESP-IDF Monitor was closed.","timestamp":"2021-02-18T00:11:35.577Z"}
{"message":"Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:7755\n\tat ChildProcess.exithandler (child_process.js:303:7)\n\tat ChildProcess.emit (events.js:315:20)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)","level":"error","timestamp":"2021-02-18T07:11:57.128Z"}
{"message":"Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:7755\n\tat ChildProcess.exithandler (child_process.js:303:7)\n\tat ChildProcess.emit (events.js:315:20)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)","level":"error","timestamp":"2021-02-18T07:12:19.146Z"}
{"message":"Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:7755\n\tat ChildProcess.exithandler (child_process.js:303:7)\n\tat ChildProcess.emit (events.js:315:20)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)","level":"error","timestamp":"2021-02-18T08:21:40.985Z"}
{"message":"Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /Users/vladislavivanov/.vscode-oss/extensions/espressif.esp-idf-extension-0.6.1/dist/extension.js:1:7755\n\tat ChildProcess.exithandler (child_process.js:303:7)\n\tat ChildProcess.emit (events.js:315:20)\n\tat maybeClose (internal/child_process.js:1021:16)\n\tat Socket.<anonymous> (internal/child_process.js:443:11)\n\tat Socket.emit (events.js:315:20)\n\tat Pipe.<anonymous> (net.js:674:12)","level":"error","timestamp":"2021-02-18T20:16:03.989Z"}
All idf.* variables in settings
    "idf.espIdfPath": "/Users/vladislavivanov/Projects/room-garden/tools/esp-idf",
    "idf.pythonBinPath": "/Users/vladislavivanov/.espressif/python_env/idf4.3_py3.9_env/bin/python",
    "idf.customExtraPaths": "/Users/vladislavivanov/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin:/Users/vladislavivanov/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin:/Users/vladislavivanov/.espressif/tools/xtensa-esp32s3-elf/esp-2020r3-8.4.0/xtensa-esp32s3-elf/bin:/Users/vladislavivanov/.espressif/tools/riscv32-esp-elf/1.24.0.123_64eb9ff-8.4.0/riscv32-esp-elf/bin:/Users/vladislavivanov/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/Users/vladislavivanov/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/Users/vladislavivanov/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/bin",
    "idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"/Users/vladislavivanov/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/share/openocd/scripts\"}",

Looking at the behaviour, it seems to me like the issue is the sendText method sending commands way too early. And there doesn't seem to be any synchronisation mechanism:

microsoft/vscode#11383

I think the only reliable way to fix this would be to put commands in a temporary file and then pass it as shellArgs. Or perhaps the whole thing can go into shellArgs.

The reason it's not reproducible is probably because your mac is faster than mine :) but try adding sleep 1 to zshrc maybe?

@vlad-ivanov-name
Copy link

@brianignacio5 I added a 500ms delay in function createMonitor and this solved the issue for me. But in general, proper fix would pass the command you want to execute as shellArgs. I also implemented it that way, but I don't have a Windows machine to test the powershell stuff and I'm not familiar with the code - some parts have logic that needs to be reworked. Would you maybe consider reopening this issue?

By the way, there is one more downside of typing commands into the terminal: they pollute shell history.

@brianignacio5
Copy link
Collaborator

Yes @resetnow this is a whole set of issues in vscode API, basically we are trying to update some environment variables (IDF_PATH, PATH, IDF_TARGET, IDF_PYTHON_ENV_PATH) but the vscode doesn't have a clean way to achieve this yet (options.env just post append variables). The thing with shellArgs is that can only be used when terminal is created and we have several export VAR commands. I'll test some ways and let you try in PR.

@brianignacio5 brianignacio5 reopened this Mar 1, 2021
@vlad-ivanov-name
Copy link

@brianignacio5 thank you for reopening.

My impression is that they intend those terminals to be used in a "stateless" way - create a terminal with a given state, and if you need to change something, dispose of it and create a new one.

@brianignacio5
Copy link
Collaborator

As far as I know, the intended approach is to use environmentVariableCollection but replace or preapprend doesn't work on macOS as shown in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue)
Projects
None yet