From e823f97f72fdd2f42210e2e47a2cf898184f2fd2 Mon Sep 17 00:00:00 2001 From: e2002 Date: Sat, 23 Sep 2023 17:29:09 +0300 Subject: [PATCH] v0.9.280 --- README.md | 5 ++++- yoRadio/src/core/network.cpp | 11 +++++++---- yoRadio/src/core/options.h | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 131e2a5..0f72e77 100644 --- a/README.md +++ b/README.md @@ -229,8 +229,11 @@ Work is in progress... --- ## Version history +#### v0.9.280 +- fixed an issue where it was impossible to reconnect when the WiFi connection was lost + #### v0.9.273 -- fixed an "Guru Meditation Error" when playing streams with installed the ESP32 v2.0.10 and higher core installed +- fixed an "Guru Meditation Error" when playing streams with the ESP32 v2.0.10 and higher core installed #### v0.9.260 - fixed date display bug for ILI9488/ILI9486 displays diff --git a/yoRadio/src/core/network.cpp b/yoRadio/src/core/network.cpp index 925cfea..48b2219 100644 --- a/yoRadio/src/core/network.cpp +++ b/yoRadio/src/core/network.cpp @@ -68,7 +68,10 @@ void Network::WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info){ player.lockOutput = false; delay(100); display.putRequest(NEWMODE, PLAYER); - if (network.lostPlaying) player.sendCommand({PR_PLAY, config.store.lastStation}); + if (network.lostPlaying) { + config.setTitle(const_PlConnect); + player.sendCommand({PR_PLAY, config.store.lastStation}); + } #ifdef MQTT_ROOT_TOPIC connectToMqtt(); #endif @@ -76,13 +79,13 @@ void Network::WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info){ void Network::WiFiLostConnection(WiFiEvent_t event, WiFiEventInfo_t info){ if(!network.beginReconnect){ - Serial.println("Lost connection, reconnecting..."); + Serial.printf("Lost connection, reconnecting to %s...\n", config.ssids[config.store.lastSSID-1].ssid); network.lostPlaying = player.isRunning(); if (network.lostPlaying) { player.lockOutput = true; player.sendCommand({PR_STOP, 0}); } display.putRequest(NEWMODE, LOST); } network.beginReconnect = true; - WiFi.begin(config.ssids[config.store.lastSSID].ssid, config.ssids[config.store.lastSSID].password); + WiFi.begin(config.ssids[config.store.lastSSID-1].ssid, config.ssids[config.store.lastSSID-1].password); } #define DBGAP false @@ -133,7 +136,7 @@ void Network::begin() { if(LED_BUILTIN!=255) digitalWrite(LED_BUILTIN, LOW); status = CONNECTED; WiFi.setSleep(false); - WiFi.onEvent(WiFiReconnected, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_CONNECTED); + WiFi.onEvent(WiFiReconnected, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_GOT_IP); WiFi.onEvent(WiFiLostConnection, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_DISCONNECTED); weatherBuf=NULL; trueWeather = false; diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h index c2f4602..37bd12b 100644 --- a/yoRadio/src/core/options.h +++ b/yoRadio/src/core/options.h @@ -1,7 +1,7 @@ #ifndef options_h #define options_h -#define YOVERSION "0.9.273" +#define YOVERSION "0.9.280" /******************************************************* DO NOT EDIT THIS FILE.