hello, i use esphome server ( python ) on windows , but , for esp32 c3 it is recommended to use esp-idf.
howto install esp-idf for my server ?
thank you
yes for this "framework:
type: esp-idf " but it tells me it’s not installed
We’ll need to see the yaml and logs. And what version of esphome?
my log and yaml
INFO ESPHome 2025.2.0
INFO Reading configuration d:\\esphome\config\esphome-web-c81704.yaml...
INFO Generating C++ source...
INFO Cloning https://github.com/espressif/[email protected]
Traceback (most recent call last):
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\git.py", line 20, in run_git_command
ret = subprocess.run(cmd, cwd=cwd, capture_output=True, check=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\Python311\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] Le fichier sp�cifi� est introuvable
The above exception was the direct cause of the following exception:
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:\Users\dom\AppData\Roaming\Python\Python311\Scripts\esphome.exe\__main__.py", line 7, in <module>
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\__main__.py", line 1049, in main
return run_esphome(sys.argv)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\__main__.py", line 1036, in run_esphome
rc = POST_CONFIG_ACTIONS[args.command](args, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\__main__.py", line 452, in command_compile
exit_code = write_cpp(config)
^^^^^^^^^^^^^^^^^
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\__main__.py", line 213, in write_cpp
return write_cpp_file()
^^^^^^^^^^^^^^^^
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\__main__.py", line 231, in write_cpp_file
writer.write_cpp(code_s)
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\writer.py", line 341, in write_cpp
copy_src_tree()
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\writer.py", line 307, in copy_src_tree
copy_files()
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\components\esp32\__init__.py", line 802, in copy_files
repo_dir, _ = git.clone_or_update(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\git.py", line 67, in clone_or_update
run_git_command(cmd)
File "C:\Users\dom\AppData\Roaming\Python\Python311\site-packages\esphome\git.py", line 22, in run_git_command
raise cv.Invalid(
voluptuous.error.Invalid: git is not installed but required for external_components.
Please see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git for installing git
esphome:
name: ld2410test #Cambia el nombre por el que desees
friendly_name: Presencia #Pon el nombre que desees
esp32:
board: esp32-c3-devkitm-1
framework:
type: esp-idf
logger:
api:
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.1.52
gateway: 192.168.1.1
subnet: 255.255.255.0
captive_portal:
uart:
id: presencia
tx_pin: 21
rx_pin: 20
baud_rate: 256000
parity: NONE
stop_bits: 1
ld2410:
uart_id: presencia
web_server:
port: 80
binary_sensor:
- platform: ld2410
has_target:
name: Presence
has_moving_target:
name: Moving Target
has_still_target:
name: Still Target
sensor:
- platform: ld2410
moving_distance:
name : cible en mouvement
still_distance:
name: cible immobile
moving_energy:
name: de mouvement
detection_distance:
name: Detection Distance
number:
- platform: ld2410
timeout: #Temps pour passer le binary sensor Présence à faux
name: timeout
max_move_distance_gate: #Distance de détection du mouvemenet 2-8
name: max move distance gate
max_still_distance_gate: #Distance de détection d'immobilité 2-8
name: max still distance gate
switch:
- platform: ld2410
engineering_mode:
name: "engineering mode"
bluetooth:
name: "control bluetooth"
Sometimes, the error message tells you exactly what you need to do.
You don’t install the idf platform, platformio does that. You don’t install platformio, esphome does that for you. But, it needs git to install it. It seems esphome does not install git for you, so you will need to do that yourself. It is likely the developers of esphome are so used to having git already installed, it never occurred to them that a machine could exist without git installed At least the error message is decent, just hidden by the extensive stack trace that makes it rather unfriendly and harder to see.
thank you , it’s good , i(ve installed git on windows