BLE using custom component no longer compiling since ESP-IDF update because of hardware

this is copied from Air Box WP6003 - #29 by gon
because the original thread was pretty stale and the problem would not be limited to the wp6003, but should appear with more BLE custom components because of the changes in esp32-idf

it is about the custom component GitHub - Reg1nleifr/wp6003-esphome: Cheap CO2 Sensor Custom Component for ESPHome. WIP by @Reg1nleifr
it uses Bluetooth to communicate with a BLE sensor

a solution using BLE CLient is in the linked thread but it is unstable because of the BLE Client sensor
so i tried this custom component

but i tried to compile it for an M5Stamp-C3
support for the stamp-c3 requires to use the most current esp32-idf >= 2.0
so i use this

  - framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.4

this leads to

In file included from src/main.cpp:37:
src/wp6003.h:3:10: fatal error: BLEDevice.h: No such file or directory


  • Looking for BLEDevice.h dependency? Check our library registry!
  • CLI > platformio lib search “header:BLEDevice.h”
  • Web > PlatformIO Registry

the Platformio search leads to an outdated lib from nkolban ( GitHub - nkolban/ESP32_BLE_Arduino: The library source for the ESP32 BLE support for Arduino. ), and further search ( Forks · nkolban/esp32-snippets · GitHub ) leads to a fork of his BLE lib which supposedly fix the changes of the recent changes in the esp32-idf:
GitHub - W-M-D/esp32-snippets: Sample ESP32 snippets and code fragments
but this is in no form like the BLE lib, idk how the original author packages this to the BLE lib to be usable

but i can’t get it to compile with esphome using this reference

libraries:

does anyone understand how to create the ble-lib out of that esp32-snippets ??
the actual error while building is:

Cloning into ‘C:\Users\gon.platformio.cache\tmp\pkg-installing-_2f_1ybg’…
fatal: repository ‘esp32-snippets/BLE/scanner at master · W-M-D/esp32-snippets · GitHub’ not found
VCSBaseException: VCS: Could not process command [‘git’, ‘clone’, ‘–recursive’, ‘–depth’, ‘1’, ‘esp32-snippets/BLE/scanner at master · W-M-D/esp32-snippets · GitHub’, ‘C:\Users\gon\.platformio\.cache\tmp\pkg-installing-_2f_1ybg’]:
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\builder\main.py”, line 181:
env.SConscript(“$BUILD_SCRIPT”)
File “C:\Users\gon.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py”, line 597:
return _SConscript(self.fs, *files, **subst_kw)
File “C:\Users\gon.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py”, line 285:
exec(compile(scriptdata, scriptname, ‘exec’), call_stack[-1].globals)
File “C:\Users\gon.platformio\platforms\espressif32@src-d1a9a7a6a81ab8d1987a97febee7c658\builder\main.py”, line 218:
target_elf = env.BuildProgram()
File “C:\Users\gon.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Util.py”, line 742:
return self.method(*nargs, **kwargs)
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\builder\tools\platformio.py”, line 62:
env.ProcessProjectDeps()
File “C:\Users\gon.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Util.py”, line 742:
return self.method(*nargs, **kwargs)
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\builder\tools\platformio.py”, line 141:
project_lib_builder = env.ConfigureProjectLibBuilder()
File “C:\Users\gon.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Util.py”, line 742:
return self.method(*nargs, **kwargs)
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\builder\tools\piolib.py”, line 1104:
project.install_dependencies()
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\builder\tools\piolib.py”, line 940:
lm.install(spec)
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\package\manager_install.py”, line 49:
spec, silent=silent, skip_dependencies=skip_dependencies, force=force
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\package\manager\library.py”, line 98:
force=force,
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\package\manager_install.py”, line 97:
pkg = self.install_from_url(spec.url, spec, silent=silent)
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\package\manager_install.py”, line 142:
assert vcs.export()
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\package\vcsclient.py”, line 200:
assert self.run_cmd(args, cwd=os.getcwd())
File “C:\Users\gon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\platformio\package\vcsclient.py”, line 117:
raise VCSBaseException(“VCS: Could not process command %s” % e.cmd)