and I’m trying to use the i2c_audio / microphone support in ESPHome to use it but I’m unsure how to go about it. I tried making a YAML like this (with an ESP32 SoC):
Primarily because it defined the i2s_lrclk_pin as potentially WS, but I also have an LR pin and a CK pin but I see that there are three clock options (!) on the i2s_audio ESPHome component. I’m confused as to which goes where.
I found this datasheet PDF file: https://dl.sipeed.com/MAIX/HDK/Chip_DS/麦克_MSM261S4030H0(使用的).pdf that shows WS is Serial Data-Word Select and CK is SCK or Serial Data Clock, the L/R appears to just configure left vs. right if tied to ground vs. VDD, respectively which is why I hooked it up like that. Anyway, with this configuration, ESPHome device doesn’t expose any microphone entity, so I’m definitely missing something.
Anyone know:
Is it possible to configure this type of microphone to work with ESPHome? If so, how?
How do I use a microphone from an ESPHome device? Do I need to define a voice_assistant? Is that the only way?
I’m really stuck on this. I tried it a bunch more tonight and every time I manually trigger the STT process the pipeline seems to get stuck immediately:
… and it never comes back from this, it just spins on the Speech-to-text section.
This is what the raw serial-to-USB log looks like when I manually trigger a listen event:
[21:53:37][C][audio:218]: Internal DAC mode: Left & Right
[21:53:50][D][button:010]: 'Fire Listener' Pressed.
[21:53:50][D][main:282]: Button Pressed
[21:53:50][D][voice_assistant:132]: Requesting start...
[21:53:50][D][voice_assistant:111]: Starting...
[21:53:50][D][voice_assistant:154]: Assist Pipeline running
[21:53:50][D][main:304]: voice_start
[21:53:50][W][light:476]: 'Response Light' - No such effect 'pulse'
[21:53:50][D][light:036]: 'Response Light' Setting:
[21:53:50][D][light:047]: State: ON
[21:53:51][D][light:036]: 'Response Light' Setting:
[21:53:51][D][light:047]: State: OFF
[21:53:58][D][sensor:094]: 'AudioTest Uptime Raw': Sending state 28.89900 s with 0 decimals of accuracy
[21:54:05][D][text_sensor:064]: 'AudioTest Uptime': Sending state '28s'
[21:54:20][D][voice_assistant:218]: Assist Pipeline ended
[21:54:20][D][main:085]: voice_end
[21:54:20][E][voice_assistant:231]: Error: pipeline-timeout - Pipeline timeout
[21:54:20][D][voice_assistant:144]: Signaling stop...
[21:54:20][D][main:102]: voice_error
[21:54:20][D][light:036]: 'Response Light' Setting:
[21:54:20][D][light:047]: State: ON
[21:54:21][D][light:036]: 'Response Light' Setting:
[21:54:21][D][light:047]: State: OFF
[21:54:21][D][light:036]: 'Response Light' Setting:
[21:54:28][D][sensor:094]: 'AudioTest Uptime Raw': Sending state 58.88900 s with 0 decimals of accuracy
I put a little LED on the proto board so I can see it light up when the voice pipeline is started and finished (or errored). It never seems to receive anything.
@SpikeyGG Did you get anywhere with this device? I’ve found one in box of components and trying to get it going but getting nowhere. It could be that I’m using a Seeed Studio Xiao ESP32C3, also a left over device!
As for the pin definitions, I agree with what you said in the first post, I also have tried the Left/Right, but not the PDM choice yet. When I tried a bit of Arduino test code to test the microphone and the speaker, it looks like I was getting a response from the microphone but the speaker was terrible.
I do have a working configuration with a different microphone and controller, so I know HA configuration works.
Yeah, this was happening (the stuck HA Voice Assistant) because my network was blocking the packets from reaching the Home Assistant address. Once I opened the network path with firewall rules HA received the requests.
I have this microphone working using the below code. Can trigger using the wake word. I have the LR pin pulled high which says it should be set to right but only works when I set the channel in code to left.
I did not need to port forward. However, I opened everything to that ESPHome device’s IP on my router because everything is on VLANs. Unless you’re trying to issue commands over the internet, you shouldn’t need to port forward… I think your local Home Assistant should talk directly to your local ESPHome device but I could be wrong.