Espectre can't get main or 2.4.0 to compile

Continuing the discussion from 🛜 ESPectre :ghost: - Wi-Fi Motion Detection for Home Assistant:

Hi, I’m a luddit when it comes to all this, but the espectre project looks very cool. I have a couple of S3’s compiled with it. Right now, just have a odd look on my face staring at it.
The point of the post is i was adding the second S3 and saw my fist yaml was saying use 2.2.0. OK, fine, but went and looked and it seemed that we are up to 2.5.0 in main. Great, tried the update and it errored out. Ended up only being able to get to 2.3.0
2.4.0, and main both wouldn’t work for me.
here is what Opus 4.6 told me was going on, so I’m passing it on for possible use.
Thanks for all your work with espectre.
Dan

for main:
The build error is clear: the ESPectre component’s code references a source file (p95_calibrator.cpp) that doesn’t exist in the version pulled from GitHub. This means the component’s CMakeLists.txt or build manifest lists files that aren’t present in the main branch — a common issue when a component author restructures their code but doesn’t update all references, or when main is in a broken state.
The main branch of the ESPectre repo has been restructured (likely in v2.4.0) and the build manifest references p95_calibrator.cpp as a separate file, but the actual source code has either been reorganized, renamed, or consolidated. Since you have refresh: always, you’re pulling the very latest main commit every time — and main is apparently in a state where the CMakeLists.txt or __init__.py references a file that doesn’t exist or has been moved.

for 2.4.0:

Same problem, different file — now it’s base_detector.cpp not found. The 2.4.0 tag’s component manifest references files that don’t exist in the tag either. This is a packaging issue on the ESPectre side — the ESPHome component’s __init__.py lists source files that were added after the tag was created, or the tag was cut from a partially-committed state.

OK Dan, here’s the situation. Both main and 2.4.0 are broken — 2.4.0 references base_detector.cpp which doesn’t exist in that tag either. This is a packaging bug in the project where the __init__.py (which tells ESPHome what C++ files to compile) references files that were committed to main after the tag was cut, or that live in a different directory structure.

This did compile:

The approach that’s most likely to work is stepping back to 2.3.0 — that’s the Dec 31 release which predates the v2.4.0 refactoring that introduced the base_detector and p95_calibrator split. Here’s what I’d try:

Not sure what the point is to have this in a new thread?

You had a compile error about a missing file.
You tried a different version, that also was missing.
You asked AI (Hi Claude!), and it said to go back to one that was working.

Did I miss something?

yepp can’t say much, I came all the way from 1.0.0 which was the last one I flashed and just tried with 2.5.0 and it more or less compiled straight.
Had to comment 2 lines normalization_enabled and normalization_target likely obsolete by now? But I didn’t run into any issues with missing files.

I do remember that in the beginning with espectre my filewall blocked pulling various things from the net at compile stage, so perhaps this is something to have a closer look at using a deeper log level?

Tried to compile 2.5.0 without a problem.
And inside /.esphome/build/espectre/src/esphome/components/especte/ the base_detector.cpp is there with an actual filedate, means it got pulled some mins ago upon the compile process.

So 2.5.0 worked, proving it pays to keep up to date.
Hi Claude. Listening?

Hi @keelstrake,

The issue you encountered is almost certainly an ESPHome cache problem, not a repository packaging bug.

ESPHome caches downloaded external components in .esphome/external_components/. When you switch between versions, stale cached files can conflict with the new code, causing “file not found” errors like the ones you saw.

Both tags (2.4.0 and 2.5.0) are correctly packaged - I just verified this by inspecting the git tree directly. The files referenced in each version exist in that version. Keep in mind that each release is built automatically with github actions, so if something is missing the release failed

Try to delete your cache folder (probably in examples folder):

rm -rf .esphome/external_components/

or remove everything

rm -rf .esphome/

Then run your ESPHome build again.

esphome run your-config.yaml

Even easier: Pre-compiled Firmware (v2.5.0+)

Starting from v2.5.0, I provide pre-compiled firmware binaries that you can flash directly - no compilation needed!

  1. Download the .bin for your chip from Releases (e.g., espectre-2.5.0-esp32s3.bin)

  2. Open ESPConnect in Chrome

  3. Connect your ESP32, select the port, load the .bin, click Flash

  4. Configure WiFi via the captive portal that appears

See the full instructions in SETUP.md - Option A: Web Flash.

Thanks francescopace,

I will work your solution and appreciate your feedback.

Regards,
Dan

1 Like

Thanks justone,

Appreciate your feedback.

Regards,

Dan

francecsopace,

The cache clear resolved the updating issue.

Thanks again, apologies for the post, should have worked the issue longer.

Regards,

Dan

1 Like