@@ -55,21 +55,28 @@ unsigned long WiFiConnectionHandler::getTime()
55
55
NetworkConnectionState WiFiConnectionHandler::update_handleInit ()
56
56
{
57
57
#ifndef BOARD_ESP8266
58
+ #if !defined(__AVR__)
58
59
Debug.print (DBG_INFO, F (" WiFi.status(): %d" ), WiFi.status ());
60
+ #endif
59
61
if (WiFi.status () == NETWORK_HARDWARE_ERROR)
60
62
{
63
+ #if !defined(__AVR__)
61
64
Debug.print (DBG_ERROR, F (" WiFi Hardware failure.\n Make sure you are using a WiFi enabled board/shield." ));
62
65
Debug.print (DBG_ERROR, F (" Then reset and retry." ));
66
+ #endif
63
67
return NetworkConnectionState::ERROR;
64
68
}
65
-
69
+ # if !defined(__AVR__)
66
70
Debug.print (DBG_ERROR, F (" Current WiFi Firmware: %s" ), WiFi.firmwareVersion ());
71
+ #endif
67
72
68
73
#if defined(WIFI_FIRMWARE_VERSION_REQUIRED)
69
74
if (WiFi.firmwareVersion () < WIFI_FIRMWARE_VERSION_REQUIRED)
70
75
{
76
+ #if !defined(__AVR__)
71
77
Debug.print (DBG_ERROR, F (" Latest WiFi Firmware: %s" ), WIFI_FIRMWARE_VERSION_REQUIRED);
72
78
Debug.print (DBG_ERROR, F (" Please update to the latest version for best performance." ));
79
+ #endif
73
80
delay (5000 );
74
81
}
75
82
#endif
@@ -96,13 +103,17 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnecting()
96
103
97
104
if (WiFi.status () != NETWORK_CONNECTED)
98
105
{
106
+ #if !defined(__AVR__)
99
107
Debug.print (DBG_ERROR, F (" Connection to \" %s\" failed" ), _ssid);
100
108
Debug.print (DBG_INFO, F (" Retrying in \" %d\" milliseconds" ), CHECK_INTERVAL_TABLE[static_cast <unsigned int >(NetworkConnectionState::CONNECTING)]);
109
+ #endif
101
110
return NetworkConnectionState::CONNECTING;
102
111
}
103
112
else
104
113
{
114
+ #if !defined(__AVR__)
105
115
Debug.print (DBG_INFO, F (" Connected to \" %s\" " ), _ssid);
116
+ #endif
106
117
#ifdef BOARD_ESP8266
107
118
configTime (0 , 0 , " time.arduino.cc" , " pool.ntp.org" , " time.nist.gov" );
108
119
#endif
@@ -114,12 +125,15 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnected()
114
125
{
115
126
if (WiFi.status () != WL_CONNECTED)
116
127
{
128
+ #if !defined(__AVR__)
117
129
Debug.print (DBG_VERBOSE, F (" WiFi.status(): %d" ), WiFi.status ());
118
130
Debug.print (DBG_ERROR, F (" Connection to \" %s\" lost." ), _ssid);
119
-
131
+ # endif
120
132
if (_keep_alive)
121
133
{
134
+ #if !defined(__AVR__)
122
135
Debug.print (DBG_ERROR, F (" Attempting reconnection" ));
136
+ #endif
123
137
}
124
138
125
139
return NetworkConnectionState::DISCONNECTED;
0 commit comments