G-Two / smoke-x-receiver

An ESP32+LoRa application to bridge a ThermoWorks Smoke X remote thermometer to Home Assistant via MQTT
MIT License
14 stars 5 forks source link

ninja failed with exit code 1, windows popup asking how to open .sh file #18

Open frod123 opened 9 months ago

frod123 commented 9 months ago

I cannot complete the flashing step due to this error:

FAILED: CMakeFiles/www C:/Espressif/frameworks/esp-idf-v4.4/smoke-x-receiver/build/CMakeFiles/www cmd.exe /C "cd /D C:\Espressif\frameworks\esp-idf-v4.4\smoke-x-receiver\build && C:\Espressif\frameworks\esp-idf-v4.4\smoke-x-receiver\web_ui\build.sh C:/Espressif/frameworks/esp-idf-v4.4/smoke-x-receiver/web_ui" /bin/bash: C:\Espressif\frameworks\esp-idf-v4.4\smoke-x-receiver\web_ui\build.sh: No such file or directory

Been tearing my hair out trying to figure out why. I'm sure it's a simple fix. Any ideas? Whenever this step comes up, I get a popup from windows asking how to open the .sh file.

G-Two commented 9 months ago

You'll need to build from a bash environment in windows. WSL2 would be my recommendation.

G-Two commented 9 months ago

Somewhat related to #12

frod123 commented 9 months ago

Thanks, now I get `FAILED: CMakeFiles/www /home/frod123/esp/esp-idf/smoke-x-receiver/build/CMakeFiles/www cd /home/frod123/esp/esp-idf/smoke-x-receiver/build && /home/frod123/esp/esp-idf/smoke-x-receiver/web_ui/build.sh /home/frod123/esp/esp-idf/smoke-x-receiver/web_ui npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in: C:\Users\frod1\AppData\Local\npm-cache_logs\2023-12-04T12_54_34_454Z-debug-0.log

smoke_x_ui@0.0.0 build vite build

'\wsl.localhost\Ubuntu\home\frod123\esp\esp-idf\smoke-x-receiver\web_ui' CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory. 'vite' is not recognized as an internal or external command, operable program or batch file. find: ‘/home/frod123/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory find: ‘/home/frod123/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory find: ‘/home/frod123/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory find: ‘/home/frod123/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory find: ‘/home/frod123/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory find: ‘/home/frod123/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory ninja: build stopped: subcommand failed. ninja failed with exit code 1

Running in ubuntu wsl2 environment `

frod123 commented 9 months ago

So I decided to use a Ubuntu VM instead. Thought it was going better. But it still gets stuck at the same step. With this error.

