GNU General Public License v3.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

ESP32-MiniWebRadio 项目技术分析

项目背景与痛点

在这个流媒体音频流行的时代,拥有一款能够通过网络播放互联网电台的设备是十分必要的。然而,现有的多数解决方案往往依赖于传统PC或智能手机,对于追求便携和定制化的用户来说并不十分理想。"ESP32-MiniWebRadio"项目正好填补了这一空白,它提供了一个使用ESP32-S3/P4微控制器自主开发的互联网电台解决方案。该硬件不仅支持I2S DAC输出高质量音频还能连接SPI/RGB/DSI TFT触屏显示器,为用户提供了一个自主控制的定制化音频体验。

核心技术揭秘

ESP32-MiniWebRadio 的硬件架构十分巧妙,以下为项目的简要核心流程图:

graph TD A[用户请求流媒体] --> B[解码器启动] B --> C{"是否有误?"} C -->|"否"| D[音频播放通过I2S DAC] C -->|"是"| E[错误处理] D --> F[显示状态更新] F --> G{"用户是否触摸屏幕?"} G -->|"是"| H[接收用户输入] H -->|执行操作| I[执行用户操作] I --> F

模块化设计是ESP32-MiniWebRadio最具技术特色的部分,开发者通过将所有功能区分为多个子模块,有效地实现了单个设备上多种功能的无缝集成。一端通过ESP32-S3/P4微控制器连接无线网络,另一端通过I2S 数字音频接口衔接高质量DAC以优化音频质量,并借助TFT触屏显示器给予用户直观且交互的界面体验。

此系统深度整合了多个硬件模块和软件服务,无论是对于硬件设计还是软件实现过程中,开发者都面临了前所未有的挑战。为了解决跨平台数据传输、错误处理与用户交互等复杂问题,架构设计者利用ESP32微控制器的高性能同时简化了编解码与网络通信的任务。

功能亮点与差异

相比同类竞品,ESP32-MiniWebRadio的最大卖点在于其模块化设计,既提升了硬件的复用性也简化了后续功能扩展的开发成本。此外,项目严格遵循开源协议,为技术社区提供了一个高性能、低成本的音频解决方案。

特别值得一提的是,它可以扮演网络音频服务器的角色且能够轻松地与各种互联网音频源对接,同时集成触摸屏控制器和状态显示,这使其在众多竞品中脱颖而出,成为兼具易用性与扩展性的互联网流媒体音频设备。

应用场景与落地建议

ESP32-MiniWebRadio在家庭数据中心、互动广告牌、或是个性化智能音频中心等场景下都大有可为。部署过程中请特别关注硬件适配性和信号干扰,这些都可能影响实际使用效果。另外,对于希望进一步提升音频品质的用户,可通过二次开发逐步优化I2S链路的传输策略和音频编解码器的特性。

总之,ESP32-MiniWebRadio项目是一个成功的跨学科设计案例,其在硬件设计和软件实现上的精耕细作对有志于物联网设备开发的开发者或爱好者来说有着重要的借鉴意义。

综合评价

ESP32-MiniWebRadio项目无疑是音频爱好者值得探索的一个极富启示性的工作。它将紧凑的硬件设计与复杂的软件功能融合在一起,在确保高音质输出的同时提供了良好的用户交互与系统扩展性,为用户搭建自己的定制化流媒体音频播放器提供了可能。当然,项目也面临着兼容性和稳定性等问题,但这正是开源社区持续改进的动力之一。

关于

GitHub 原始描述(英文)

Internetradio with ESP32-S3/P4, I2S DAC and SPI/RGB/DSI TFT Display with Touchpad

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
835
价值分
356
活跃状态
活跃

语言占比

C
C++
CMake
Python

Release

README

ESP32-S3-MiniWebRadio V4

Display

MiniWebRadio Features:

  • User interfaces: TFT touchscreen display, web browser and FTP
  • Functions: WiFi Radio, Digital Clock, MP3 player, Alarm, Sleep timer, adjust screen brightness, EQ settings and Volume, web browser User Interface, access SD card via FTP (e.g. FileZilla), IR remote controller support
  • Up to 999 pre-set stations can be held in stations.csv file on SD card (can edit using web UI)
  • Each station can display its own station icon (when saved to SD card)
  • Time is obtained via Network Time Protocol (NTP) from internet. Local Time Zone can be set from web UI
  • Web UI - MiniWebRadio can be accessed via any web browser (e.g. IE/Edge/Chrome/FireFox)
  • Internal SD card can be accessed via FTP (e.g. FileZilla)
  • Your home WiFi router SSID and password can be set using the browser on your smart phone (only required on first boot) or edit the networks.csv file on SD card
  • Play audio files on SD card or on DLNA home network (via web UI)
  • Use Infra-Red (IR) remote controller (38kHz NEC-encoded - e.g. arduino or mp3 remote). The web UI allows you to configure the buttons if required
  • One Alarm time can be pre-set using display (choose days, Monday-Sunday)
  • A Sleep timer can be set using display (switches off sound and screen after a pre-set time - max. 6 hours)
  • Can announce the time each hour when in radio mode (set via web UI)
  • Screen brightness can be adjusted using display (if the display has a backlight-pin)
  • Supports the Latin, Greek and Cyrillic character sets
  • Community Radio Browser is integrated as a search engine. User can find new stations and then add them to the station list via web UI (with station icon if available) and then save the list and station icon file to the SD card
  • Channel lists can be exported or imported in Excel format (for data backup).

