ESP32, ESP-IDF program for Internet radio using VS1003 and ESP32
/* HTTP GET Example using plain POSIX sockets This example code is in the Public Domain (or CC0 licensed, at your option.) Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ ///////////////////////////////////////////////// ///////// Working frequenzy : 80 MHz //////////// ///////////////////////////////////////////////// ////////////////////////////////////////////////////// ///// VS1053 - ESP32 Connections ////// ////////////////////////////////////////////////////// //////////// VS1053_CS - ESP32 G5 /////////////// //////////// VS1053_DCS - ESP32 G16 /////////////// //////////// VS1053_DREQ - ESP32 G4 /////////////// //////////// VS1053_SCLK - ESP32 G18 /////////////// //////////// VS1053_MOSI - ESP32 G23 /////////////// //////////// VS1053_MISO - ESP32 G19 /////////////// //////////// VS1053_XRST - ESP32 EN /////////////// ////////////////////////////////////////////////////// #include <string.h#include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "esp_system.h" #include "esp_wifi.h" #include "esp_event.h" #include "esp_log.h" #include "nvs_flash.h" #include "protocol_examples_common.h" #include "esp_pm.h" #include "lwip/err.h" #include "lwip/sockets.h" #include "lwip/sys.h" #include "lwip/netdb.h" #include "lwip/dns.h" #include "driver/gpio.h" /* Cosmos radio */ #define WEB_SERVER "radiostreaming.ert.gr" #define WEB_PORT "80" #define WEB_PATH "/ert-kosmos" /* Sehion radio */ //#define WEB_SERVER "199.195.194.140" //#define WEB_PORT "8012" //#define WEB_PATH "/stream" #define misoPin 19 #define mosiPin 23 #define clkPin 18 #define csPin 5 #define dcsPin 16 #define dreqPin 4 #define vs1003_chunk_size 32 static const char *REQUEST = "GET " WEB_PATH " HTTP/1.1\r\n" "Host: "WEB_SERVER":"WEB_PORT"\r\n" "Connection: close\r\n" "\r\n";
Read More
Arduino program for internet radio using VS1003 and ESP32

Arduino program for Internet radio using VS1003 and ESP32.

#include <VS1053.h> #include "freertos/FreeRTOS.h" #include "freertos/task.h" #ifdef ARDUINO_ARCH_ESP8266 #include <ESP8266WiFi.h> #define VS1053_CS D1 #define VS1053_DCS D0 #define VS1053_DREQ D3 #endif ////////////////////////////////////////////////////// ///// VS1053 - ESP32 Connections ////// ////////////////////////////////////////////////////// //////////// VS1053_CS - ESP32 G5 /////////////// //////////// VS1053_DCS - ESP32 G16 /////////////// //////////// VS1053_DREQ - ESP32 G4 /////////////// //////////// VS1053_SCLK - ESP32 G18 /////////////// //////////// VS1053_MOSI - ESP32 G23 /////////////// //////////// VS1053_MISO - ESP32 G19 /////////////// //////////// VS1053_XRST - ESP32 EN /////////////// ////////////////////////////////////////////////////// #ifdef ARDUINO_ARCH_ESP32 #include <WiFi.h>
Read More
X