Page 1 of 1

ESP-IDF VScode monitor

Posted: Sat Jan 09, 2021 10:43 pm
by Piskun
I made an update to IDF 6.0 and now monitor not working. It stops like this:

Code: Select all

Copyright (C) Microsoft Corporation. All rights reserved.

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

PS D:\GDrive\programing\ESP32\ESP32_VScode\UV> $Env:Path = "
>> $Env:IDF_PATH = "
PS D:\GDrive\programing\ESP32\ESP32_VScode\UV> $Env:IDF_TARGET = "
>> $Env:PYTHON = "
PS D:\GDrive\programing\ESP32\ESP32_VScode\UV> $Env:IDF_PYTHON_ENV_PATH = "
>> cls
>> C:\Users\pisku\.espressif\python_env\idf4.1_py3.8_env\Scripts\python.exe C:\Users\pisku\esp-idf\tools\idf.py -p COM13 monitor
>> 
Any help?

Re: ESP-IDF VScode monitor

Posted: Mon Jan 11, 2021 4:41 am
by OllieK
I started to see the same error messages after an update to IDF 0.6.0. Before that I was able to use the Monitor, but not to do any debugging. I did upgrade the esp-idf to 4.2 at the same time. After that, the Monitor did not work, but the debugging started to work. Then I did downgrade back to 4.1, but that gave the same Monitor error messages.

My guess is that the problem is in PowerShell scripts and Python paths. At the moment, even the basic idf.py is not working in the Monitor console. Normally the commands are in yellow and now they are blue.

Re: ESP-IDF VScode monitor

Posted: Mon Jan 11, 2021 5:18 pm
by juliuzz
Hello,
I have the same problem after the update of esp to 4.2. It is in blue because the system thinks they are strings as they are not closed.

Code: Select all

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

PS C:\Users\juliuzz\Espressif_projects\helloworld> $Env:Path = "      
>> $Env:IDF_PATH = "
PS C:\Users\juliuzz\Espressif_projects\helloworld> $Env:IDF_TARGET = "
>> $Env:PYTHON = "
PS C:\Users\juliuzz\Espressif_projects\helloworld> $Env:IDF_PYTHON_ENV_PATH = "
>> cls
>> C:\Users\juliuzz\.espressif\python_env\idf4.2_py3.9_env\Scripts\python.exe C:\Users\juliuzz\esp-idf\tools\idf.py -p COM6 monitor

Re: ESP-IDF VScode monitor

Posted: Tue Jan 12, 2021 5:25 am
by OllieK
As a temporary workaround for the missing Monitor output, I am taking the following steps

1) In menu line, select Terminal, New Terminal (or Ctr_Shift_`)
2) In the opened cmd terminal, write the following commands
c:\esp\esp-idf\export
idf.py -p com5 monitor

In your setup, the export.bat file could be in C:\Users\yourName\esp=idf and the target could be connected to a different port than com5

PS. I did broke my ESP-Prog and have not been able to continue with the low level debugger testing. In practice, I have seen the debugger to work only once with ESP-IDF-Extension. The ESP32 debugging and ESP32-S2 usage have been very FRUSTATING.

PPS. The ESP32-S2-DevKitM-1 is really nice development board. :ugeek:

Re: ESP-IDF VScode monitor

Posted: Wed Jan 13, 2021 12:19 am
by OllieK
To reduce the required keystrokes, I did create file ExportPath.txt into my project. I has only one line

Code: Select all

	C:\Users\Olavi\esp\esp-idf\export && idf.py -p com5 monitor
After opening the cmd terminal, I do copy paste this line to the terminal to start the serial monitor with the faulty IDF Extension 0.6.0. I hope, that this is not required once the 0.6.1 is released during the coming weeks. Change the user name and com port number to match your system.

To eliminate the <stdio.h> complaints, I did modify the c_cpp_properties.json file by adding the following line for the includePath and browse items

Code: Select all

	"C:/Users/Olavi/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/xtensa-esp32-elf/include"
Modify your path references to match the xtensa-esp32 version in your system.

Re: ESP-IDF VScode monitor

Posted: Thu Jan 14, 2021 2:44 pm
by Albert_ABUS
After the help of the others from former answers to this problem i tried to create a batch which starts the monitor with just starting this batch:

C:\Users\XXX\esp\esp-idf\export && cd C:\Users\XXX\esp\Projects\exampleProject && idf.py -p com4 monitor

what means <Path to export Batch> && <Path to Project folder with cmakelist> && <Monitor cmd>

with best regards

Albert

Re: ESP-IDF VScode monitor

Posted: Sun Jan 17, 2021 6:21 pm
by eggnogg
If you want to implement the fix that's on github without recompiling anything go to :
"C:\Users\%username%\.vscode\extensions\espressif.esp-idf-extension-0.6.0\dist"

open "extension.js", then find and replace
  1. function Be(e,t){const n=i.basename(o.env.shell);let r={"cmd.exe":'set "VARIABLE=',"powershell.exe":'$Env:VARIABLE = "',"pwsh.exe":'$Env:VARIABLE = "'};return"win32"===process.platform?r[n].replace("VARIABLE",e):`export ${e}="${t[e]}"`}
with
  1. function Be(e,t){const n=i.basename(o.env.shell);switch(r){case"cmd.exe":return`set ${e}="${t[e]}"`;case"powershell.exe":case"pwsh.exe":return`$Env:${e}="${t[e]}"`;default:return`export ${e}="${t[e]}"`}}
and

Code: Select all

/^v(\d+)(?:\.)?(\d+)?(?:\.)?(\d+)?.*/
with

Code: Select all

/v(\d+)(?:\.)?(\d+)?(?:\.)?(\d+)?.*/
Source:
https://github.com/espressif/vscode-esp ... 5cca2adc2c

Re: ESP-IDF VScode monitor

Posted: Sun Jan 17, 2021 6:43 pm
by dym.kyiv
There is away to fix it.
Go to VSCode Setting by Ctrl + ,
Type Terminal into Search box terminal.integrated.shell.windows
and edit settings.json file by adding a line "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
after that restart VSCode and try to Monitor your device

Re: ESP-IDF VScode monitor

Posted: Thu Jan 21, 2021 3:03 am
by OllieK
Thanks for Espressif IDF 0.6.1, this problem in 0.6.0 is now fixed.