chrta / sip_call

SIP client for ESP32 to initiate a phone call from a door bell
Apache License 2.0
253 stars 80 forks source link

Compilation error when I try do menuconfig or build command #41

Open Olejan opened 6 months ago

Olejan commented 6 months ago

I download this project and try to build it. But when I do command: idf.py menuconfig I get error:

D:\Projects\sip_call-main>idf.py menuconfig
Executing action: menuconfig
Running cmake in directory D:\Projects\sip_call-main\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 '-DPYTHON=C:\Program Files\Python39\Scripts\python.exe' -DESP_PLATFORM=1 -DCCACHE_ENABLE=1 D:\Projects\sip_call-main"...
-- IDF_TARGET not set, using default target: esp32
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.39.1.windows.1")
-- ccache will be used for faster recompilation
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/user/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/user/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe - 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: C:/Users/user/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32
Processing 3 dependencies:
[1/3] espressif/asio (1.28.2)
[2/3] espressif/mdns (1.2.5)
[3/3] idf (5.2.1)
-- Project sdkconfig file D:/Projects/sip_call-main/sdkconfig
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Program Files\Python39\Lib\site-packages\kconfgen\__main__.py", line 16, in <module>
    main()
  File "C:\Program Files\Python39\Lib\site-packages\kconfgen\core.py", line 402, in main
    output_function(deprecated_options, config, temp_file)
  File "C:\Program Files\Python39\Lib\site-packages\kconfgen\core.py", line 566, in write_cmake
    write_node(n)
  File "C:\Program Files\Python39\Lib\site-packages\kconfgen\core.py", line 557, in write_node
Loading defaults file D:/Projects/sip_call-main/sdkconfig.defaults...
    write('set({}{} "{}")\n'.format(prefix, sym.name, val))
  File "encodings\cp1251.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\xfc' in position 36: character maps to <undefined>
CMake Error at C:/Users/user/esp/esp-idf/tools/cmake/kconfig.cmake:209 (message):
  Failed to run kconfgen (C:/Program
  Files/Python39/Scripts/python.exe;-m;kconfgen;--list-separator=semicolon;--kconfig;C:/Users/user/esp/esp-idf/Kconfig;--sdkconfig-rename;C:/Users/user/esp/esp-idf/sdkconfig.rename;--config;D:/Projects/sip_call-main/sdkconfig;--defaults;D:/Projects/sip_call-main/sdkconfig.defaults;--env-file;D:/Projects/sip_call-main/build/config.env).
  Error 1
Call Stack (most recent call first):
  C:/Users/user/esp/esp-idf/tools/cmake/build.cmake:615 (__kconfig_generate_config)
  C:/Users/user/esp/esp-idf/tools/cmake/project.cmake:605 (idf_build_process)
  CMakeLists.txt:10 (project)

-- Configuring incomplete, errors occurred!
See also "D:/Projects/sip_call-main/build/CMakeFiles/CMakeOutput.log".
cmake failed with exit code 1

ESP-IDF 5.2.1 Windows 10 64 bit

What am I doing wrong?

chrta commented 5 months ago
  1. Are other esp-idf projects working, e.g. https://github.com/espressif/esp-idf/tree/v5.2.1/examples/get-started ? (I do not use Windows, so i cannot reproduce your issue.)
  2. The file sdkconfig.defaults is pure ASCII and does not contain a 0xfc. Have you modified that file?
  3. As mentioned in the README: it is tested with a version after v5.1 (rev b4268c874a4cf8fcf7c0c4153cffb76ad2ddda4e) Can you recheck if it works with esp-udf v5.1?
Olejan commented 5 months ago

@chrta I will answer your questions:

  1. Yes, other projects from examples/get-started are compiled fine and flashed in esp32 normally.
  2. I didn't change any files. I just cloned your repository and immediately made idf.py build. In this case, the error described in the issue.
  3. I tried installing ESP-IDF v5.1, the result is the same.

I installed Ubuntu 22.04.4 on Windows in VirtualBox. Installed ESP-IDF v5.2.1 in it, cloned your repository, and everything compiled well.

As a result, everything compiles well on Ubuntu, but a strange error appears on Windows. It's not clear what's wrong with Windows.

kukenovandrei commented 4 weeks ago

@Olejan Hello. You can modify core.py file to fix the issue

`

            try:
                print(f"Writing {sym.name} with value {val}")     
                write('set({}{} "{}")\n'.format(prefix, sym.name, val))

                configs_list.append(prefix + sym.name)
                dep_opts = deprecated_options.get_deprecated_option(sym.name)
                for opt in dep_opts:
                    tmp_dep_list.append('set({}{} "{}")\n'.format(prefix, opt, val))
                    configs_list.append(prefix + opt)
            except ValueError:
                print("Oops!")`
Octaviarius commented 4 weeks ago

The better way is avoiding unicode characters in your config files. For more detailed output info and abort the process:

` try: write('set({}{} "{}")\n'.format(prefix, sym.name, val))

                configs_list.append(prefix + sym.name)
                dep_opts = deprecated_options.get_deprecated_option(sym.name)
                for opt in dep_opts:
                    tmp_dep_list.append(f'set({prefix}{opt} "{val}")\n')
                    configs_list.append(prefix + opt)
            except ValueError as e:
                print(f"Oops! Failed on {sym.name.encode()} with value {val.encode()}. {e}")
                exit(-1)

`