esp32 idf in vsc, build flash working, can't monitor

trustmiao
Posts: 43
Joined: Mon Aug 06, 2018 5:16 am

esp32 idf in vsc, build flash working, can't monitor

Postby trustmiao » Wed Apr 29, 2020 5:15 am

I installed idf3.3 with python 3.8. in windows CMD tested ok. and then installed "espressif idf 0.2.1" in vsc, after a successful installation. In f1 menu, "esp-idf build", "esp-idf flash" all work perfectly. However, when I try to use "esp-idf monitor", it is error :

Code: Select all

G:\esp32_apps\blink>set IDF_PATH=G:\esp_vsc\esp-idf

G:\esp32_apps\blink>G:\esp_vsc\.espressif\python_env\idf3.3_py3.8_env\Scripts\python.exe G:\esp_vsc\esp-idf\tools\idf.py -p COM7 monitor
Traceback (most recent call last):
  File "G:\esp_vsc\esp-idf\tools\idf.py", line 635, in <module>
    if ('MSYSTEM' in os.environ) and (not os.environ['_'].endswith(WINPTY_EXE) and WINPTY_VAR not in os.environ):
  File "G:\python38\lib\os.py", line 673, in __getitem__
    raise KeyError(key) from None
KeyError: '_'
if I open CMD and execute idf.py monitor in thr project folder, it works. I've reinstalled idf, vsc, and vsc espressif plugin, doesn't help. all help will be welcome

User avatar
ESP_Roland
Posts: 265
Joined: Tue Oct 09, 2018 10:28 am

Re: esp32 idf in vsc, build flash working, can't monitor

Postby ESP_Roland » Wed Apr 29, 2020 6:28 am

Hi trustmiao,

please check the content of your PATH environment variable. It seems that it invokes the MSYS python. The path to Python which you installed for Windows CMD must be earlier in PATH then the path pointing to the MSYS binary directory.

trustmiao
Posts: 43
Joined: Mon Aug 06, 2018 5:16 am

Re: esp32 idf in vsc, build flash working, can't monitor

Postby trustmiao » Wed Apr 29, 2020 7:42 am

ESP_Roland wrote:
Wed Apr 29, 2020 6:28 am
Hi trustmiao,

please check the content of your PATH environment variable. It seems that it invokes the MSYS python. The path to Python which you installed for Windows CMD must be earlier in PATH then the path pointing to the MSYS binary directory.
G:\esp_vsc\.espressif\python_env\idf3.3_py3.8_env\Scripts
i guessed that too. however, it is on thop of my PATH, and under windows it works alright. if it's the link to python not corrent, why build and flash will work. i could not figure out. However, when vsc open terminal for espidf-monitor(cmd), idf.py build doesn't work under this termial as well. how can I set up this terminal, while the cmd from windows prompt or explorer works alright.

User avatar
ESP_Roland
Posts: 265
Joined: Tue Oct 09, 2018 10:28 am

Re: esp32 idf in vsc, build flash working, can't monitor

Postby ESP_Roland » Wed Apr 29, 2020 9:24 am

Are you checking the value of PATH from inside VSCode terminal? Because I think there it is incorrect.

trustmiao
Posts: 43
Joined: Mon Aug 06, 2018 5:16 am

Re: esp32 idf in vsc, build flash working, can't monitor

Postby trustmiao » Thu Apr 30, 2020 8:42 am

ESP_Roland wrote:
Wed Apr 29, 2020 9:24 am
Are you checking the value of PATH from inside VSCode terminal? Because I think there it is incorrect.
I totally agree, i will try to reset the path in terminal , will see can i get it solved

trustmiao
Posts: 43
Joined: Mon Aug 06, 2018 5:16 am

Re: esp32 idf in vsc, build flash working, can't monitor

Postby trustmiao » Thu Apr 30, 2020 9:04 am

it's solved, for record. this computer used to be set up in esp idf in msys environment , there are settings in
"preferences: open settings(json)"
still pointed top msys mingw32, which cause the problem. deleted these , and it is working now. thanks for help

Who is online

Users browsing this forum: Bing [Bot] and 136 guests