@@ -1877,14 +1877,6 @@ void RTK_WIFI::stationEventHandler(arduino_event_id_t event, arduino_event_info_
1877
1877
bool success;
1878
1878
int type;
1879
1879
1880
- // Take the network offline if necessary
1881
- if (networkInterfaceHasInternet (NETWORK_WIFI_STATION) && (event != ARDUINO_EVENT_WIFI_STA_GOT_IP) &&
1882
- (event != ARDUINO_EVENT_WIFI_STA_GOT_IP6))
1883
- {
1884
- // Stop WiFi to allow it to restart
1885
- networkInterfaceEventStop (NETWORK_WIFI_STATION);
1886
- }
1887
-
1888
1880
// ------------------------------
1889
1881
// WiFi Status Values:
1890
1882
// WL_CONNECTED: assigned when connected to a WiFi network
@@ -1930,18 +1922,8 @@ void RTK_WIFI::stationEventHandler(arduino_event_id_t event, arduino_event_info_
1930
1922
// Start the reconnection timer
1931
1923
if (event == ARDUINO_EVENT_WIFI_STA_DISCONNECTED)
1932
1924
{
1933
- if (settings.debugWifiState && _verbose && !wifiReconnectionTimer)
1934
- systemPrintf (" WiFi: Reconnection timer started\r\n " );
1935
- wifiReconnectionTimer = millis ();
1936
- if (!wifiReconnectionTimer)
1937
- wifiReconnectionTimer = 1 ;
1938
- }
1939
- else
1940
- {
1941
- // Stop the reconnection timer
1942
- if (settings.debugWifiState && _verbose && wifiReconnectionTimer)
1943
- systemPrintf (" WiFi: Reconnection timer stopped\r\n " );
1944
- wifiReconnectionTimer = 0 ;
1925
+ networkInterfaceEventInternetLost (NETWORK_WIFI_STATION, __FILE__, __LINE__);
1926
+ wifiReconnectRequest = true ;
1945
1927
}
1946
1928
1947
1929
// Fall through
@@ -1963,6 +1945,12 @@ void RTK_WIFI::stationEventHandler(arduino_event_id_t event, arduino_event_info_
1963
1945
// V
1964
1946
1965
1947
case ARDUINO_EVENT_WIFI_STA_LOST_IP:
1948
+ if (event == ARDUINO_EVENT_WIFI_STA_LOST_IP)
1949
+ {
1950
+ networkInterfaceEventInternetLost (NETWORK_WIFI_STATION, __FILE__, __LINE__);
1951
+ wifiReconnectRequest = true ;
1952
+ }
1953
+
1966
1954
// Mark the WiFi station offline
1967
1955
if (_started & WIFI_STA_ONLINE)
1968
1956
systemPrintf (" WiFi: Station offline!\r\n " );
0 commit comments