-
-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
esphome/wake-word-voice-assistants
#99Description
The problem
I have done a clean build files and tried more then a few times to compile
I have looked through the code on the wake word assistant repository to verify it was the same
during the compile process I get
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
- framework-espidf @ 3.40408.0 (4.4.8)
- tool-cmake @ 3.16.4
- tool-ninja @ 1.7.1
- toolchain-esp32ulp @ 2.35.0-20220830
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
ModuleNotFoundError: No module named 'pkg_resources':
File "/usr/local/lib/python3.12/site-packages/platformio/builder/main.py", line 173:
env.SConscript("$BUILD_SCRIPT")
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
return _SConscript(self.fs, *files, **subst_kw)
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/data/cache/platformio/platforms/[email protected]/builder/main.py", line 312:
target_elf = env.BuildProgram()
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Util/envs.py", line 252:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.12/site-packages/platformio/builder/tools/piobuild.py", line 62:
env.ProcessProgramDeps()
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Util/envs.py", line 252:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.12/site-packages/platformio/builder/tools/piobuild.py", line 142:
env.BuildFrameworks(env.get("PIOFRAMEWORK"))
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Util/envs.py", line 252:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.12/site-packages/platformio/builder/tools/piobuild.py", line 352:
SConscript(env.GetFrameworkScript(name), exports="env")
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 684:
return method(*args, **kw)
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
return _SConscript(self.fs, *files, **subst_kw)
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/data/cache/platformio/platforms/[email protected]/builder/frameworks/espidf.py", line 29:
import pkg_resources
========================== [FAILED] Took 2.41 seconds ==========================
Which version of ESPHome has the issue?
2025.5.0b2
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2025.5.1
What platform are you using?
ESP32-IDF
Board
M5Stack atom echo
Component causing the issue
?
YAML Config
substitutions:
name: m5stack-atom-echo-82b754
friendly_name: M5
micro_wake_word_model: hey_mycroft
esphome:
name: ${name}
name_add_mac_suffix: true
friendly_name: ${friendly_name}
min_version: 2025.2.0
esp32:
board: m5stack-atom
framework:
type: esp-idf
version: 4.4.8
platform_version: 5.4.0
logger:
baud_rate: 115200
tx_buffer_size: 512
deassert_rts_dtr: false
task_log_buffer_size: 768
hardware_uart: UART0
level: DEBUG
logs: {}
api:
encryption:
key: wIr9nyqry/SBL2uvFN3LiL+UdkOu1zbaQM/hROKE8VI=
port: 6053
password: ''
reboot_timeout: 15min
ota:
- platform: esphome
id: ota_esphome
version: 2
port: 3232
wifi:
ap:
ap_timeout: 1min
domain: .local
reboot_timeout: 15min
power_save_mode: LIGHT
fast_connect: false
enable_btm: false
enable_rrm: false
passive_scan: false
enable_on_boot: true
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password
priority: 0.0
use_address: m5stack-atom-echo-82b754.local
captive_portal: {}
button:
- platform: factory_reset
id: factory_reset_btn
name: Factory reset
disabled_by_default: false
icon: mdi:restart-alert
entity_category: config
device_class: restart
- platform: restart
id: reboot
name: Reboot
disabled_by_default: false
icon: mdi:restart
entity_category: config
device_class: restart
i2s_audio:
- id: i2s_audio_bus
i2s_lrclk_pin: 33
i2s_bclk_pin: 19
microphone:
- platform: i2s_audio
id: echo_microphone
i2s_din_pin: 23
pdm: true
channel: right
sample_rate: 16000
bits_per_sample: 32bit
i2s_mode: primary
use_apll: false
bits_per_channel: default
mclk_multiple: 256
correct_dc_offset: false
adc_type: external
num_channels: 1
# min_bits_per_sample: 32bit
# max_bits_per_sample: 32bit
# min_channels: 1
# max_channels: 1
# min_sample_rate: 16000
# max_sample_rate: 16000
speaker:
- platform: i2s_audio
id: echo_speaker
i2s_dout_pin: 22
bits_per_sample: 32bit
channel: right
buffer_duration: 60ms
sample_rate: 16000
i2s_mode: primary
use_apll: false
bits_per_channel: default
mclk_multiple: 256
timeout: 500ms
i2s_comm_fmt: stand_i2s
dac_type: external
num_channels: 1
# min_bits_per_sample: 8
# max_bits_per_sample: 32
# min_channels: 1
# max_channels: 2
# min_sample_rate: 16000
# max_sample_rate: 48000
media_player:
- platform: speaker
name: ''
id: echo_media_player
announcement_pipeline:
speaker: echo_speaker
format: WAV
num_channels: 1
sample_rate: 16000
codec_support_enabled: false
buffer_size: 6000
volume_min: 0.4
files:
- id: timer_finished_wave_file
file:
url: https://github.com/esphome/wake-word-voice-assistants/raw/main/sounds/timer_finished.wav
type: web
on_announcement:
- then:
- if:
condition:
and:
- microphone.is_capturing: {}
then:
- if:
condition:
lambda: !lambda |-
return id(wake_word_engine_location).state == "On device";
then:
- micro_wake_word.stop: {}
else:
- voice_assistant.stop: {}
- script.execute:
id: reset_led
- light.turn_on:
id: led
blue: 1.0
red: 0.0
green: 0.0
brightness: 1.0
effect: none
state: true
on_idle:
- then:
- script.execute:
id: start_wake_word
disabled_by_default: false
task_stack_in_psram: false
volume_increment: 0.05
volume_max: 1.0
voice_assistant:
id: va
microphone:
microphone: echo_microphone
bits_per_sample: 16
channels:
- 0
gain_factor: 1
media_player: echo_media_player
noise_suppression_level: 2
auto_gain: 31dBFS
volume_multiplier: 2.0
on_listening:
then:
- light.turn_on:
id: led
blue: 1.0
red: 0.0
green: 0.0
effect: Slow Pulse
state: true
on_stt_vad_end:
then:
- light.turn_on:
id: led
blue: 1.0
red: 0.0
green: 0.0
effect: Fast Pulse
state: true
on_tts_start:
then:
- light.turn_on:
id: led
blue: 1.0
red: 0.0
green: 0.0
brightness: 1.0
effect: none
state: true
on_end:
then:
- delay: 100ms
- script.execute:
id: start_wake_word
on_error:
then:
- light.turn_on:
id: led
red: 1.0
green: 0.0
blue: 0.0
brightness: 1.0
effect: none
state: true
- delay: 2s
- script.execute:
id: reset_led
on_client_connected:
then:
- delay: 2s
- script.execute:
id: start_wake_word
on_client_disconnected:
then:
- voice_assistant.stop: {}
- micro_wake_word.stop: {}
on_timer_finished:
then:
- voice_assistant.stop: {}
- micro_wake_word.stop: {}
- wait_until:
condition:
not:
microphone.is_capturing: {}
- switch.turn_on:
id: timer_ringing
- light.turn_on:
id: led
red: 0.0
green: 1.0
blue: 0.0
brightness: 1.0
effect: Fast Pulse
state: true
- wait_until:
condition:
and:
- switch.is_off:
id: timer_ringing
- light.turn_off:
id: led
state: false
- switch.turn_off:
id: timer_ringing
use_wake_word: false
conversation_timeout: 300s
binary_sensor:
- platform: gpio
pin:
number: 39
inverted: true
mode:
input: true
output: false
open_drain: false
pullup: false
pulldown: false
ignore_pin_validation_error: false
ignore_strapping_warning: false
drive_strength: 20.0
name: Button
disabled_by_default: true
entity_category: diagnostic
id: echo_button
on_multi_click:
- timing:
- state: true
min_length: 50ms
- state: false
min_length: 50ms
then:
- if:
condition:
switch.is_on:
id: timer_ringing
then:
- switch.turn_off:
id: timer_ringing
else:
- script.execute:
id: start_wake_word
invalid_cooldown: 1s
- timing:
- state: true
min_length: 10s
then:
- button.press:
id: factory_reset_btn
invalid_cooldown: 1s
light:
- platform: esp32_rmt_led_strip
id: led
name: ''
disabled_by_default: true
entity_category: config
pin: 27
default_transition_length: 0s
chipset: SK6812
num_leds: 1
rgb_order: GRB
rmt_channel: 0
effects:
- pulse:
name: Slow Pulse
transition_length: 250ms
update_interval: 250ms
min_brightness: 0.5
max_brightness: 1.0
- pulse:
name: Fast Pulse
transition_length: 100ms
update_interval: 100ms
min_brightness: 0.5
max_brightness: 1.0
restore_mode: ALWAYS_OFF
gamma_correct: 2.8
flash_transition_length: 0s
is_rgbw: false
is_wrgb: false
use_psram: true
reset_high: 0us
reset_low: 0us
script:
- id: reset_led
then:
- if:
condition:
and:
- lambda: !lambda |-
return id(wake_word_engine_location).state == "On device";
- switch.is_on:
id: use_listen_light
then:
- light.turn_on:
id: led
red: 1.0
green: 0.89
blue: 0.71
brightness: 0.6
effect: none
state: true
else:
- if:
condition:
and:
- lambda: !lambda |-
return id(wake_word_engine_location).state != "On device";
- switch.is_on:
id: use_listen_light
then:
- light.turn_on:
id: led
red: 0.0
green: 1.0
blue: 1.0
brightness: 0.6
effect: none
state: true
else:
- light.turn_off:
id: led
state: false
mode: single
parameters: {}
- id: start_wake_word
then:
- wait_until:
condition:
and:
- media_player.is_idle: {}
- speaker.is_stopped: {}
- if:
condition:
lambda: !lambda |-
return id(wake_word_engine_location).state == "On device";
then:
- voice_assistant.stop: {}
- micro_wake_word.stop: {}
- delay: 1s
- script.execute:
id: reset_led
- script.wait:
id: reset_led
- micro_wake_word.start: {}
else:
- if:
condition:
voice_assistant.is_running: {}
then:
- voice_assistant.stop: {}
- script.execute:
id: reset_led
- voice_assistant.start_continuous: {}
mode: single
parameters: {}
switch:
- platform: template
name: Use listen light
id: use_listen_light
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
on_turn_on:
- then:
- script.execute:
id: reset_led
on_turn_off:
- then:
- script.execute:
id: reset_led
disabled_by_default: false
assumed_state: false
- platform: template
id: timer_ringing
optimistic: true
restore_mode: ALWAYS_OFF
on_turn_off:
- then:
- lambda: !lambda |-
id(echo_media_player)
->make_call()
.set_command(media_player::MediaPlayerCommand::MEDIA_PLAYER_COMMAND_REPEAT_OFF)
.set_announcement(true)
.perform();
id(echo_media_player)->set_playlist_delay_ms(speaker::AudioPipelineType::ANNOUNCEMENT, 0);
- media_player.stop:
announcement: true
on_turn_on:
- then:
- lambda: !lambda |-
id(echo_media_player)
->make_call()
.set_command(media_player::MediaPlayerCommand::MEDIA_PLAYER_COMMAND_REPEAT_ONE)
.set_announcement(true)
.perform();
id(echo_media_player)->set_playlist_delay_ms(speaker::AudioPipelineType::ANNOUNCEMENT, 1000);
- media_player.speaker.play_on_device_media_file:
media_file: timer_finished_wave_file
announcement: true
enqueue: false
- delay: 15min
- switch.turn_off:
id: timer_ringing
disabled_by_default: false
assumed_state: false
name: timer_ringing
internal: true
select:
- platform: template
entity_category: config
name: Wake word engine location
id: wake_word_engine_location
optimistic: true
restore_value: true
options:
- In Home Assistant
- On device
initial_option: On device
on_value:
- then:
- if:
condition:
lambda: !lambda |-
return x == "In Home Assistant";
then:
- micro_wake_word.stop: {}
- delay: 500ms
- lambda: !lambda |-
id(va).set_use_wake_word(true);
- voice_assistant.start_continuous: {}
- if:
condition:
lambda: !lambda |-
return x == "On device";
then:
- lambda: !lambda |-
id(va).set_use_wake_word(false);
- voice_assistant.stop: {}
- delay: 500ms
- micro_wake_word.start: {}
disabled_by_default: false
update_interval: 60s
micro_wake_word:
on_wake_word_detected:
then:
- voice_assistant.start:
wake_word: !lambda |-
return wake_word;
silence_detection: true
vad:
model:
url: https://github.com/esphome/micro-wake-word-models/raw/main/models/v2/vad.json
type: http
internal: false
models:
- model:
url: https://github.com/esphome/micro-wake-word-models/raw/main/models/v2/hey_mycroft.json
type: http
internal: false
- model:
url: https://github.com/esphome/micro-wake-word-models/raw/main/models/v2/hey_mycroft.json
type: http
internal: false
microphone:
bits_per_sample: 16
channels:
- 0
gain_factor: 1
stop_after_detection: trueAnything in the logs that might be useful for us?
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
- framework-espidf @ 3.40408.0 (4.4.8)
- tool-cmake @ 3.16.4
- tool-ninja @ 1.7.1
- toolchain-esp32ulp @ 2.35.0-20220830
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
ModuleNotFoundError: No module named 'pkg_resources':
File "/usr/local/lib/python3.12/site-packages/platformio/builder/main.py", line 173:
env.SConscript("$BUILD_SCRIPT")
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
return _SConscript(self.fs, *files, **subst_kw)
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/data/cache/platformio/platforms/[email protected]/builder/main.py", line 312:
target_elf = env.BuildProgram()
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Util/envs.py", line 252:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.12/site-packages/platformio/builder/tools/piobuild.py", line 62:
env.ProcessProgramDeps()
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Util/envs.py", line 252:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.12/site-packages/platformio/builder/tools/piobuild.py", line 142:
env.BuildFrameworks(env.get("PIOFRAMEWORK"))
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Util/envs.py", line 252:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.12/site-packages/platformio/builder/tools/piobuild.py", line 352:
SConscript(env.GetFrameworkScript(name), exports="env")
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 684:
return method(*args, **kw)
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
return _SConscript(self.fs, *files, **subst_kw)
File "/data/cache/platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/data/cache/platformio/platforms/[email protected]/builder/frameworks/espidf.py", line 29:
import pkg_resources
========================== [FAILED] Took 2.41 seconds ==========================Additional information
No response
Metadata
Metadata
Assignees
Labels
No labels