`storage,data,spiffs,0x210000,1M,


[131/778] cd /home/felix/esp/esp-idf/s...ix/esp/esp-idf/smoke-x-receiver/web_ui FAILED: CMakeFiles/www /home/felix/esp/esp-idf/smoke-x-receiver/build/CMakeFiles/www cd /home/felix/esp/esp-idf/smoke-x-receiver/build && /home/felix/esp/esp-idf/smoke-x-receiver/web_ui/build.sh /home/felix/esp/esp-idf/smoke-x-receiver/web_ui npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@mswjs/cookies@0.2.2', npm WARN EBADENGINE required: { node: '>=14' }, npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@mswjs/interceptors@0.17.9', npm WARN EBADENGINE required: { node: '>=14' }, npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@vitejs/plugin-vue@4.2.1', npm WARN EBADENGINE required: { node: '^14.18.0 || >=16.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'eslint-plugin-vue@9.12.0', npm WARN EBADENGINE required: { node: '^14.17.0 || >=16.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'msw@1.2.1', npm WARN EBADENGINE required: { node: '>=14' }, npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'rollup@3.21.5', npm WARN EBADENGINE required: { node: '>=14.18.0', npm: '>=8.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'vite@4.3.5', npm WARN EBADENGINE required: { node: '^14.18.0 || >=16.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'vue-eslint-parser@9.2.1', npm WARN EBADENGINE required: { node: '^14.17.0 || >=16.0.0' }, npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' } npm WARN EBADENGINE }

up to date, audited 285 packages in 2s

60 packages are looking for funding run npm fund for details

5 vulnerabilities (4 moderate, 1 high)

To address issues that do not require attention, run: npm audit fix

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details.

smoke_x_ui@0.0.0 build vite build

file:///home/felix/esp/esp-idf/smoke-x-receiver/web_ui/node_modules/vite/bin/vite.js:7 await import('source-map-support').then((r) => r.default.install()) ^^^^^

SyntaxError: Unexpected reserved word at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18) at async link (internal/modules/esm/module_job.js:42:21) find: ‘/home/felix/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory find: ‘/home/felix/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory find: ‘/home/felix/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory find: ‘/home/felix/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory find: ‘/home/felix/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory find: ‘/home/felix/esp/esp-idf/smoke-x-receiver/web_ui/dist’: No such file or directory [138/778] Performing configure step for 'bootloader' -- Found Git: /usr/bin/git (found version "2.34.1") -- The C compiler identification is GNU 8.4.0 -- The CXX compiler identification is GNU 8.4.0 -- The ASM compiler identification is GNU -- Found assembler: /root/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /root/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /root/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Building ESP-IDF components for target esp32s3 -- Project sdkconfig file /home/felix/esp/esp-idf/smoke-x-receiver/sdkconfig -- Adding linker script /home/felix/esp/esp-idf/components/soc/esp32s3/ld/esp32s3.peripherals.ld -- Adding linker script /home/felix/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.ld -- Adding linker script /home/felix/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld -- Adding linker script /home/felix/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld -- Adding linker script /home/felix/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld -- Adding linker script /home/felix/esp/esp-idf/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld -- Adding linker script /home/felix/esp/esp-idf/components/bootloader/subproject/main/ld/esp32s3/bootloader.rom.ld -- Components: bootloader bootloader_support efuse esp32s3 esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa -- Component paths: /home/felix/esp/esp-idf/components/bootloader /home/felix/esp/esp-idf/components/bootloader_support /home/felix/esp/esp-idf/components/efuse /home/felix/esp/esp-idf/components/esp32s3 /home/felix/esp/esp-idf/components/esp_common /home/felix/esp/esp-idf/components/esp_hw_support /home/felix/esp/esp-idf/components/esp_rom /home/felix/esp/esp-idf/components/esp_system /home/felix/esp/esp-idf/components/esptool_py /home/felix/esp/esp-idf/components/freertos /home/felix/esp/esp-idf/components/hal /home/felix/esp/esp-idf/components/log /home/felix/esp/esp-idf/components/bootloader/subproject/main /home/felix/esp/esp-idf/components/bootloader/subproject/components/micro-ecc /home/felix/esp/esp-idf/components/newlib /home/felix/esp/esp-idf/components/partition_table /home/felix/esp/esp-idf/components/soc /home/felix/esp/esp-idf/components/spi_flash /home/felix/esp/esp-idf/components/xtensa -- Configuring done -- Generating done -- Build files have been written to: /home/felix/esp/esp-idf/smoke-x-receiver/build/bootloader ninja: build stopped: subcommand failed. ninja failed with exit code 1`

frod123 commented 9 months ago

Nevermind... Learned how to read and update nodejs :) Working great! Thank you for making this sweet tool!!

thomasshawn commented 7 months ago

Nevermind... Learned how to read and update nodejs :) Working great! Thank you for making this sweet tool!!

i'm having same issue. tried in windows, WSL2, virtual box. same issue i'm getting the complete build files but when i goto flash i'm getting this error

Running ninja in directory C:\Espressif\smoke-x-receiver\smoke-x-receiver\build Executing "ninja flash"... [2/623] Performing build step for 'bootloader' [1/1] cmd.exe /C "cd /D C:\Espressif\smoke-x-receiver\smoke-x-receiver\build\bootloader\esp-idf\esptool_py && C:\Espressif\python_env\idf4.4_py3.11_env\Scripts\python.exe C:/Espressif/frameworks/esp-idf-v4.4/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 C:/Espressif/smoke-x-receiver/smoke-x-receiver/build/bootloader/bootloader.bin" Bootloader binary size 0x52b0 bytes. 0x2d50 bytes (35%) free. [4/623] cmd.exe /C "cd /D C:\Espressif\smoke-x-receiver\...bj-name-len=32 --meta-len=4 --use-magic --use-magic-len" **FAILED**: CMakeFiles/spiffs_storage_bin C:/Espressif/smoke-x-receiver/smoke-x-receiver/build/CMakeFiles/spiffs_storage_bin

FAILED: CMakeFiles/spiffs_storage_bin C:/Espressif/smoke-x-receiver/smoke-x-receiver/build/CMakeFiles/spiffs_storage_bin

RuntimeError: given base directory C:/Espressif/smoke-x-receiver/smoke-x-receiver/web_ui/dist does not exist [11/623] Building C object esp-idf/esp_http_server/CMakeFiles/__idf_esp_http_server.dir/src/httpd_ws.c.obj ninja: build stopped: subcommand failed. ninja failed with exit code 1

