Hello,
I came across some examples using an ESP32 S3 with an onboard tiny wake word detection. So I followed this example: How To Setup On-Device Wake Word Detection For Voice Assistant using Micro Wake Word | Smart Home Circle
But it is not working. There was always a loud noise from the speaker. So I found some other examples where the I2S for the microphone and the speaker are split. I tried this and the tiny wake word was working once. But then never again. I have no idea how to troubleshoot this and hope for some hints or help.
What is working: I can switch the Microphone Mute on or off in HA and this also is shown by my LED ring.
What is not working: No matter how I say the wake word, the LED ring is not responding to it.
If I change the LEDs (color, brightness, etc.) there is also the loud noise on the speaker.
But this seems to be a minor issue which may can be fixed later with a muting either in hardware or maybe in software while the light is changed.
What I have tried:
I have rewired everythin several times, measured for the correct connections and shorts. In my last try yesterday I also soldered every connection to be sure I have no loose contact.
Here is my ESP-Home File:
The wiring of the data pins is also commented in the code below. The LRCLK Pin of the Microphone is connected to GND as shown in the example above, the supply of the microphone is 3,3V from the ESP32, the amp supply is 5,0V from the ESP32 5V Pin.
esphome:
name: voice-assistant
friendly_name: Voice Assistant
platformio_options:
board_build.flash_mode: dio
esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
framework:
type: esp-idf
sdkconfig_options:
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
CONFIG_AUDIO_BOARD_CUSTOM: "y"
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "N9N+F3hmN6Sv+8KulwdNhMy9dVVFhdbDnZtQlpHWqws="
ota:
- platform: esphome
password: "cadad1e70e9ab95a8b7f90312264e019"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
captive_portal:
web_server:
psram:
mode: octal
speed: 80MHz
light:
- platform: esp32_rmt_led_strip
id: led_bar
rgb_order: GRB
chipset: ws2812
pin: GPIO5
num_leds: 24
rmt_channel: 0
name: "LED bar"
effects:
- pulse:
- addressable_scan:
name: scan
move_interval: 100ms
scan_width: 1
switch:
- platform: template
id: mute
name: "Mute microphone"
optimistic: true
on_turn_on:
- micro_wake_word.stop:
- voice_assistant.stop:
- light.turn_on:
id: led_bar
red: 100%
green: 0%
blue: 0%
brightness: 30%
on_turn_off:
- micro_wake_word.start:
- delay: 2s
- light.turn_off:
id: led_bar
i2s_audio:
- id: i2s_in
i2s_lrclk_pin: GPIO3 #MIC WS
i2s_bclk_pin: GPIO2 #MIC SCK
- id: i2s_out
i2s_lrclk_pin: GPIO6 #AMP LRCLK
i2s_bclk_pin: GPIO7 #AMP BLCK
microphone:
- platform: i2s_audio
id: va_mic
adc_type: external
i2s_din_pin: GPIO4 #MIC SD
channel: left
pdm: false
i2s_audio_id: i2s_in
bits_per_sample: 32bit
speaker:
platform: i2s_audio
id: va_speaker
i2s_audio_id: i2s_out
dac_type: external
i2s_dout_pin: GPIO8 #AMP DIN
mode: mono
micro_wake_word:
models:
- model: alexa
on_wake_word_detected:
- voice_assistant.start:
wake_word: !lambda return wake_word;
- light.turn_on:
id: led_bar
red: 0%
green: 0%
blue: 100%
brightness: 80%
voice_assistant:
id: va
microphone: va_mic
speaker: va_speaker
noise_suppression_level: 2.0
volume_multiplier: 4.0
on_stt_end:
then:
- light.turn_off: led_bar
on_error:
- micro_wake_word.start:
on_end:
then:
- light.turn_off: led_bar
- wait_until:
not:
voice_assistant.is_running:
- micro_wake_word.start:
How do I troubleshoot this? Can I test the speaker from Home Assistant? How do I check if the Microphone is recognizing anything at all?
best regards
Andreas