Anyone ever got this to work on a ESP32-C3 board?
Yaml
esphome:
name: test
friendly_name: TEST
platformio_options:
board_build.flash_mode: dio
board_build.f_cpu: 80000000L
on_boot:
- priority: -100
then:
- wait_until: api.connected
- delay: 1s
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.start_continuous:
esp32:
board: esp32-c3-devkitm-1
variant: esp32c3
framework:
type: esp-idf
# Enable logging cuz board has UART
logger:
baud_rate: 115200
hardware_uart: UART0
level: debug
#Pin25 GND
#Pin26 VCC
#Pin27 aka GPIO05 SD Mic
#Pin23 GPIO07 SCK
#Pin22 GPIO06 WS
debug:
# Enable Home Assistant API
api:
encryption:
key: "3gY/="
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.1.192
gateway: 192.168.1.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Test Fallback Hotspot"
password: "*"
web_server:
port: 80
captive_portal:
i2s_audio:
i2s_lrclk_pin: GPIO6 ##INMP441-WS
i2s_bclk_pin: GPIO7 ##INMP441-SCK
microphone:
platform: i2s_audio
id: external_microphone
adc_type: external
i2s_din_pin: GPIO5
channel: left
pdm: false
voice_assistant:
microphone: external_microphone
use_wake_word: false
noise_suppression_level: 2
auto_gain: 31dBFS
volume_multiplier: 2.0
id: assist
on_tts_end:
- homeassistant.service:
service: media_player.play_media
data:
media_content_id: !lambda 'return x;'
media_content_type: audio/mpeg
entity_id: media_player.windows
switch:
- platform: template
name: Use wake word
id: use_wake_word
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
on_turn_on:
- lambda: id(assist).set_use_wake_word(true);
- if:
condition:
not:
- voice_assistant.is_running
then:
- voice_assistant.start_continuous
on_turn_off:
- voice_assistant.stop
- lambda: id(assist).set_use_wake_word(false);
Log on the Device
INFO ESPHome 2024.2.1
INFO Reading configuration /config/esphome/test.yaml…
INFO Starting log output from 192.168.1.192 using esphome API
INFO Successfully connected to test @ 192.168.1.192 in 0.109s
INFO Successful handshake with test @ 192.168.1.192 in 0.087s
[16:24:10][I][app:102]: ESPHome version 2024.2.1 compiled on Mar 4 2024, 16:20:37
[16:24:10][C][wifi:577]: WiFi:
[16:24:10][C][wifi:409]: Local MAC: 54:32:04:47:D3:E4
[16:24:10][C][wifi:414]: SSID: [redacted]
[16:24:10][C][wifi:415]: IP Address: 192.168.1.192
[16:24:10][C][wifi:417]: BSSID: [redacted]
[16:24:10][C][wifi:418]: Hostname: ‘test’
[16:24:10][C][wifi:420]: Signal strength: -50 dB ▂▄▆█
[16:24:10][C][wifi:424]: Channel: 12
[16:24:10][C][wifi:425]: Subnet: 255.255.255.0
[16:24:10][C][wifi:426]: Gateway: 192.168.1.1
[16:24:10][C][wifi:427]: DNS1: 0.0.0.0
[16:24:10][C][wifi:428]: DNS2: 0.0.0.0
[16:24:10][C][logger:447]: Logger:
[16:24:10][C][logger:448]: Level: DEBUG
[16:24:10][C][logger:449]: Log Baud Rate: 115200
[16:24:10][C][logger:451]: Hardware UART: UART0
[16:24:10][C][template.switch:068]: Template Switch ‘Use wake word’
[16:24:10][C][template.switch:091]: Restore Mode: restore defaults to ON
[16:24:10][C][template.switch:057]: Optimistic: YES
[16:24:10][C][captive_portal:088]: Captive Portal:
[16:24:10][C][web_server:168]: Web Server:
[16:24:10][C][web_server:169]: Address: 192.168.1.192:80
[16:24:10][C][mdns:115]: mDNS:
[16:24:10][C][mdns:116]: Hostname: test
[16:24:10][C][ota:096]: Over-The-Air Updates:
[16:24:10][C][ota:097]: Address: 192.168.1.192:3232
[16:24:10][C][ota:100]: Using Password.
[16:24:10][C][ota:103]: OTA version: 2.
[16:24:10][W][ota:107]: Last Boot was an unhandled reset, will proceed to safe mode in 8 restarts
[16:24:10][C][api:139]: API Server:
[16:24:10][C][api:140]: Address: 192.168.1.192:6053
[16:24:10][C][api:142]: Using noise encryption: YES
[16:24:10][C][debug:064]: Debug component:
[16:24:10][D][debug:076]: ESPHome version 2024.2.1
[16:24:10][D][debug:080]: Free Heap Size: 161116 bytes
[16:24:10][D][debug:159]: Chip: Model=ESP32-C3, Features=WIFI_BGN,BLE, Cores=1, Revision=4
[16:24:10][D][debug:167]: ESP-IDF Version: 4.4.6
[16:24:10][D][debug:172]: EFuse MAC: 54:32:04:47:D3:E4
[16:24:10][D][debug:272]: Reset Reason: Power On Reset
[16:24:10][D][debug:317]: Wakeup Reason: Unknown
[16:24:17][D][switch:012]: ‘Use wake word’ Turning ON.
[16:24:17][D][switch:055]: ‘Use wake word’: Sending state ON
[16:24:17][D][voice_assistant:414]: State changed from IDLE to START_PIPELINE
[16:24:17][D][voice_assistant:420]: Desired state set to START_MICROPHONE
[16:24:17][D][voice_assistant:118]: microphone not running
[16:24:17][D][voice_assistant:202]: Requesting start…
[16:24:17][D][voice_assistant:414]: State changed from START_PIPELINE to STARTING_PIPELINE
[16:24:17][D][voice_assistant:435]: Client started, streaming microphone
[16:24:17][D][voice_assistant:414]: State changed from STARTING_PIPELINE to START_MICROPHONE
[16:24:17][D][voice_assistant:420]: Desired state set to STREAMING_MICROPHONE
[16:24:17][D][voice_assistant:155]: Starting Microphone
[16:24:17][D][voice_assistant:414]: State changed from START_MICROPHONE to STARTING_MICROPHONE
[16:24:17][D][esp-idf:000]: I (28922) I2S: DMA Malloc info, datalen=blocksize=1024, dma_buf_count=4
[16:24:17][D][voice_assistant:521]: Event Type: 1
[16:24:17][D][voice_assistant:524]: Assist Pipeline running
[16:24:17][D][voice_assistant:414]: State changed from STARTING_MICROPHONE to STREAMING_MICROPHONE
[16:24:17][D][voice_assistant:521]: Event Type: 9
[16:24:23][D][switch:016]: ‘Use wake word’ Turning OFF.
[16:24:23][D][switch:055]: ‘Use wake word’: Sending state OFF
[16:24:23][D][voice_assistant:514]: Signaling stop…
[16:24:23][D][voice_assistant:414]: State changed from STREAMING_MICROPHONE to STOP_MICROPHONE
[16:24:23][D][voice_assistant:420]: Desired state set to IDLE
[16:24:23][D][voice_assistant:521]: Event Type: 0
[16:24:23][E][voice_assistant:651]: Error: no_wake_word - No wake word detected
[16:24:23][D][voice_assistant:514]: Signaling stop…
[16:24:23][D][voice_assistant:414]: State changed from STOP_MICROPHONE to STOP_MICROPHONE
[16:24:23][D][voice_assistant:420]: Desired state set to IDLE
[16:24:23][D][voice_assistant:414]: State changed from STOP_MICROPHONE to STOPPING_MICROPHONE
[16:24:23][D][esp-idf:000]: I (34931) I2S: DMA queue destroyed
[16:24:23][D][voice_assistant:521]: Event Type: 2
[16:24:23][D][voice_assistant:611]: Assist Pipeline ended
[16:24:23][D][voice_assistant:414]: State changed from STOPPING_MICROPHONE to IDLE
I have activate the logging for Assistant in configuration.yaml
assist_pipeline:
debug_recording_dir: /config/stt/assist_pipeline
But the file always ends up 0.0KiB
When i use the Browser/app and use voice assistant there this does not happen!
So i assume the mic just doesn’t work.
I tried different things, i even have a Lolin D32 Board here which has a normal ESP32 chip. didn’t get that to work either.
I see people using esp_adf from pull #5230 but that’s S3 only right?
I don’t have speakers as i want to use my media player for that, so i only need the microphone.
L/R is linked to Ground.
BTW the mic itself is working, as tested with arduino IDE.