Try and restart a stream 2secs after a disconnect.

This commit is contained in:
Earle F. Philhower, III committed 2017-12-14 15:58:39 -08:00
1 parent e3da480772
commit 9f42358f31
1 file changed
+9 -1
+9 -1
View File
@@ -334,11 +334,18 @@ void StartNewURL()
void loop()
{
static int lastms = 0;
static int retryms = 0;
if (millis()-lastms > 1000) {
lastms = millis();
Serial.printf_P(PSTR("Running for %d seconds...Free mem=%d\n"), lastms/1000, ESP.getFreeHeap());
}
if (retryms && millis()-retryms>0) {
retryms = 0;
newUrl = true;
}
if (newUrl) {
StartNewURL();
}
@@ -349,6 +356,7 @@ void loop()
Serial.printf_P(PSTR("Stopping decoder\n"));
decoder->stop();
StopPlaying();
retryms = millis() + 2000;
}
} else {
// Nothing here