thomasshawn commented 7 months ago

in ubuntu when i do idf.py set-target esp32s3 i get compiler unknown issues but if i do a idf.py build the compilerworks fine \

here's the info from the esp32s3 target

idf.py set-target esp32s3 Adding "set-target"'s dependency "fullclean" to list of commands with default set of options. Executing action: fullclean Executing action: set-target Set Target to: esp32s3, new sdkconfig created. Existing sdkconfig renamed to sdkconfig.old. Running cmake in directory /home/linux/esp/esp-idf/smoke-x-receiver/build Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32s3 -DCCACHE_ENABLE=0 /home/linux/esp/esp-idf/smoke-x-receiver"... -- Found Git: /usr/bin/git (found version "2.34.1") -- The C compiler identification is unknown -- The CXX compiler identification is unknown -- The ASM compiler identification is unknown -- Found assembler: xtensa-esp32s3-elf-gcc CMake Error at /home/linux/esp/esp-idf/tools/cmake/project.cmake:381 (__project): The CMAKE_C_COMPILER:

xtensa-esp32s3-elf-gcc

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. Call Stack (most recent call first): CMakeLists.txt:6 (project)

CMake Error at /home/linux/esp/esp-idf/tools/cmake/project.cmake:381 (__project): The CMAKE_CXX_COMPILER:

xtensa-esp32s3-elf-g++

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. Call Stack (most recent call first): CMakeLists.txt:6 (project)

CMake Error at /home/linux/esp/esp-idf/tools/cmake/project.cmake:381 (__project): The CMAKE_ASM_COMPILER:

xtensa-esp32s3-elf-gcc

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. Call Stack (most recent call first): CMakeLists.txt:6 (project)

-- Warning: Did not find file Compiler/-ASM -- Configuring incomplete, errors occurred! See also "/home/linux/esp/esp-idf/smoke-x-receiver/build/CMakeFiles/CMakeOutput.log". See also "/home/linux/esp/esp-idf/smoke-x-receiver/build/CMakeFiles/CMakeError.log". cmake failed with exit code 1

thomasshawn commented 7 months ago

cmake errorlog....

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: xtensa-esp32s3-elf-gcc Build flags: -mlongcalls; Id flags:

The output was: No such file or directory

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: xtensa-esp32s3-elf-gcc Build flags: -mlongcalls; Id flags: -c

The output was: No such file or directory

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: xtensa-esp32s3-elf-gcc Build flags: -mlongcalls; Id flags: -Aa

The output was: No such file or directory

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: xtensa-esp32s3-elf-gcc Build flags: -mlongcalls; Id flags: -D__CLASSIC_C__

The output was: No such file or directory

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: xtensa-esp32s3-elf-gcc Build flags: -mlongcalls; Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3

The output was: No such file or directory

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: xtensa-esp32s3-elf-gcc Build flags: -mlongcalls; Id flags: -c;-Idoes_not_exist

The output was: No such file or directory

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.

thomasshawn commented 7 months ago

For those that come behind this was MANY things and no one thing fixed everything.

  1. i tried a VM with Kali linux and current updates of everything but was never able to get it to work. many issues and failures.
  2. moved to straight windows and got pretty far but started having issues with flashing i couldn't track down. missing flies and errors I couldn't overcome
  3. moved to ubuntu on wsl2.- followed directions with some changes this code was only one that worked for me to get export to work . $HOME/esp/esp-idf/export.sh Then after that i ran into missing package file issue. so i copied it from the webui to the build folder and it progressed nicely. until it showed a bunch more missing files. and still have the issue of windows trying to open BASH.SH: THIS IS THE FIX---- download git for windows. even though this is supposed to be running inside wsl windows was still trying to open bash.sh. as soon as i downloaded git for windows and associated .sh files with git, it processed the .sh file instead of trying to open it....huge win.

now .sh is running but now I have all sorts of node errors. the compiler wanted >16 and ububtu for some reason installed 12 despite multiple upgrade and other attempts. finally got latest version (node 21) on then attached a USB bus to the WSL image and i got it running.

it should have been easier but no matter which of the 3 methods i tried,nothing was easy. and all required some tinkering and some manipulation but it's working now and I learned a bunch of new linux commands and made up some new bad words.

thanks for this it seems to work well.

for anyone coming after. read the screen and search the error log. i actually had to do a screen record to catch on of the errors because it went by so fast and didn't make it to the log.

assign .sh a file handler like git make sure on nodejs >= 16 confrim the git download was complete move project.js to build folder from webui if needed.