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]: Can Compile and Flash but not monitor (VSC-611) #356

Closed
orbitcoms opened this issue Mar 23, 2021 · 7 comments · Fixed by #358
Closed

[Bug Report]: Can Compile and Flash but not monitor (VSC-611) #356

orbitcoms opened this issue Mar 23, 2021 · 7 comments · Fixed by #358
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue)

Comments

@orbitcoms
Copy link

I am running vscode on Windows 10 machine. Python 3.9 and git 2.3 are installed

Once this issue showed up I uninstalled vscode and esp-idf and started again. Installed a clean copy of vscode and installed the C/C++ extension and then the esp-idf extension (version 1.0.1) but problem still exists.

My project compiles and flashes ok but when I attempt to run Monitor, I get error "The terminal process failed to launch: Path to shell executable "powershell.exe" does not exist"

I did not see powershell as pre-requisite for the extension so I assumed if it needs it then it will install it?

@orbitcoms orbitcoms 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 Mar 23, 2021
@github-actions github-actions bot changed the title [Bug Report]: Can Compile and Flash but not monitor [Bug Report]: Can Compile and Flash but not monitor (VSC-611) Mar 23, 2021
@0phoff
Copy link

0phoff commented Mar 23, 2021

Not sure if my issue is related, but I think it is, so I will add it here.

I have setup VS Code on my Linux machine (Ubuntu 20.04), so that terminals are opened with a special environment flag.
More specifically, I used this in settings.json, so that my .bashrc file knows not to automatically start TMUX:

{
    "terminal.integrated.env.linux": {
      "NO_TMUX": "1"
    },
}

This is something special about my system, but the important part is that this works when I start a Terminal from VS Code, and also when running the build, clean and flash commands with the little buttons at the bottom of the app or through the command palette.
However, when using the monitor button, it does not obey these rules and starts a regular terminal, which in my case results in a TMUX terminal.

Running the monitor command by going to Terminal > Run Task > Monitor does work!


Note that I do not expect you to completely solve my issue, as I have a highly customized setup, but I think my issue shows that there is a bigger problem with the "ESP-IDF: Monitor your device" command, which might be solved by using the default VS Code terminal and running the monitor command there ?

@brianignacio5
Copy link
Collaborator

brianignacio5 commented Mar 24, 2021

@orbitcoms To launch the ESP-IDF terminal, we use the shell executable given in vscode.env.shell which is override by terminal.integrated.shell.windows in your Visual Studio Code Settings or use the Terminal: Select Default Shell command to update the shell. I have tested in Windows 10 that the IDF Monitor command picks changes in terminal.integrated.shell.windows

More information about vscode terminal configuration

@0phoff about your case, we use environment variables from idf.customExtraVars and other IDF specific settings. You can either set "NO_TMUX": "1" globally in your system or in idf.customExtraVars for the extension to pick this variable.

More information about this extension configuration settings

@orbitcoms
Copy link
Author

orbitcoms commented Mar 24, 2021

I don't understand what this means.
Are you saying the extension does not set the variables or commands required to run the monitor and we do this manually after installing the extension?
I tried Terminal: Default Shell (I tried all 3 options, Powershell failed, bash and cmd both did nothing)

Where do I set this ide.customextravars? do you have steps what I need to change?

I also note: If I do not select default as powershell, the code does not compile. When I change back to default as powershell it compiles but nothing makes monitor work so far

This is my setting in tasks.json

"terminal.integrated.shell.windows": "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe"
"idf.customExtraVars": "{"OPENOCD_SCRIPTS":"C:\\Users\\david\\.espressif\\tools\\openocd-esp32\\v0.10.0-esp32-20200709/openocd-esp32/share/openocd/scripts","IDF_CCACHE_ENABLE":"1"}",

I have been adding comments to my post as I go.

I now removed tasks.json and the monitor works for this project. I will see if removing from other projects also fixes them.

@brianignacio5
Copy link
Collaborator

hey @orbitcoms I guess I found the issue. The problem is we are just using powershell.exe instead of the full path of the shell. Will fix soon.

I guess initially I didn't notice because shell paths are usually in the environment PATH, which makes me believe that for some reason "C:\WINDOWS\System32\WindowsPowerShell\v1.0\ is not in your PATH, which I guess it is by default ?

@orbitcoms
Copy link
Author

Thanks Brian,

I am at office at the moment where the Monitor function does work and the PC does have path to powershell.
I suspect you are right and my home computer does not have path set for powershell.
Does the extension install powershell? If not, what is the best method to install it. (I see online several versions and not sure what is required for ESP-IDF, and assumed it was installed as part of the toolchain when configuring the extension)

@brianignacio5
Copy link
Collaborator

You don't need to install Powershell.exe since it comes with Windows. v1.0 is the old version that comes by default but there are several versions and all should work in my opinion. For the moment, just make sure it is in your system environment variable Path. I will fix the extension so "terminal.integrated.shell.windows": "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" works without any env variable modification.

@orbitcoms
Copy link
Author

orbitcoms commented Mar 25, 2021 via email

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
Development

Successfully merging a pull request may close this issue.

3 participants