M5Stack ATOM Echo adaptation problem

Hello, I have read several topics on the forum, but in none of them I have found a solution to my problem. It concerns the M5Stack ATOM Echo adaptation. There is a compilation problem after creating a C++ file. The following messages appear:

INFO ESPHome 2024.7.0
INFO Reading configuration /config/esphome/m5stack-atom-echo-31cad8.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/5230/head
INFO Updating https://github.com/jesserockz/esphome-components.git@None
INFO Generating C++ source...
INFO Updating https://github.com/espressif/[email protected]
INFO Updating submodules (components/esp-sr, components/esp-adf-libs) for https://github.com/espressif/[email protected]
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/esphome/esphome/__main__.py", line 1079, in main
    return run_esphome(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 1066, in run_esphome
    rc = POST_CONFIG_ACTIONS[args.command](args, config)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 433, in command_compile
    exit_code = write_cpp(config)
                ^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 194, in write_cpp
    return write_cpp_file()
           ^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 212, in write_cpp_file
    writer.write_cpp(code_s)
  File "/esphome/esphome/writer.py", line 344, in write_cpp
    copy_src_tree()
  File "/esphome/esphome/writer.py", line 297, in copy_src_tree
    copy_files()
  File "/esphome/esphome/components/esp32/__init__.py", line 684, in copy_files
    repo_dir, _ = git.clone_or_update(
                  ^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/git.py", line 111, in clone_or_update
    run_git_command(
  File "/esphome/esphome/git.py", line 31, in run_git_command
    raise cv.Invalid(lines[-1][len("fatal: ") :])
voluptuous.error.Invalid: Unable to find current revision in submodule path 'components/esp-adf-libs'

Has anyone encountered the same problem and how did they solve it?

I am getting the same error on the Esp32-s3-box-3. Have yet to find a solution.

Seems that a lot of people are struggling with it - here’s an old github issue that was raised Unable to find current revision in submodule path 'components/esp-adf-libs' · Issue #4952 · esphome/issues · GitHub esphome restarts seem to help some people. Unfortunately it didn’t help me.

Solved it by installing via Ready-Made Projects — ESPHome rather than esphome add on in hass.

Unfortunately this method does not work. I have tried several times and always stop at ESPHome configuration. I am trying to enter the ESPHome node connection settings but I cannot find the hostname.

I had the same problem with Esphome version 2024.7.3.

After investigating “voluptuous.error.Invalid: Unable to find current revision in submodule path ‘components/esp-adf-libs’” error message,
using the following developper-level procedure, i found that components/esp-adf-libs folder only contains .git subfolder, without any files checkouted,
because attempted revision was not found in .git folder. This was the same problem for me for components/esp-sr submodule.

  1. Requirement : connect to home assistant core ssh on port 22222 as explained on Debugging the Home Assistant Operating System

  2. As I was using Windows, i use putty connection on port 22222 and WinSCP (SCP protocol) connection on port 22222

  3. docker ps command in putty to retrieve esphome CONTAINER_ID

docker ps
   CONTAINER ID   IMAGE                                                           COMMAND               CREATED        STATUS                  PORTS                                                                                  NAMES
   6d0424519132   ghcr.io/esphome/esphome-hassio:2024.7.3                         "/init"               24 hours ago   Up 24 hours                                                                                                    addon_5c53de3b_esphome
  1. docker inspect -f ‘{{ .Mounts }}’ [CONTAINER_ID] to find where are esphome addons files mounted
docker inspect -f '{{ .Mounts }}' 6d0424519132

Example of response :

[{bind  /mnt/data/supervisor/homeassistant /config   true rprivate} {bind  /mnt/data/supervisor/ssl /ssl   false rprivate} {bind  /dev /dev   false rprivate} {bind  /mnt/data/supervisor/addons/data/5c53de3b_esphome /data   true rprivate}]

Result : /mnt/data/supervisor/addons/data/5c53de3b_esphome

So i found submodules location in :

/mnt/data/supervisor/addons/data/5c53de3b_esphome/idf_components/b0ad5728/components/esp-adf-libs
/mnt/data/supervisor/addons/data/5c53de3b_esphome/idf_components/b0ad5728/components/esp-sr
  1. Using putty on port 22222 to repair esp-adf-libs
cd /mnt/data/supervisor/addons/data/5c53de3b_esphome/idf_components/b0ad5728  (to be in main git folder)
git submodule status    (to view git submodules revision expected)
example : 
 3b34541c9212faa50c252f5fd00c36b6077ee96d components/esp-adf-libs ()  (expected revision 3b34541c9212faa50c252f5fd00c36b6077ee96d)
 0c1eecaac259af95f76723b61d4e16cef5904fc7 components/esp-sr ()        (expected revision 0c1eecaac259af95f76723b61d4e16cef5904fc7)

git submodule update --init --recursive components/esp-adf-libs    (trying to update submodule with expected revision => fatal: Unable to find current revision in submodule path 'components/esp-adf-libs')
rm components/esp-adf-libs   (to delete esp-adf-libs folder)
git submodule update --init --recursive components/esp-adf-libs  (to restore esp-ads-libs folder)
cd components/esp-adf-libs    (to go in submodule folder)
git checkout [expected revision]
example here : 
   git checkout 3b34541c9212faa50c252f5fd00c36b6077ee96d
  1. Trying to install again m5stack-atom-echo-a159bc.yaml i got the same error for components/esp-rs submodule and apply the same procedure as 5) above

  2. m5stack-atom-echo-a159bc.yaml install is working

Hope this can help a few people !

3 Likes

Thank you for your guide.
I still don’t succeed with the install after months of owning the ATOM Echo… And I kind of give up now.
Strange that there is no reaction from the developers, being a thing they advertise everywhere on their voice-chapters.

Small adjustments to your guide:
My HAOS didn’t have git installed, so I went directly into the docker container with

docker exec -it 5c53de3b-esphome bash

From there the submodules are in data/idf_components/b0ad5728. I followed your guide from there again, but I get the following reply:

root@5c53de3b-esphome:/data/idf_components/b0ad5728# git submodule update --init --recursive components/esp-adf-libs
fatal: could not get a repository handle for submodule 'components/esp-adf-libs'

and

root@5c53de3b-esphome:/data/idf_components/b0ad5728/components/esp-adf-libs# git checkout
fatal: not a git repository: /data/idf_components/b0ad5728/components/esp-adf-libs/../../.git/modules/components/esp-adf-libs

Installing the .yaml fails as usual… :sob:

1 Like

I finally found a solution to my case. My HA installation is a system downloaded from the Raspberry PI website. I used a ready-made project from Ready-Made Projects — ESPHome. After creating the ready-made project, I did not install it directly in HA. I cleaned up all traces of my previous attempts to install the voice assistant in HA by completely removing it. I reloaded the system and HA detected the voice assistant by itself. I only confirmed that I wanted to include it in HA and the matter was solved. I did not try any more compilations of the yaml file.

this worked for me

This worked for me but with a small change because Git was not installed on HA os.

Followed @tdy91 's procedure but changed number 5 for:

#Get in to the container's command line
docker exec -it addon_5c53de3b_esphome /bin/bash
cd /data/idf_components/b0ad5728/
rm -r components/esp-adf-libs
git submodule update --init --recursive components/esp-adf-libs
rm -r components/esp-sr
git submodule update --init --recursive components/esp-sr

What worked for me was to find the device in ESPHome Builder. Click on the three Dots and select ‘Clean Build Files’.

That helped me! Only to find the next problem…
(I have a normal s3 board)

Reading CMake configuration...
-- git rev-parse returned 'fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).'
-- Building ESP-IDF components for target esp32s3
Processing 1 dependencies:
[1/1] idf (5.1.5)
-- Configuring incomplete, errors occurred!
See also "/data/build/esp32-s3-voice-001/.pioenvs/esp32-s3-voice-001/CMakeFiles/CMakeOutput.log".

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
CMake Error at /data/cache/platformio/packages/framework-espidf@src-6e6cd5244a43bdfe453daac50cfe73b6/tools/cmake/build.cmake:266 (message):
  Failed to resolve component 'esp_adc_cal'.
Call Stack (most recent call first):
  /data/cache/platformio/packages/framework-espidf@src-6e6cd5244a43bdfe453daac50cfe73b6/tools/cmake/build.cmake:302 (__build_resolve_and_add_req)
  /data/cache/platformio/packages/framework-espidf@src-6e6cd5244a43bdfe453daac50cfe73b6/tools/cmake/build.cmake:309 (__build_expand_requirements)
  /data/cache/platformio/packages/framework-espidf@src-6e6cd5244a43bdfe453daac50cfe73b6/tools/cmake/build.cmake:603 (__build_expand_requirements)
  /data/cache/platformio/packages/framework-espidf@src-6e6cd5244a43bdfe453daac50cfe73b6/tools/cmake/project.cmake:604 (idf_build_process)

Anyone know how to solve this, or where I can find the directory where the logfile resides, or even the container where the actual ESPHome stuff is located?

The esphome stuff lives in a hidden file .esphome, if thats what you looking for.

I am just trying to update one of my players and coming up against the same issue.