Fixing I2S Initialization Error for Voice-Controlled Home Automation on ESP32

Hey guys am developing a home automation voice-controlled system using MicroPython and TinyML on an ESP32 microcontroller to recognize specific voice commands ("turn on" and "turn off") for controlling an LED, How do I set up the ESP32 with an I2S microphone and an LED for a voice-controlled system? Am encountering an error OSError: I2S Not Found But I have verified the physical connections of the microphone to the ESP32. Re-checked the pin numbers in the I2S configuration. Confirmed the ESP32 firmware supports I2S functionality. Here's my code
from machine import Pin, I2S

# Configure LED on GPIO 2
led = Pin(2, Pin.OUT)

# Configure I2S for microphone input
i2s = I2S(0,
sck=Pin(14),
ws=Pin(15),
sd=Pin(32),
mode=I2S.RX,
bits=16,
format=I2S.MONO,
rate=16000,
ibuf=2000)
from machine import Pin, I2S

# Configure LED on GPIO 2
led = Pin(2, Pin.OUT)

# Configure I2S for microphone input
i2s = I2S(0,
sck=Pin(14),
ws=Pin(15),
sd=Pin(32),
mode=I2S.RX,
bits=16,
format=I2S.MONO,
rate=16000,
ibuf=2000)
My aim is to resolve the I2S initialization error to successfully capture audio input from the microphone
Solution:
Hey @Enthernet Code Update to the latest MicroPython firmware that supports I2S on your ESP32 Verify that the sck, ws, and sd pins are correctly assigned for I2S functionality, and initialize I2S with I2S.NUM0 to fix the error...
Jump to solution
8 Replies
Solution
wafa_ath
wafa_ath4mo ago
Hey @Enthernet Code Update to the latest MicroPython firmware that supports I2S on your ESP32 Verify that the sck, ws, and sd pins are correctly assigned for I2S functionality, and initialize I2S with I2S.NUM0 to fix the error
Enthernet Code
Enthernet Code4mo ago
Okay @wafa_ath would do this and give u a feedback
Enthernet Code
Enthernet Code4mo ago
After d update everything seems to fall in place, thanks 👍
ZacckOsiemo
ZacckOsiemo4mo ago
I don't know python but I have a good feeling of what is happening here
ZacckOsiemo
ZacckOsiemo4mo ago
Your package manager is out of sync
ZacckOsiemo
ZacckOsiemo4mo ago
somewhere you are downloading version x whereas your system is expecting version y
ZacckOsiemo
ZacckOsiemo4mo ago
If you can interpret this in python, you can fix this
Enthernet Code
Enthernet Code4mo ago
Okay thanks for the idea I'll look into this
Want results from more Discord servers?
Add your server