ESP8266 web radio player, pt. 1

Napisano dnia 10.08.2015 r. o godzinie 9:00
Autor: Piotr Sperka

Introduction

About a year ago, I’ve worked on the web radio (SHOUTcast) player. It was based on the STM32, VS1053 and ENC28J60 to connect to a LAN. I made it working, but it never went beyond a prototype assembled on prototype boards. It has become so largely due to its biggest drawback – the need to be connected LAN via a cable.

ESP8266

A few months back I’ve heard from a colleague about an interesting IC – ESP8266. It is available as small module containing microcontroller, memory and a few other necessary elements. This device has built-in peripherals to support WiFi connection. Moreover, its manufacturer provides an SDK consisting of all the components needed to easily write software. When you buy it, the ESP8266 module has flashed software that uses the AT commands. But the biggest advantage is the low price – about 5-8$. Initially, I was a bit skeptical about it, but because of the price I bought one to experiment. After that, I was really surprised. The module works very stable. Also there is a large number of different alternative software available, for example one that supports the LUA scripts. However, the greatest strength of ESP8266 lies in the provided SDK, because in a short time you can write a smooth running software, exactly fitting your needs. To program the module, you don’t need any special tools, because it has a UART bootloader. The module I’ve tested had basically one major drawback – a very few pins. It had only an UART in the simplest form (Rx and Tx) and probably 2 GPIOs. Taking into account my previous tests, I’ve decided to revive the project of the web radio player, but this time using a wireless network.

Module ESP8266-ESP-01

ESP8266 ESP-01 module

First concept

I wanted to send configuration and receive data via UART. STM32 was supposed to deal with data buffering and transmission to the VS1053, as well as handle the user interface (LCD, etc.). I even made a prototype, but due to the lack of flow control in ESP-01’s UART, it would be necessary to use very large buffer memory. There were also problems with the transmission of any other data (eg. Station metadata) during playback. I’ve abandoned the project again.

Second concept

A little later new versions of the ESP8266 modules came to the market: ESP-07 and ESP-12. They have more GPIOs, including hardware SPI, which opened new possibilities. I’ve decided to get rid of the STM32 microcontroller, and send the data to the VS1053 decoder directly from the ESP8266 module. Current prototype of the device plays web radio, however it doesn’t have all the necessary elements, eg. a proper user interface or attached EEPROM memory to save stations.

Internet Radio Player prototype

A working prototype of the web radio player

Summary

At the moment there is implemented VS1053 support, it runs a simple web client and web server to display the administration panel. The panel itself already has the simplest functions. In the near future, I will publish the final schematics of the device, while the resulting code can be seen on GitHub. In the next part of the article I will describe more details and work progress. And as always – if you have any questions or ideas, please email me. I will be more than happy to respond to you.

Second part is HERE.

The administration Panel of the internet radio player

Internet Radio player Administration Panel-prototype