Forum

Einloggen | Registrieren | RSS  

WLAN-Radio Adressen (Elektronik)

verfasst von RR, 24.09.2025, 20:45 Uhr

» Dann stimmt an der Software etwas nicht. :-|

Schau sie dir doch mal an:
#include
#define UNDEFINED -1
#ifdef ARDUINO_ARCH_ESP8266
#include
#define VS1053_CS D1
#define VS1053_DCS D0
#define VS1053_DREQ D3
#endif

#ifdef ARDUINO_ARCH_ESP32
#include
#define VS1053_CS 5
#define VS1053_DCS 16
#define VS1053_DREQ 4
#endif

// Lautstärke:
#define VOLUME 80 // maximal 99

VS1053 player(VS1053_CS, VS1053_DCS, VS1053_DREQ, UNDEFINED, SPI);
WiFiClient client;

// WiFi hier eintragen:
const char *ssid = "euer SSID Name";
const char *password = "SSID Passwort";

//Erfolgreich getestete Sender:
const char *host = "ic.radiomonster.fm";
const char *path = "/tophits.ultra"; //Tophits Kanal
//const char *path = "/dance.ultra"; //Dance Kanal
//const char *path = "/evergreens.ultra"; //Evergreens Kanal
//const char *path = "/schlager.ultra"; //Schlager Kanal
int httpPort = 80;

//const char *host = "icecast.omroep.nl";
//const char *path = "/radio6-bb-mp3";
//int httpPort = 80;

//const char *host = "puma.streemlion.com";
//const char *path = "/stream";
//int httpPort = 1960;

// Die Puffergröße 64 scheint optimal zu sein. Bei 32 und 128 könnte der Klang blechern klingen
uint8_t mp3buff[64];

void setup() {
Serial.begin(115200);

// 3 Sekunden Pause, bis VS1053 eingeschaltet sind
// sonst startet das System möglicherweise nicht richtig
delay(3000);

// This can be set in the IDE no need for ext library
// system_update_cpu_freq(160);

Serial.println("nnEinfaches Wifi Radio startet");

SPI.begin();
player.beginOutput();
player.setVolume(VOLUME);

Serial.print("Connecting to SSID ");
Serial.println(ssid);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());

Serial.print("connecting to ");
Serial.println(host);

if (!client.connect(host, httpPort)) {
Serial.println("Connection failed");
return;
}

Serial.print("Requesting stream: ");
Serial.println(path);

client.print(String("GET ") + path + " HTTP/1.1rn" +
"Host: " + host + "rn" +
"Connection: closernrn");
}

void loop() {
if (!client.connected()) {
Serial.println("Reconnecting...");
if (client.connect(host, httpPort)) {
client.print(String("GET ") + path + " HTTP/1.1rn" +
"Host: " + host + "rn" +
"Connection: closernrn");
}
}

if (client.available() > 0) {
// Die Puffergröße 64 scheint optimal zu sein. Bei 32 und 128 könnte der Klang blechern klingen
uint8_t bytesread = client.read(mp3buff, 64);
player.playChunk(mp3buff, bytesread);
}
}

Gruß RR



Gesamter Thread:

WLAN-Radio Adressen - RR, 24.09.2025, 14:54 (Elektronik)
WLAN-Radio Adressen - bigdie(R), 24.09.2025, 15:27
WLAN-Radio Adressen - RR, 24.09.2025, 15:56
WLAN-Radio Adressen - DIY-Bastler(R), 24.09.2025, 16:28
WLAN-Radio Adressen - RR, 24.09.2025, 16:57
WLAN-Radio Adressen - DIY-Bastler(R), 24.09.2025, 19:30
WLAN-Radio Adressen - RR, 24.09.2025, 20:45
WLAN-Radio Adressen - RR, 24.09.2025, 21:05
WLAN-Radio Adressen - bastelix(R), 24.09.2025, 22:00
WLAN-Radio Adressen - RR, 24.09.2025, 22:18
WLAN-Radio Adressen - bastelix(R), 24.09.2025, 23:05
WLAN-Radio Adressen - RR, 24.09.2025, 23:14
WLAN-Radio Adressen - RR, 25.09.2025, 14:00