Required HW:
  • ESP32-S3 board with 4MB PSRAM or larger
  • DAC (e.g. PCM5102a)
  • TFT Display with Touchpad (SPI), Display controller can be ILI9341 (320x240px), ILI9486 (480x320px), ILI9488 (480x320px), ST7796 (480x320px) or RGB Display (800x480) with Touchpad (I2C) or DSI Display (1024x600) with Touchpad (I2C)
  • SD Card (FAT32) + SD adapter (can use SD slot on back of TFT display if available)
  • Display sizes Tested displays

    The display “Crowpanel ESP32 P4-Advance HMI Display 7.0 V1.0 SKU:DHE04107D” cannot be used due to a design error on the board!

Optional HW:
  • IR receiver + IR remote controller according to the NFC protocol
  • KCX_BT_EMITTER V1.7, for connecting external Bluetooth devices, needs sufficient free GPIOs
  • BH1750 light sensor: The BH1750 has a wide range of values, which is still sufficiently sensitive at average room brightness. On the display, you can set the desired brightness when the sensor is darkened. Then the display is dimmed to this value 'at night', needs sufficient free GPIOs.

Control is via the display touchscreen or a web page in a browser, no additional components such as switches, rotary encoders, capacitors or resistors are required.

Schematic
SPI Display Schematic ESP32-S3 with external DAC
Schematic ESP32-P4 with external DAC

RGB Display Schematic ESP32-S3 with RGB Display

DSI Display Schematic ESP32-P4 with DSI Display

Display Layout

Using the Community Radio Browser

How to install : PlatformIO is definitely recommended as the IDE.

Some features:
  • The audioprocess works in its own task and is decoupled. This prevents dropouts when drawing on the display or when the website is loading.
  • The SD card is wired as SD_MMC to improve stability and increase speed. This means that the GPIOs cannot be chosen freely. The SD card adapter must not have any resistors in series. For best display update speed, use 40MHz frequency for SD card if possible (SDMMC_FREQUENCY 40000000 in common.h).
  • Audio can be decoded using software. Possible formats are mp3, aac, mp4, opus, vorbis and flac.
  • External DACs (e.g. UDA13348, MAX98357A, PCM5102A) are connected via I2S, ES8388 and AC101 also require an I2C connection
  • 480x320px display supported. The ILI9486 (SPI display from the Raspberry PI) is also supported
  • The SD card files can be accessed via FTP. See settings for Filezilla. The username and password are ‘esp32’ (this can be changed in ‘common.h’)
  • Access Point SSID/password can be set using mobile phone browser - no need to modify source code or networks.csv file on SD card
  • Stations URLs support entry of username and password if the server expects access data, “URL|user|pwd”
  • Can process local playlists in m3u format
  • Either the ESP32 or the ESP32-S3 can be used (PSRAM is highly recommended)
  • IR remote button codes can be changed by user using web UI
  • Improved web UI reliability
  • VU meter added to display
  • Timezone can be set using web UI
  • Play media files on home network DLNA (uPNP/DLNA app on smart phone, router, etc.)
  • Prevent clicks when changing radio stations

Codec
mp3 y
aac y
aacp y (+SBR, +PS)
wav y
flac y (blocksize max 16KB)
vorbis y <=256Kbit/s
m4a y
opus y (except hybrid mode)


self-made devices of the users


Known problems

SD Card

In the simplest case, the SD card is connected directly to the ESP32
SD Card Pinout
Some SD card adapters for displays use series resistors. These are useless and in many cases harmful. Therefore, it is better to remove them and replace them with solder bridges.
Display Resistors
If an ESP32 is used, any existing pull-up resistor at pin D0 must be removed (ESP32 - bootstrap pin). This will be added again later via SW. This is not necessary with the ESP32-S3. (Photo from the ESPuino forum)SD Card Adapter ESP32

Display

Many displays can be used without any problems. If the touchpad does not work, it may be that the TFT controller does not enable the SPI bus. This is the case with my ILI9488 display. Then MISO of the TFT controller must not be connected.
ILI9488 Display The values ​​of the PLCK frequency specified for RGB displays are not fully achieved. The reason for this is the high load of PSRAM for audio processing.

DAC

On some PCM5102 boards the solder bridges are missing on the back.
PCM5102A Board
This is how the DAC CS4344 is connected:
CS4344 Board
This is how the DAC CS4344 is connected:
PT8211 Board
If the DAC PT8211 is used, the I2S_COMM_FMT must be changed in common.h. This DAC requires Japanese LSBJ (Least Significant Bit Justified) format

IR Receíver

Various 38KHz IR receivers can be used. While the TSOP4838 can be used without any problems, the VS1838B is very sensitive to high frequency fields despite its metal shielding. The VS1838B should not be installed near the WiFi antenna. The HS0038A2D is also suitable. HS0038 - HS0038A2 can be used with Vcc 5V.
IR Receiver

IR Remote Control

The remote control must support the NEC protocol. If several remote controls are operated in one room, they must have different address codes to avoid mutual interference. The “Arduino” remote control on the left in the picture uses the address code 0x00FF and the “Android X96” remote control (right) uses the address code 0x01FE.
IR Transmitter

KCX_BT_EMITTER

The RT pin is not part of the soldering strip, but is located in the middle of the right side.
PCM5102A Board

WiFi Credentials

If you see that, there are illegal characters in the WIFI access data. Sometimes only an erase flash help Wrong Credentials


___________________________________________________________

MWR

评论

暂无评论