Skip to content

Disable Arduino_DebugUtils for Arduino Uno WiFi Rev 2 #44

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

Merged
merged 2 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion src/Arduino_ConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@
INCLUDES
******************************************************************************/

#include <Arduino_DebugUtils.h>
#if !defined(__AVR__)
# include <Arduino_DebugUtils.h>
#endif

/******************************************************************************
TYPEDEFS
Expand Down
18 changes: 16 additions & 2 deletions src/Arduino_WiFiConnectionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,28 @@ unsigned long WiFiConnectionHandler::getTime()
NetworkConnectionState WiFiConnectionHandler::update_handleInit()
{
#ifndef BOARD_ESP8266
#if !defined(__AVR__)
Debug.print(DBG_INFO, F("WiFi.status(): %d"), WiFi.status());
#endif
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."));
#endif
return NetworkConnectionState::ERROR;
}

#if !defined(__AVR__)
Debug.print(DBG_ERROR, F("Current WiFi Firmware: %s"), WiFi.firmwareVersion());
#endif

#if defined(WIFI_FIRMWARE_VERSION_REQUIRED)
if (WiFi.firmwareVersion() < 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."));
#endif
delay(5000);
}
#endif
Expand All @@ -96,13 +103,17 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnecting()

if (WiFi.status() != NETWORK_CONNECTED)
{
#if !defined(__AVR__)
Debug.print(DBG_ERROR, F("Connection to \"%s\" failed"), _ssid);
Debug.print(DBG_INFO, F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
#endif
return NetworkConnectionState::CONNECTING;
}
else
{
#if !defined(__AVR__)
Debug.print(DBG_INFO, F("Connected to \"%s\""), _ssid);
#endif
#ifdef BOARD_ESP8266
configTime(0, 0, "time.arduino.cc", "pool.ntp.org", "time.nist.gov");
#endif
Expand All @@ -114,12 +125,15 @@ 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."), _ssid);
#endif
if (_keep_alive)
{
#if !defined(__AVR__)
Debug.print(DBG_ERROR, F("Attempting reconnection"));
#endif
}

return NetworkConnectionState::DISCONNECTED;
Expand Down