Note: I want to use cmd to run a monitor command because I am trying to write a Python script to automate factory testing. The script should use subprocess to run that monitor command and terminate that command when a certain string is observed in the output, and then use that string later. I tried making subprocess open mingw32.exe to run that command but it seems like subprocess cannot live capture the output of an opened terminal properly. I also tried writing a shell script to be ran with mingw32.exe, but that did not work either.
I kind of messed up my environment variables a while ago, but I think I fixed it. I have the following environment variables set up:
Code: Select all
PROJECT_DIR = C:\Users\james\factory\factory-test\panel-table
IDF_PATH = %PROJECT_DIR%\esp-idf
PATH =
%SystemRoot%\system32
%SystemRoot%
%SystemRoot%\System32\Wbem
%SystemRoot%\System32\WindowsPowerShell\v1.0\
%SystemRoot%\System32\OpenSSH\
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\Program Files (x86)\GtkSharp\2.12\bin
C:\Program Files\dotnet\
C:\Program Files (x86)\Skype\Phone\
C:\Program Files\Git\cmd
C:\Program Files\PuTTY\
C:\Program Files\CMake\bin
C:\Users\james\AppData\Local\Programs\Python\Python37
C:\Users\james\AppData\Local\Programs\Microsoft VS Code\bin
C:\msys32\usr\bin
C:\MinGW\msys\1.0\bin
C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin
C:\MinGW\bin
C:\msys32\opt\xtensa-esp32-elf\bin
However, running "make monitor" in cmd outputs the following:
Code: Select all
C:\msys32\home\james\esp\hello_world>make monitor
WARNING: Toolchain version is not supported: 1.22.0-73-ge28a011
Expected to see version: 1.22.0-80-g6c4433a
Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.
MONITOR
Traceback (most recent call last):
File "C:/Users/james/factory/factory-test/panel-table/esp-idf/tools/idf_monitor.py", line 754, in <module>
main()
File "C:/Users/james/factory/factory-test/panel-table/esp-idf/tools/idf_monitor.py", line 670, in main
p=serial_instance))
File "C:/Users/james/factory/factory-test/panel-table/esp-idf/tools/idf_monitor.py", line 72, in yellow_print
color_print(message, ANSI_YELLOW)
File "C:/Users/james/factory/factory-test/panel-table/esp-idf/tools/idf_monitor.py", line 69, in color_print
sys.stderr.write("%s%s%s\n" % (color, message, ANSI_NORMAL))
File "C:/Users/james/factory/factory-test/panel-table/esp-idf/tools/idf_monitor.py", line 736, in write
m = re.match(RE_ANSI_COLOR, self.matched)
File "C:\Users\james\AppData\Local\Programs\Python\Python37\lib\re.py", line 173, in match
return _compile(pattern, flags).match(string)
TypeError: cannot use a bytes pattern on a string-like object
make: *** [/c/Users/james/factory/factory-test/panel-table/esp-idf/components/esptool_py/Makefile.projbuild:106: monitor] Error 1
Code: Select all
C:\Users\james\factory\factory-test\panel-table\esp-idf/make/project.mk:61: esp-idf build system only supports MSYS2 in "MINGW32" mode. Consult the ESP-IDF documentation for details.
WARNING: Failed to find Xtensa toolchain, may need to alter PATH or set one in the configuration menu
MONITOR
Traceback (most recent call last):
File "C:/Users/james/factory/factory-test/panel-table/esp-idf/tools/idf_monito
r.py", line 754, in <module>
main()
File "C:/Users/james/factory/factory-test/panel-table/esp-idf/tools/idf_monito
r.py", line 670, in main
p=serial_instance))
File "C:/Users/james/factory/factory-test/panel-table/esp-idf/tools/idf_monito
r.py", line 72, in yellow_print
color_print(message, ANSI_YELLOW)
File "C:/Users/james/factory/factory-test/panel-table/esp-idf/tools/idf_monito
r.py", line 69, in color_print
sys.stderr.write("%s%s%s\n" % (color, message, ANSI_NORMAL))
File "C:/Users/james/factory/factory-test/panel-table/esp-idf/tools/idf_monito
r.py", line 736, in write
m = re.match(RE_ANSI_COLOR, self.matched)
File "C:\Users\james\AppData\Local\Programs\Python\Python37\lib\re.py", line 1
73, in match
return _compile(pattern, flags).match(string)
TypeError: cannot use a bytes pattern on a string-like object
make: *** [/c/Users/james/factory/factory-test/panel-table/esp-idf/components/esptool_py/Makefile.projbuild:106: monitor] Error 1