This commit is contained in:
e2002
2023-09-23 17:29:09 +03:00
parent 3662c2dbb7
commit e823f97f72
3 changed files with 12 additions and 6 deletions

View File

@@ -229,8 +229,11 @@ Work is in progress...
--- ---
## Version history ## Version history
#### v0.9.280
- fixed an issue where it was impossible to reconnect when the WiFi connection was lost
#### v0.9.273 #### 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 #### v0.9.260
- fixed date display bug for ILI9488/ILI9486 displays - fixed date display bug for ILI9488/ILI9486 displays

View File

@@ -68,7 +68,10 @@ void Network::WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info){
player.lockOutput = false; player.lockOutput = false;
delay(100); delay(100);
display.putRequest(NEWMODE, PLAYER); 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 #ifdef MQTT_ROOT_TOPIC
connectToMqtt(); connectToMqtt();
#endif #endif
@@ -76,13 +79,13 @@ void Network::WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info){
void Network::WiFiLostConnection(WiFiEvent_t event, WiFiEventInfo_t info){ void Network::WiFiLostConnection(WiFiEvent_t event, WiFiEventInfo_t info){
if(!network.beginReconnect){ 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(); network.lostPlaying = player.isRunning();
if (network.lostPlaying) { player.lockOutput = true; player.sendCommand({PR_STOP, 0}); } if (network.lostPlaying) { player.lockOutput = true; player.sendCommand({PR_STOP, 0}); }
display.putRequest(NEWMODE, LOST); display.putRequest(NEWMODE, LOST);
} }
network.beginReconnect = true; 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 #define DBGAP false
@@ -133,7 +136,7 @@ void Network::begin() {
if(LED_BUILTIN!=255) digitalWrite(LED_BUILTIN, LOW); if(LED_BUILTIN!=255) digitalWrite(LED_BUILTIN, LOW);
status = CONNECTED; status = CONNECTED;
WiFi.setSleep(false); 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); WiFi.onEvent(WiFiLostConnection, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_DISCONNECTED);
weatherBuf=NULL; weatherBuf=NULL;
trueWeather = false; trueWeather = false;

View File

@@ -1,7 +1,7 @@
#ifndef options_h #ifndef options_h
#define options_h #define options_h
#define YOVERSION "0.9.273" #define YOVERSION "0.9.280"
/******************************************************* /*******************************************************
DO NOT EDIT THIS FILE. DO NOT EDIT THIS FILE.