Skip to content

Refactoring debug messages into macro defined calls #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/CatM1ConnectionHandler.cpp
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ NetworkConnectionState CatM1ConnectionHandler::update_handleInit()
_settings.catm1.band,
_reset))
{
Debug.print(DBG_ERROR, F("The board was not able to register to the network..."));
DEBUG_ERROR(F("The board was not able to register to the network..."));
_reset = true;
return NetworkConnectionState::DISCONNECTED;
}
@@ -93,26 +93,26 @@ NetworkConnectionState CatM1ConnectionHandler::update_handleConnecting()
{
if (!GSM.isConnected())
{
Debug.print(DBG_ERROR, F("GSM connection not alive... disconnecting"));
DEBUG_ERROR(F("GSM connection not alive... disconnecting"));
return NetworkConnectionState::DISCONNECTED;
}

if(!_check_internet_availability){
return NetworkConnectionState::CONNECTED;
}

Debug.print(DBG_INFO, F("Sending PING to outer space..."));
DEBUG_INFO(F("Sending PING to outer space..."));
int const ping_result = GSM.ping("time.arduino.cc");
Debug.print(DBG_INFO, F("GSM.ping(): %d"), ping_result);
DEBUG_INFO(F("GSM.ping(): %d"), ping_result);
if (ping_result < 0)
{
Debug.print(DBG_ERROR, F("Internet check failed"));
Debug.print(DBG_INFO, F("Retrying in \"%d\" milliseconds"), 2 * CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
DEBUG_ERROR(F("Internet check failed"));
DEBUG_INFO(F("Retrying in \"%d\" milliseconds"), 2 * CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
return NetworkConnectionState::CONNECTING;
}
else
{
Debug.print(DBG_INFO, F("Connected to Internet"));
DEBUG_INFO(F("Connected to Internet"));
return NetworkConnectionState::CONNECTED;
}
}
@@ -122,7 +122,7 @@ NetworkConnectionState CatM1ConnectionHandler::update_handleConnected()
int const is_gsm_access_alive = GSM.isConnected();
if (is_gsm_access_alive != 1)
{
Debug.print(DBG_ERROR, F("GSM connection not alive... disconnecting"));
DEBUG_ERROR(F("GSM connection not alive... disconnecting"));
return NetworkConnectionState::DISCONNECTED;
}
return NetworkConnectionState::CONNECTED;
12 changes: 6 additions & 6 deletions src/CellularConnectionHandler.cpp
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ unsigned long CellularConnectionHandler::getTime()

UDP & CellularConnectionHandler::getUDP()
{
Debug.print(DBG_ERROR, F("CellularConnectionHandler has no UDP support"));
DEBUG_ERROR(F("CellularConnectionHandler has no UDP support"));
while(1) {};
}

@@ -59,15 +59,15 @@ NetworkConnectionState CellularConnectionHandler::update_handleInit()
_cellular.begin();
_cellular.setDebugStream(Serial);
if (strlen(_settings.cell.pin) > 0 && !_cellular.unlockSIM(_settings.cell.pin)) {
Debug.print(DBG_ERROR, F("SIM not present or wrong PIN"));
DEBUG_ERROR(F("SIM not present or wrong PIN"));
return NetworkConnectionState::ERROR;
}

if (!_cellular.connect(String(_settings.cell.apn), String(_settings.cell.login), String(_settings.cell.pass))) {
Debug.print(DBG_ERROR, F("The board was not able to register to the network..."));
DEBUG_ERROR(F("The board was not able to register to the network..."));
return NetworkConnectionState::ERROR;
}
Debug.print(DBG_INFO, F("Connected to Network"));
DEBUG_INFO(F("Connected to Network"));
return NetworkConnectionState::CONNECTING;
}

@@ -82,8 +82,8 @@ NetworkConnectionState CellularConnectionHandler::update_handleConnecting()
}

