I found a random guide online about making a voice assistant using a LyraT esp32 that seemed really easy to follow… but i had major issues getting a hold of that model and ended up accidentally buying a LyraT-Mini…
Since then I’ve been trying my best to get it to work as it still has a mic and speaker jacks along with WiFi. At one point I had it able to activate using a wake word but it wouldn’t actually do anything… that was a few months ago, i recently picked it up and have been fiddling and now i can’t even get that far.
I’ve never done anything with ESP before this, and i’m way out of my depth. I’ve been arguing with Gemini over the schematics and such to try and get my code to work and… well it’s not.
It’ll turn on, I can find it in Home assistant, I can turn on an LED remotely, but nothing with thhe speaker or mic seem to work. I currently have the headphone jack plugged in as i’m not going to bother hooking up the dedicated speaker until I know it actually works. I’m hoping someone will take pity on my and help me out. here’s the config that i butchered from the original guide and Gemini
I’m like 99% sure both the media player and microphone sections are wrong, but i dont know how or in what way.
Here’s a link to the documentation i’m using: ESP32-LyraT-Mini V1.2 Hardware Reference - - — Audio Development Framework latest documentation
substitutions:
name: "test-speaker"
friendly_name: Test Speaker
esphome:
name: ${name}
friendly_name: ${friendly_name}
min_version: 2024.6.0
name_add_mac_suffix: false
project:
name: esphome.web
version: '1.0'
esp32:
board: esp-wrover-kit
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
# Allow provisioning Wi-Fi via serial
improv_serial:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Set up a wifi access point
# To have a "next url" for improv serial
web_server:
i2c:
sda: GPIO18
scl: GPIO23
external_components:
- source: github://rpatel3001/esphome@es8311
components: [ es8311 ]
es8311:
i2s_audio:
i2s_lrclk_pin: GPIO25
i2s_bclk_pin: GPIO5
switch:
- platform: gpio
pin: GPIO21
name: "Speaker Switch"
id: amp_switch
restore_mode: ALWAYS_ON
- platform: gpio
pin: GPIO27
name: "LED"
id: LED
restore_mode: RESTORE_DEFAULT_OFF
- platform: template
name: Use wake word
id: use_wake_word
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
entity_category: config
on_turn_on:
- if:
condition:
not:
- voice_assistant.is_running
then:
- voice_assistant.start_continuous
on_turn_off:
- voice_assistant.stop
microphone:
- platform: i2s_audio
id: mic
adc_type: external
i2s_din_pin: GPIO26 # I2S DSDIN
sample_rate: 16000 # Or another appropriate rate
# channel: left # Try commenting this out or setting to 'right' or 'both'
#microphone:
# - platform: i2s_audio
# id: mic
# adc_type: external
# i2s_din_pin: GPIO35
# pdm: False
# channel: left
media_player:
- platform: i2s_audio
name: speaker
id: test_speaker_speaker
dac_type: internal # Use internal DAC
# i2s_dout_pin: GPIO19 # I2S Data Output
mode: stereo
#media_player:
# - platform: i2s_audio
# name: speaker
# id: test_speaker_speaker
# dac_type: external
# i2s_dout_pin: GPIO26
# mode: mono
# i2s_dout_pin: GPIO26
voice_assistant:
microphone: mic
use_wake_word: true
noise_suppression_level: 2
auto_gain: 31dBFS
media_player: test_speaker_speaker
id: assist
on_wake_word_detected:
- switch.turn_on:
id: LED
on_listening:
- switch.turn_on:
id: LED
on_end:
- switch.turn_off:
id: LED