MordFIdel / SOCORAD32

ESP32 SOftware COntrolled RADio (SOCORAD32)
161 stars 21 forks source link

Can you make a real wiki how to build and flash on linux or macos ? #18

Closed joyel24 closed 1 year ago

joyel24 commented 1 year ago

Can you write instructions to build and flash the firmware on linux or macos ? Or at least can you build it and publish it in the release section and make a simple how to flash in every os... I'm not sure everyone wants to install all dependencies and build their own firmware.

I just installed "ESP-IDF v4.4.4-dirty" confirmed with idf.py --version and it fails when trying to build on macos 12.6.

Processing 1 dependencies:
[1/1] idf (4.4.4)
-- DEBUG: Use esp-modbus component folder: /Users/joel/esp/esp-idf/components/freemodbus.
-- Project sdkconfig file /Users/joel/Downloads/SCRD32 firmware official/sdkconfig
Traceback (most recent call last):
  File "/Users/joel/esp/esp-idf/tools/kconfig_new/confgen.py", line 644, in <module>
    main()
  File "/Users/joel/esp/esp-idf/tools/kconfig_new/confgen.py", line 264, in main
    config = kconfiglib.Kconfig(args.kconfig)
  File "/Users/joel/.espressif/python_env/idf5.0_py3.10_env/lib/python3.10/site-packages/kconfiglib.py", line 947, in __init__
    self._init(filename, warn, warn_to_stderr, encoding)
  File "/Users/joel/.espressif/python_env/idf5.0_py3.10_env/lib/python3.10/site-packages/kconfiglib.py", line 1085, in _init
    self._parse_block(None, self.top_node, self.top_node).next = None
  File "/Users/joel/.espressif/python_env/idf5.0_py3.10_env/lib/python3.10/site-packages/kconfiglib.py", line 2982, in _parse_block
    prev = self._parse_block(None, parent, prev)
  File "/Users/joel/.espressif/python_env/idf5.0_py3.10_env/lib/python3.10/site-packages/kconfiglib.py", line 2970, in _parse_block
    raise KconfigError(
kconfiglib.KconfigError: kconfigs_projbuild.in:6: '/Users/joel/Downloads/SCRD32' not found (in 'source "/Users/joel/Downloads/SCRD32"'). Check that environment variables are set correctly (e.g. $srctree, which is unset or blank). Also note that unset environment variables expand to the empty string.
CMake Error at /Users/joel/esp/esp-idf/tools/cmake/kconfig.cmake:266 (message):
  Failed to run confgen.py
  (/Users/joel/.espressif/python_env/idf5.0_py3.10_env/bin/python;/Users/joel/esp/esp-idf/tools/kconfig_new/confgen.py;--kconfig;/Users/joel/esp/esp-idf/Kconfig;--sdkconfig-rename;/Users/joel/esp/esp-idf/sdkconfig.rename;--config;/Users/joel/Downloads/SCRD32
  firmware official/sdkconfig;--defaults;/Users/joel/Downloads/SCRD32
  firmware
  official/sdkconfig.defaults;--env-file;/Users/joel/Downloads/SCRD32
  firmware official/build/config.env).  Error 1
Call Stack (most recent call first):
  /Users/joel/esp/esp-idf/tools/cmake/build.cmake:523 (__kconfig_generate_config)
  /Users/joel/esp/esp-idf/tools/cmake/project.cmake:384 (idf_build_process)
  CMakeLists.txt:8 (project)

-- Configuring incomplete, errors occurred!
FAILED: build.ninja
KillerTurtleSoftware commented 1 year ago

Try adding --no-ccache to the build line *not the double cc I. E. idf.py --no-ccache build

joyel24 commented 1 year ago

Try adding --no-ccache to the build line *not the double cc I. E. idf.py --no-ccache build

Thanks for your reply. I already did it and I also changed the name of the folder to remove every spaces in the name but idf.py don't want to build it.

KillerTurtleSoftware commented 1 year ago

OK. I'll do a build and see what files are needed to be able to run the flash without first building tonight. I'll upload them to the site if I can get it to work.

KillerTurtleSoftware commented 1 year ago

After reading the ESP-IDY getting started guide, https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/linux-macos-setup.html it looks like it checks the build file and rebuilds it, if needed, when running the flash command. So it looks like you will probably have to install the required dependencies.

From what I've read further, you may be able to share all the built files, but I have to do some testing to see how well it works.

Also, I build the file each time, as I change the Bluetooth name between the 2 radios, so I know which is which when I connect to my phone.

joyel24 commented 1 year ago

After reading the ESP-IDY getting started guide, https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/linux-macos-setup.html it looks like it checks the build file and rebuilds it, if needed, when running the flash command. So it looks like you will probably have to install the required dependencies.

From what I've read further, you may be able to share all the built files, but I have to do some testing to see how well it works.

Also, I build the file each time, as I change the Bluetooth name between the 2 radios, so I know which is which when I connect to my phone.

konfiglib.KconfigError: kconfigs_projbuild.in:6: '/Users/joel/Downloads/SCRD32' not found (in 'source "/Users/joel/Downloads/SCRD32"'). Check that environment variables are set correctly (e.g. $srctree, which is unset or blank). Also note that unset environment variables expand to the empty string

It suggests that there are missing environment variables. As you said, it may also be a dependency that is not satisfied, but no idea which one can it be.

KillerTurtleSoftware commented 1 year ago

OK, I think I see what is going on. Is your firmware saved in folder /Users/joel/Downloads/SCRD32 firmware official OR is it in /Users/joel/Downloads/SCRD32

There can't be any spaces in the folder names and the path can't have more than 90 characters total. I unzipped my firmware to c:/SCRD32

If you look at the line you pasted it's cutting off the path at the first space

joyel24 commented 1 year ago

OK, I think I see what is going on. Is your firmware saved in folder /Users/joel/Downloads/SCRD32 firmware official OR is it in /Users/joel/Downloads/SCRD32

There can't be any spaces in the folder names and the path can't have more than 90 characters total. I unzipped my firmware to c:/SCRD32

If you look at the line you pasted it's cutting off the path at the first space

On macos and linux, we are not concerned about the 90 characters total path limitation.

The extracted archive is here: /Users/joel/Downloads/SCRD32

When I list this directory, there is no problem:

Capture d’écran 2023-08-24 à 18 48 19

For the environment variable, I followed the esp-idf documentation and ran the command as they said '. ./export.sh'

joyel24 commented 1 year ago

I tried reinstalling esp-idf and updated all git dependancies and it appears to work now. In my fork I updated the building guide Final_Firmware.md: https://github.com/joyel24/SOCORAD32/blob/main/Final_Firmware.md