if(getTime() == 0){
Debug.print(DBG_ERROR, F("Internet check failed"));
Debug.print(DBG_INFO, F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
DEBUG_ERROR(F("Internet check failed"));
DEBUG_INFO(F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
return NetworkConnectionState::CONNECTING;
}

22 changes: 11 additions & 11 deletions src/EthernetConnectionHandler.cpp
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ EthernetConnectionHandler::EthernetConnectionHandler(
NetworkConnectionState EthernetConnectionHandler::update_handleInit()
{
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Debug.print(DBG_ERROR, F("Error, ethernet shield was not found."));
DEBUG_ERROR(F("Error, ethernet shield was not found."));
return NetworkConnectionState::ERROR;
}
IPAddress ip(_settings.eth.ip.type, _settings.eth.ip.bytes);
@@ -83,16 +83,16 @@ NetworkConnectionState EthernetConnectionHandler::update_handleInit()
_settings.eth.timeout,
_settings.eth.response_timeout) == 0) {

Debug.print(DBG_ERROR, F("Failed to configure Ethernet, check cable connection"));
Debug.print(DBG_VERBOSE, "timeout: %d, response timeout: %d",
DEBUG_ERROR(F("Failed to configure Ethernet, check cable connection"));
DEBUG_VERBOSE("timeout: %d, response timeout: %d",
_settings.eth.timeout, _settings.eth.response_timeout);
return NetworkConnectionState::INIT;
}
// An ip address is not provided -> dhcp configuration
} else {
if (Ethernet.begin(nullptr, _settings.eth.timeout, _settings.eth.response_timeout) == 0) {
Debug.print(DBG_ERROR, F("Waiting Ethernet configuration from DHCP server, check cable connection"));
Debug.print(DBG_VERBOSE, "timeout: %d, response timeout: %d",
DEBUG_ERROR(F("Waiting Ethernet configuration from DHCP server, check cable connection"));
DEBUG_VERBOSE("timeout: %d, response timeout: %d",
_settings.eth.timeout, _settings.eth.response_timeout);

return NetworkConnectionState::INIT;
@@ -113,16 +113,16 @@ NetworkConnectionState EthernetConnectionHandler::update_handleConnecting()
}

int ping_result = Ethernet.ping("time.arduino.cc");
Debug.print(DBG_INFO, F("Ethernet.ping(): %d"), ping_result);
DEBUG_INFO(F("Ethernet.ping(): %d"), ping_result);
if (ping_result < 0)
{
Debug.print(DBG_ERROR, F("Internet check failed"));
Debug.print(DBG_INFO, F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
DEBUG_ERROR(F("Internet check failed"));
DEBUG_INFO(F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
return NetworkConnectionState::CONNECTING;
}
else
{
Debug.print(DBG_INFO, F("Connected to Internet"));
DEBUG_INFO(F("Connected to Internet"));
return NetworkConnectionState::CONNECTED;
}

@@ -131,10 +131,10 @@ NetworkConnectionState EthernetConnectionHandler::update_handleConnecting()
NetworkConnectionState EthernetConnectionHandler::update_handleConnected()
{
if (Ethernet.linkStatus() == LinkOFF) {
Debug.print(DBG_ERROR, F("Ethernet link OFF, connection lost."));
DEBUG_ERROR(F("Ethernet link OFF, connection lost."));
if (_keep_alive)
{
Debug.print(DBG_ERROR, F("Attempting reconnection"));
DEBUG_ERROR(F("Attempting reconnection"));
}
return NetworkConnectionState::DISCONNECTED;
}
20 changes: 10 additions & 10 deletions src/GSMConnectionHandler.cpp
Original file line number Diff line number Diff line change
@@ -80,25 +80,25 @@ NetworkConnectionState GSMConnectionHandler::update_handleInit()

if (_gsm.begin(_settings.gsm.pin) != GSM_READY)
{
Debug.print(DBG_ERROR, F("SIM not present or wrong PIN"));
DEBUG_ERROR(F("SIM not present or wrong PIN"));
return NetworkConnectionState::ERROR;
}

mkr_gsm_feed_watchdog();

Debug.print(DBG_INFO, F("SIM card ok"));
DEBUG_INFO(F("SIM card ok"));
_gsm.setTimeout(GSM_TIMEOUT);
_gprs.setTimeout(GPRS_TIMEOUT);

mkr_gsm_feed_watchdog();

GSM3_NetworkStatus_t const network_status = _gprs.attachGPRS(
_settings.gsm.apn, _settings.gsm.login, _settings.gsm.pass, true);
Debug.print(DBG_DEBUG, F("GPRS.attachGPRS(): %d"), network_status);
DEBUG_DEBUG(F("GPRS.attachGPRS(): %d"), network_status);
if (network_status == GSM3_NetworkStatus_t::ERROR)
{
Debug.print(DBG_ERROR, F("GPRS attach failed"));
Debug.print(DBG_ERROR, F("Make sure the antenna is connected and reset your board."));
DEBUG_ERROR(F("GPRS attach failed"));
DEBUG_ERROR(F("Make sure the antenna is connected and reset your board."));
return NetworkConnectionState::ERROR;
}

@@ -111,18 +111,18 @@ NetworkConnectionState GSMConnectionHandler::update_handleConnecting()
return NetworkConnectionState::CONNECTED;
}

Debug.print(DBG_INFO, F("Sending PING to outer space..."));
DEBUG_INFO(F("Sending PING to outer space..."));
int const ping_result = _gprs.ping("time.arduino.cc");
Debug.print(DBG_INFO, F("GPRS.ping(): %d"), ping_result);
DEBUG_INFO(F("GPRS.ping(): %d"), ping_result);
if (ping_result < 0)
{
Debug.print(DBG_ERROR, F("PING failed"));
Debug.print(DBG_INFO, F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
DEBUG_ERROR(F("PING failed"));
DEBUG_INFO(F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
return NetworkConnectionState::CONNECTING;
}
else
{
Debug.print(DBG_INFO, F("Connected to GPRS Network"));
DEBUG_INFO(F("Connected to GPRS Network"));
return NetworkConnectionState::CONNECTED;
}
}
2 changes: 1 addition & 1 deletion src/GenericConnectionHandler.cpp
Original file line number Diff line number Diff line change
@@ -146,7 +146,7 @@ static inline ConnectionHandler* instantiate_handler(NetworkAdapter adapter) {
#endif

default:
Debug.print(DBG_ERROR, "Network adapter not supported by this platform: %d", adapter);
DEBUG_ERROR("Network adapter not supported by this platform: %d", adapter);
return nullptr;
}
}
56 changes: 37 additions & 19 deletions src/LoRaConnectionHandler.cpp
Original file line number Diff line number Diff line change
@@ -69,20 +69,38 @@ int LoRaConnectionHandler::write(const uint8_t * buf, size_t size)
{
switch (err)
{
case LoRaCommunicationError::LORA_ERROR_ACK_NOT_RECEIVED: Debug.print(DBG_ERROR, F("Message ack was not received, the message could not be delivered")); break;
case LoRaCommunicationError::LORA_ERROR_GENERIC: Debug.print(DBG_ERROR, F("LoRa generic error (LORA_ERROR)")); break;
case LoRaCommunicationError::LORA_ERROR_WRONG_PARAM: Debug.print(DBG_ERROR, F("LoRa malformed param error (LORA_ERROR_PARAM")); break;
case LoRaCommunicationError::LORA_ERROR_COMMUNICATION_BUSY: Debug.print(DBG_ERROR, F("LoRa chip is busy (LORA_ERROR_BUSY)")); break;
case LoRaCommunicationError::LORA_ERROR_MESSAGE_OVERFLOW: Debug.print(DBG_ERROR, F("LoRa chip overflow error (LORA_ERROR_OVERFLOW)")); break;
case LoRaCommunicationError::LORA_ERROR_NO_NETWORK_AVAILABLE: Debug.print(DBG_ERROR, F("LoRa no network error (LORA_ERROR_NO_NETWORK)")); break;
case LoRaCommunicationError::LORA_ERROR_RX_PACKET: Debug.print(DBG_ERROR, F("LoRa rx error (LORA_ERROR_RX)")); break;
case LoRaCommunicationError::LORA_ERROR_REASON_UNKNOWN: Debug.print(DBG_ERROR, F("LoRa unknown error (LORA_ERROR_UNKNOWN)")); break;
case LoRaCommunicationError::LORA_ERROR_MAX_PACKET_SIZE: Debug.print(DBG_ERROR, F("Message length is bigger than max LoRa packet!")); break;
case LoRaCommunicationError::LORA_ERROR_ACK_NOT_RECEIVED:
DEBUG_ERROR(F("Message ack was not received, the message could not be delivered"));
break;
case LoRaCommunicationError::LORA_ERROR_GENERIC:
DEBUG_ERROR(F("LoRa generic error (LORA_ERROR)"));
break;
case LoRaCommunicationError::LORA_ERROR_WRONG_PARAM:
DEBUG_ERROR(F("LoRa malformed param error (LORA_ERROR_PARAM"));
break;
case LoRaCommunicationError::LORA_ERROR_COMMUNICATION_BUSY:
DEBUG_ERROR(F("LoRa chip is busy (LORA_ERROR_BUSY)"));
break;
case LoRaCommunicationError::LORA_ERROR_MESSAGE_OVERFLOW:
DEBUG_ERROR(F("LoRa chip overflow error (LORA_ERROR_OVERFLOW)"));
break;
case LoRaCommunicationError::LORA_ERROR_NO_NETWORK_AVAILABLE:
DEBUG_ERROR(F("LoRa no network error (LORA_ERROR_NO_NETWORK)"));
break;
case LoRaCommunicationError::LORA_ERROR_RX_PACKET:
DEBUG_ERROR(F("LoRa rx error (LORA_ERROR_RX)"));
break;
case LoRaCommunicationError::LORA_ERROR_REASON_UNKNOWN:
DEBUG_ERROR(F("LoRa unknown error (LORA_ERROR_UNKNOWN)"));
break;
case LoRaCommunicationError::LORA_ERROR_MAX_PACKET_SIZE:
DEBUG_ERROR(F("Message length is bigger than max LoRa packet!"));
break;
}
}
else
{
Debug.print(DBG_INFO, F("Message sent correctly!"));
DEBUG_INFO(F("Message sent correctly!"));
}
return err;
}
@@ -105,7 +123,7 @@ NetworkConnectionState LoRaConnectionHandler::update_handleInit()
{
if (!_modem.begin((_lora_band)_settings.lora.band))
{
Debug.print(DBG_ERROR, F("Something went wrong; are you indoor? Move near a window, then reset and retry."));
DEBUG_ERROR(F("Something went wrong; are you indoor? Move near a window, then reset and retry."));
return NetworkConnectionState::ERROR;
}
// Set channelmask based on configuration
@@ -116,7 +134,7 @@ NetworkConnectionState LoRaConnectionHandler::update_handleInit()
delay(100);
_modem.configureClass((_lora_class)_settings.lora.deviceClass);
delay(100);
Debug.print(DBG_INFO, F("Connecting to the network"));
DEBUG_INFO(F("Connecting to the network"));
return NetworkConnectionState::CONNECTING;
}

@@ -125,13 +143,13 @@ NetworkConnectionState LoRaConnectionHandler::update_handleConnecting()
bool const network_status = _modem.joinOTAA(_settings.lora.appeui, _settings.lora.appkey);
if (network_status != true)
{
Debug.print(DBG_ERROR, F("Connection to the network failed"));
Debug.print(DBG_INFO, F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
DEBUG_ERROR(F("Connection to the network failed"));
DEBUG_INFO(F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
return NetworkConnectionState::INIT;
}
else
{
Debug.print(DBG_INFO, F("Connected to the network"));
DEBUG_INFO(F("Connected to the network"));
return NetworkConnectionState::CONNECTED;
}
}
@@ -141,10 +159,10 @@ NetworkConnectionState LoRaConnectionHandler::update_handleConnected()
bool const network_status = _modem.connected();
if (network_status != true)
{
Debug.print(DBG_ERROR, F("Connection to the network lost."));
DEBUG_ERROR(F("Connection to the network lost."));
if (_keep_alive)
{
Debug.print(DBG_ERROR, F("Attempting reconnection"));
DEBUG_ERROR(F("Attempting reconnection"));
}
return NetworkConnectionState::DISCONNECTED;
}
@@ -153,10 +171,10 @@ NetworkConnectionState LoRaConnectionHandler::update_handleConnected()

NetworkConnectionState LoRaConnectionHandler::update_handleDisconnecting()
{
Debug.print(DBG_ERROR, F("Connection to the network lost."));
DEBUG_ERROR(F("Connection to the network lost."));
if (_keep_alive)
{
Debug.print(DBG_ERROR, F("Attempting reconnection"));
DEBUG_ERROR(F("Attempting reconnection"));
}
return NetworkConnectionState::DISCONNECTED;
}
18 changes: 9 additions & 9 deletions src/NBConnectionHandler.cpp
Original file line number Diff line number Diff line change
@@ -93,52 +93,52 @@ NetworkConnectionState NBConnectionHandler::update_handleInit()
_settings.nb.login,
_settings.nb.pass) == NB_READY)
{
Debug.print(DBG_INFO, F("SIM card ok"));
DEBUG_INFO(F("SIM card ok"));
_nb.setTimeout(NB_TIMEOUT);
return NetworkConnectionState::CONNECTING;
}
else
{
Debug.print(DBG_ERROR, F("SIM not present or wrong PIN"));
DEBUG_ERROR(F("SIM not present or wrong PIN"));
return NetworkConnectionState::ERROR;
}
}

NetworkConnectionState NBConnectionHandler::update_handleConnecting()
{
NB_NetworkStatus_t const network_status = _nb_gprs.attachGPRS(true);
Debug.print(DBG_DEBUG, F("GPRS.attachGPRS(): %d"), network_status);
DEBUG_DEBUG(F("GPRS.attachGPRS(): %d"), network_status);
if (network_status == NB_NetworkStatus_t::NB_ERROR)
{
Debug.print(DBG_ERROR, F("GPRS.attachGPRS() failed"));
DEBUG_ERROR(F("GPRS.attachGPRS() failed"));
return NetworkConnectionState::ERROR;
}
else
{
Debug.print(DBG_INFO, F("Connected to GPRS Network"));
DEBUG_INFO(F("Connected to GPRS Network"));
return NetworkConnectionState::CONNECTED;
}
}

NetworkConnectionState NBConnectionHandler::update_handleConnected()
{
int const nb_is_access_alive = _nb.isAccessAlive();
Debug.print(DBG_VERBOSE, F("GPRS.isAccessAlive(): %d"), nb_is_access_alive);
DEBUG_VERBOSE(F("GPRS.isAccessAlive(): %d"), nb_is_access_alive);
if (nb_is_access_alive != 1)
{
Debug.print(DBG_INFO, F("Disconnected from cellular network"));
DEBUG_INFO(F("Disconnected from cellular network"));
return NetworkConnectionState::DISCONNECTED;
}
else
{
Debug.print(DBG_VERBOSE, F("Connected to Cellular Network"));
DEBUG_VERBOSE(F("Connected to Cellular Network"));
return NetworkConnectionState::CONNECTED;
}
}

NetworkConnectionState NBConnectionHandler::update_handleDisconnecting()
{
Debug.print(DBG_VERBOSE, F("Disconnecting from Cellular Network"));
DEBUG_VERBOSE(F("Disconnecting from Cellular Network"));
_nb.shutdown();
return NetworkConnectionState::DISCONNECTED;
}
120 changes: 60 additions & 60 deletions src/NotecardConnectionHandler.cpp

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions src/WiFiConnectionHandler.cpp
Original file line number Diff line number Diff line change
@@ -67,28 +67,28 @@ unsigned long WiFiConnectionHandler::getTime()
NetworkConnectionState WiFiConnectionHandler::update_handleInit()
{
#if !defined(__AVR__)
Debug.print(DBG_INFO, F("WiFi.status(): %d"), WiFi.status());
DEBUG_INFO(F("WiFi.status(): %d"), WiFi.status());
#endif

#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32)
if (WiFi.status() == NETWORK_HARDWARE_ERROR)
{
#if !defined(__AVR__)
Debug.print(DBG_ERROR, F("WiFi Hardware failure.\nMake sure you are using a WiFi enabled board/shield."));
Debug.print(DBG_ERROR, F("Then reset and retry."));
DEBUG_ERROR(F("WiFi Hardware failure.\nMake sure you are using a WiFi enabled board/shield."));
DEBUG_ERROR(F("Then reset and retry."));
#endif
return NetworkConnectionState::ERROR;
}
#if !defined(__AVR__)
Debug.print(DBG_INFO, F("Current WiFi Firmware: %s"), WiFi.firmwareVersion());
DEBUG_INFO(F("Current WiFi Firmware: %s"), WiFi.firmwareVersion());
#endif

#if defined(WIFI_FIRMWARE_VERSION_REQUIRED)
if (String(WiFi.firmwareVersion()) < String(WIFI_FIRMWARE_VERSION_REQUIRED))
{
#if !defined(__AVR__)
Debug.print(DBG_ERROR, F("Latest WiFi Firmware: %s"), WIFI_FIRMWARE_VERSION_REQUIRED);
Debug.print(DBG_ERROR, F("Please update to the latest version for best performance."));
DEBUG_ERROR(F("Latest WiFi Firmware: %s"), WIFI_FIRMWARE_VERSION_REQUIRED);
DEBUG_ERROR(F("Please update to the latest version for best performance."));
#endif
delay(5000);
}
@@ -113,15 +113,15 @@ NetworkConnectionState WiFiConnectionHandler::update_handleInit()
if (WiFi.status() != NETWORK_CONNECTED)
{
#if !defined(__AVR__)
Debug.print(DBG_ERROR, F("Connection to \"%s\" failed"), _settings.wifi.ssid);
Debug.print(DBG_INFO, F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::INIT)]);
DEBUG_ERROR(F("Connection to \"%s\" failed"), _settings.wifi.ssid);
DEBUG_INFO(F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::INIT)]);
#endif
return NetworkConnectionState::INIT;
}
else
{
#if !defined(__AVR__)
Debug.print(DBG_INFO, F("Connected to \"%s\""), _settings.wifi.ssid);
DEBUG_INFO(F("Connected to \"%s\""), _settings.wifi.ssid);
#endif
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
configTime(0, 0, "time.arduino.cc", "pool.ntp.org", "time.nist.gov");
@@ -142,15 +142,15 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnecting()

#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP32)
int ping_result = WiFi.ping("time.arduino.cc");
Debug.print(DBG_INFO, F("WiFi.ping(): %d"), ping_result);
DEBUG_INFO(F("WiFi.ping(): %d"), ping_result);
if (ping_result < 0)
{
Debug.print(DBG_ERROR, F("Internet check failed"));
Debug.print(DBG_INFO, F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
DEBUG_ERROR(F("Internet check failed"));
DEBUG_INFO(F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
return NetworkConnectionState::CONNECTING;
}
#endif
Debug.print(DBG_INFO, F("Connected to Internet"));
DEBUG_INFO(F("Connected to Internet"));
return NetworkConnectionState::CONNECTED;

}
@@ -160,13 +160,13 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnected()
if (WiFi.status() != WL_CONNECTED)
{
#if !defined(__AVR__)
Debug.print(DBG_VERBOSE, F("WiFi.status(): %d"), WiFi.status());
Debug.print(DBG_ERROR, F("Connection to \"%s\" lost."), _settings.wifi.ssid);
DEBUG_VERBOSE(F("WiFi.status(): %d"), WiFi.status());
DEBUG_ERROR(F("Connection to \"%s\" lost."), _settings.wifi.ssid);
#endif
if (_keep_alive)
{
#if !defined(__AVR__)
Debug.print(DBG_INFO, F("Attempting reconnection"));
DEBUG_INFO(F("Attempting reconnection"));
#endif
}