Skip to content

Commit

Permalink
v0.9.280
Browse files Browse the repository at this point in the history
  • Loading branch information
e2002 committed Sep 23, 2023
1 parent 3662c2d commit e823f97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions yoRadio/src/core/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,24 @@ 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
}

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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion yoRadio/src/core/options.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit e823f97

Please sign in to comment.