esp32-pcm5102mk-example
Project Information
ESP32-based internet radio with WiFi captive portal configuration.
Flash to Device
Login required: You need to login or create an account to flash this project.
Source Files (3)
Download AllREADME
ESP32 Internet Radio â WiFi Captive Portal Setup
Configure WiFi credentials via captive portal and stream internet radio đļ
This project turns an ESP32 into a standalone internet radio receiver with a built-in WiFi captive portal.
On first boot (or when no WiFi credentials are stored), the ESP32 creates its own WiFi Access Point and displays a captive portal that allows the user to:
- scan for nearby WiFi networks
- select a network
- enter the WiFi password
The credentials are saved in flash memory, the device automatically reboots, connects to the selected network, and starts streaming internet radio via I2S audio output.
â Features
đĄ WiFi captive portal for first-time setup
- Automatic WiFi network scan
- SSID + password entry via browser
đ Auto redirect captive portal
- Works on Android / iOS / Windows / Linux
đž WiFi credentials stored in flash (NVS)
- No need to reconfigure after power loss
đ Automatic reboot after configuration
đļ Internet radio streaming (MP3)
đ I2S audio output
- Compatible with PCM5102MK, PCM5102A, etc.
đ Fully standalone â no serial input required after flashing
đĻ Hardware Requirements
ESP32 (ESP32-WROOM / Dev Module / DevKitC)
I2S DAC or amplifier
- PCM5102MK (recommended)
- PCM5102A
Speaker or external audio system
WiFi network with internet access
Default I2S pin configuration
// GPIO26 -> BCLK
// GPIO25 -> LRC (WS / LCK)
// GPIO22 -> DIN / DATA
âšī¸ Pins can be changed in the code if needed.
đ§ Software Requirements
Arduino IDE
ESP32 Board Package
Boards Manager â esp32 by Espressif Systems
Required Libraries
Install via Arduino Library Manager:
WiFiManagerby tzapuESP32 Audio I2S(ESP8266Audio)
Used core libraries:
WiFiWebServerDNSServer
đ Getting Started
Open the project in Arduino IDE
Select the board, for example:
ESP32 Dev ModuleSelect the correct COM port
Upload the sketch to the ESP32
Open Serial Monitor (115200 baud) for logs (optional)
đļ First Boot â WiFi Configuration
Power the ESP32
A new WiFi network appears:
ESP32-Radio-SetupConnect to it using your phone or computer
The captive portal opens automatically
If not, open:
http://192.168.4.1
Select your WiFi network
Enter the password
Click Save
âĄī¸ The ESP32 will reboot automatically and connect to WiFi.
đ§ Normal Operation
After WiFi credentials are stored:
- ESP32 boots
- Connects to saved WiFi automatically
- Starts streaming internet radio
- Audio is played via the I2S DAC
No user interaction required đĩ
đ Captive Portal Behavior
The captive portal responds to common OS connectivity checks:
- Android â
/generate_204 - iOS / macOS â
/hotspot-detect.html - Windows â
/ncsi.txt
Any URL entered in the browser is redirected to the WiFi configuration page.
đ Reset WiFi Settings
To force WiFi reconfiguration, you can:
- call
wm.resetSettings()in code (temporary) - or add a physical reset button (recommended)
This will erase stored credentials and re-enable the captive portal.
đ Customization Ideas
You can easily extend this project with:
đ Web interface for:
- volume control
- station selection
đģ Multiple radio stations
đž Station list stored in flash
đ Hardware buttons
đĄ OTA firmware updates
đ¨ Custom captive portal UI (HTML/CSS)
đ¤ Deep sleep support
đ License
This project is released under the MIT License.
You are free to use, modify, and share it in personal and commercial projects.