diff --git a/examples/AP_SimpleWebServer/AP_SimpleWebServer.ino b/examples/AP_SimpleWebServer/AP_SimpleWebServer.ino index 4983f5c1..b8a1b085 100644 --- a/examples/AP_SimpleWebServer/AP_SimpleWebServer.ino +++ b/examples/AP_SimpleWebServer/AP_SimpleWebServer.ino @@ -50,7 +50,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -66,19 +71,24 @@ WiFiServer server(80); void setup() { + pinMode(led, OUTPUT); // set the LED pin mode + //Initialize serial and wait for port to open: Serial.begin(115200); while (!Serial && millis() < 5000); Serial.print(F("\nStart AP_SimpleWebServer on ")); - Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - - pinMode(led, OUTPUT); // set the LED pin mode + Serial.println(BOARD_NAME); // check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/AP_SimpleWebServer/defines.h b/examples/AP_SimpleWebServer/defines.h index 61befa0e..1ae47050 100644 --- a/examples/AP_SimpleWebServer/defines.h +++ b/examples/AP_SimpleWebServer/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) diff --git a/examples/ConnectNoEncryption/ConnectNoEncryption.ino b/examples/ConnectNoEncryption/ConnectNoEncryption.ino index 7f5da09f..3c91fe02 100644 --- a/examples/ConnectNoEncryption/ConnectNoEncryption.ino +++ b/examples/ConnectNoEncryption/ConnectNoEncryption.ino @@ -43,7 +43,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif char ssid[] = SECRET_SSID; // your network SSID (name) @@ -58,10 +63,15 @@ void setup() Serial.print(F("\nStart ConnectNoEncryption on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - + // check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/ConnectNoEncryption/defines.h b/examples/ConnectNoEncryption/defines.h index 61befa0e..1ae47050 100644 --- a/examples/ConnectNoEncryption/defines.h +++ b/examples/ConnectNoEncryption/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) diff --git a/examples/ConnectWithWEP/ConnectWithWEP.ino b/examples/ConnectWithWEP/ConnectWithWEP.ino index 602da9fd..d2fe0763 100644 --- a/examples/ConnectWithWEP/ConnectWithWEP.ino +++ b/examples/ConnectWithWEP/ConnectWithWEP.ino @@ -52,7 +52,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -71,10 +76,15 @@ void setup() Serial.print(F("\nStart ConnectWithWEP on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); // check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/ConnectWithWEP/defines.h b/examples/ConnectWithWEP/defines.h index 61befa0e..1ae47050 100644 --- a/examples/ConnectWithWEP/defines.h +++ b/examples/ConnectWithWEP/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) diff --git a/examples/ConnectWithWPA/ConnectWithWPA.ino b/examples/ConnectWithWPA/ConnectWithWPA.ino index 55146875..d34346a0 100644 --- a/examples/ConnectWithWPA/ConnectWithWPA.ino +++ b/examples/ConnectWithWPA/ConnectWithWPA.ino @@ -41,7 +41,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -58,10 +63,15 @@ void setup() Serial.print(F("\nStart ConnectWithWPA on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - + // check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/ConnectWithWPA/defines.h b/examples/ConnectWithWPA/defines.h index 61befa0e..1ae47050 100644 --- a/examples/ConnectWithWPA/defines.h +++ b/examples/ConnectWithWPA/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) diff --git a/examples/ConnectWithWPA2Enterprise/ConnectWithWPA2Enterprise.ino b/examples/ConnectWithWPA2Enterprise/ConnectWithWPA2Enterprise.ino index cc4c2343..d71f4971 100644 --- a/examples/ConnectWithWPA2Enterprise/ConnectWithWPA2Enterprise.ino +++ b/examples/ConnectWithWPA2Enterprise/ConnectWithWPA2Enterprise.ino @@ -57,8 +57,7 @@ void setup() Serial.print(F("\nStart ConnectWithWPA2Enterprise on ")); Serial.println(BOARD_NAME); Serial.println(WIFININA_GENERIC_VERSION); - - // check for the WiFi module: + if (WiFi.status() == WL_NO_MODULE) { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/MultiServers/MultiServers.ino b/examples/MultiServers/MultiServers.ino index 92f4df05..26ae6e0d 100644 --- a/examples/MultiServers/MultiServers.ino +++ b/examples/MultiServers/MultiServers.ino @@ -34,7 +34,14 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include "defines.h" -#include + +#include + +#if USING_WIFI101 + #include +#else + #include +#endif // https://github.com/ocrdu/NINA-Websocket #include @@ -119,10 +126,14 @@ void setup() Serial.print(F("\nStart MultiServers on ")); Serial.println(BOARD_TYPE); +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else Serial.println(WIFININA_GENERIC_VERSION); - - // check for the WiFi module: + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/MultiServers/defines.h b/examples/MultiServers/defines.h index 61befa0e..1ae47050 100644 --- a/examples/MultiServers/defines.h +++ b/examples/MultiServers/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) diff --git a/examples/RGB_LED_Test/RGB_LED_Test.ino b/examples/RGB_LED_Test/RGB_LED_Test.ino index 8739975d..1a0f1443 100644 --- a/examples/RGB_LED_Test/RGB_LED_Test.ino +++ b/examples/RGB_LED_Test/RGB_LED_Test.ino @@ -30,7 +30,6 @@ #error Only for ARDUINO_NANO_RP2040_CONNECT using arduino-pico core #endif -//#include #include void setup() diff --git a/examples/ScanNetworks/ScanNetworks.ino b/examples/ScanNetworks/ScanNetworks.ino index 372622ab..2b83764f 100644 --- a/examples/ScanNetworks/ScanNetworks.ino +++ b/examples/ScanNetworks/ScanNetworks.ino @@ -46,7 +46,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif void setup() { @@ -57,10 +62,15 @@ void setup() Serial.print(F("\nStart ScanNetworks on ")); Serial.println(BOARD_NAME); + +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else Serial.println(WIFININA_GENERIC_VERSION); - - // check for the WiFi module: + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); @@ -149,7 +159,9 @@ void printEncryptionType(int thisType) Serial.print(F("Auto")); break; - case ENC_TYPE_UNKNOWN: +#if !USING_WIFI101 + case ENC_TYPE_UNKNOWN: +#endif default: Serial.print(F("Unknown")); break; diff --git a/examples/ScanNetworksAdvanced/ScanNetworksAdvanced.ino b/examples/ScanNetworksAdvanced/ScanNetworksAdvanced.ino index f5dbb789..836c2c6c 100644 --- a/examples/ScanNetworksAdvanced/ScanNetworksAdvanced.ino +++ b/examples/ScanNetworksAdvanced/ScanNetworksAdvanced.ino @@ -47,7 +47,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif void setup() { @@ -58,10 +63,15 @@ void setup() Serial.print(F("\nStart ScanNetworksAdvanced on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - // check for the WiFi module: +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); @@ -163,7 +173,9 @@ void printEncryptionType(int thisType) Serial.print(F("Auto")); break; - case ENC_TYPE_UNKNOWN: +#if !USING_WIFI101 + case ENC_TYPE_UNKNOWN: +#endif default: Serial.print(F("Unknown")); break; diff --git a/examples/ScanNetworksAdvanced/defines.h b/examples/ScanNetworksAdvanced/defines.h index 61befa0e..1ae47050 100644 --- a/examples/ScanNetworksAdvanced/defines.h +++ b/examples/ScanNetworksAdvanced/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) diff --git a/examples/SimpleWebServerWiFi/SimpleWebServerWiFi.ino b/examples/SimpleWebServerWiFi/SimpleWebServerWiFi.ino index 7c6af114..82f56657 100644 --- a/examples/SimpleWebServerWiFi/SimpleWebServerWiFi.ino +++ b/examples/SimpleWebServerWiFi/SimpleWebServerWiFi.ino @@ -54,7 +54,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -75,10 +80,15 @@ void setup() Serial.print(F("\nStart SimpleWebServerWiFi on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - // check for the WiFi module: +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/SimpleWebServerWiFi/defines.h b/examples/SimpleWebServerWiFi/defines.h index 61befa0e..1ae47050 100644 --- a/examples/SimpleWebServerWiFi/defines.h +++ b/examples/SimpleWebServerWiFi/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) diff --git a/examples/WiFiAdvancedChatServer/WiFiAdvancedChatServer.ino b/examples/WiFiAdvancedChatServer/WiFiAdvancedChatServer.ino index a8d11a02..7e64e277 100644 --- a/examples/WiFiAdvancedChatServer/WiFiAdvancedChatServer.ino +++ b/examples/WiFiAdvancedChatServer/WiFiAdvancedChatServer.ino @@ -38,6 +38,10 @@ #include "defines.h" #include "arduino_secrets.h" +// To eliminate FW warning when using not latest nina-fw version +// To use whenever WiFi101-FirmwareUpdater-Plugin is not sync'ed with nina-fw version +#define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" + #include #include @@ -66,8 +70,7 @@ void setup() Serial.print(F("\nStart WiFiAdvancedChatServer on ")); Serial.println(BOARD_NAME); Serial.println(WIFININA_GENERIC_VERSION); - - // check for the WiFi module: + if (WiFi.status() == WL_NO_MODULE) { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiChatServer/WiFiChatServer.ino b/examples/WiFiChatServer/WiFiChatServer.ino index 9815dce0..f372458a 100644 --- a/examples/WiFiChatServer/WiFiChatServer.ino +++ b/examples/WiFiChatServer/WiFiChatServer.ino @@ -47,7 +47,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -73,10 +78,15 @@ void setup() Serial.print(F("\nStart WiFiChatServer on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - // check for the WiFi module: +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiChatServer/defines.h b/examples/WiFiChatServer/defines.h index 61befa0e..1ae47050 100644 --- a/examples/WiFiChatServer/defines.h +++ b/examples/WiFiChatServer/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) diff --git a/examples/WiFiMulti/WiFiWebClient_WiFiMulti/defines.h b/examples/WiFiMulti/WiFiWebClient_WiFiMulti/defines.h index 1f0f4a1d..1793b661 100644 --- a/examples/WiFiMulti/WiFiWebClient_WiFiMulti/defines.h +++ b/examples/WiFiMulti/WiFiWebClient_WiFiMulti/defines.h @@ -327,7 +327,6 @@ #endif #endif - #if ( defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) || \ defined(__AVR_ATmega640__) || defined(__AVR_ATmega641__)) #define BOARD_TYPE "Arduino AVR Mega2560/ADK" diff --git a/examples/WiFiNINA_SSL_Test/WiFiNINA_SSL_Test.ino b/examples/WiFiNINA_SSL_Test/WiFiNINA_SSL_Test.ino index 4301bf16..97758a62 100644 --- a/examples/WiFiNINA_SSL_Test/WiFiNINA_SSL_Test.ino +++ b/examples/WiFiNINA_SSL_Test/WiFiNINA_SSL_Test.ino @@ -42,7 +42,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -67,10 +72,15 @@ void setup() Serial.print(F("\nStart WiFiNINA_SSL_Test on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - // check for the WiFi module: +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiNINA_SSL_Test/defines.h b/examples/WiFiNINA_SSL_Test/defines.h index 61befa0e..92e3be84 100644 --- a/examples/WiFiNINA_SSL_Test/defines.h +++ b/examples/WiFiNINA_SSL_Test/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) @@ -394,7 +396,9 @@ #endif #define DEBUG_WIFININA_PORT Serial + // Debug Level from 0 to 4 #define _WIFININA_LOGLEVEL_ 1 +#define _WIFIMULTI_LOGLEVEL_ 2 #endif //defines_h diff --git a/examples/WiFiPing/WiFiPing.ino b/examples/WiFiPing/WiFiPing.ino index 2ca7044f..2de6bf65 100644 --- a/examples/WiFiPing/WiFiPing.ino +++ b/examples/WiFiPing/WiFiPing.ino @@ -46,7 +46,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -69,10 +74,15 @@ void setup() Serial.print(F("\nStart WiFiPing on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - // check for the WiFi module: +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiPing/defines.h b/examples/WiFiPing/defines.h index 61befa0e..92e3be84 100644 --- a/examples/WiFiPing/defines.h +++ b/examples/WiFiPing/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) @@ -394,7 +396,9 @@ #endif #define DEBUG_WIFININA_PORT Serial + // Debug Level from 0 to 4 #define _WIFININA_LOGLEVEL_ 1 +#define _WIFIMULTI_LOGLEVEL_ 2 #endif //defines_h diff --git a/examples/WiFiSSLClient/WiFiSSLClient.ino b/examples/WiFiSSLClient/WiFiSSLClient.ino index c8ad891c..84a0d8e5 100644 --- a/examples/WiFiSSLClient/WiFiSSLClient.ino +++ b/examples/WiFiSSLClient/WiFiSSLClient.ino @@ -42,7 +42,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -71,10 +76,15 @@ void setup() Serial.print(F("\nStart WiFiSSLClient on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - // check for the WiFi module: +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiSSLClient/defines.h b/examples/WiFiSSLClient/defines.h index 61befa0e..92e3be84 100644 --- a/examples/WiFiSSLClient/defines.h +++ b/examples/WiFiSSLClient/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) @@ -394,7 +396,9 @@ #endif #define DEBUG_WIFININA_PORT Serial + // Debug Level from 0 to 4 #define _WIFININA_LOGLEVEL_ 1 +#define _WIFIMULTI_LOGLEVEL_ 2 #endif //defines_h diff --git a/examples/WiFiStorage/WiFiStorage.ino b/examples/WiFiStorage/WiFiStorage.ino index d7cb971b..c936e859 100644 --- a/examples/WiFiStorage/WiFiStorage.ino +++ b/examples/WiFiStorage/WiFiStorage.ino @@ -49,8 +49,7 @@ void setup() Serial.print(F("\nStart WiFiStorage on ")); Serial.println(BOARD_NAME); Serial.println(WIFININA_GENERIC_VERSION); - - // check for the WiFi module: + if (WiFi.status() == WL_NO_MODULE) { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiUdpNtpClient/WiFiUdpNtpClient.ino b/examples/WiFiUdpNtpClient/WiFiUdpNtpClient.ino index 8b931cd7..5df8660e 100644 --- a/examples/WiFiUdpNtpClient/WiFiUdpNtpClient.ino +++ b/examples/WiFiUdpNtpClient/WiFiUdpNtpClient.ino @@ -47,8 +47,14 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include -#include + +#if USING_WIFI101 + #include + #include +#else + #include + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -78,10 +84,15 @@ void setup() Serial.print(F("\nStart WiFiUdpNtpClient on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - // check for the WiFi module: +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiUdpNtpClient/defines.h b/examples/WiFiUdpNtpClient/defines.h index 61befa0e..92e3be84 100644 --- a/examples/WiFiUdpNtpClient/defines.h +++ b/examples/WiFiUdpNtpClient/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) @@ -394,7 +396,9 @@ #endif #define DEBUG_WIFININA_PORT Serial + // Debug Level from 0 to 4 #define _WIFININA_LOGLEVEL_ 1 +#define _WIFIMULTI_LOGLEVEL_ 2 #endif //defines_h diff --git a/examples/WiFiUdpSendReceiveString/WiFiUdpSendReceiveString.ino b/examples/WiFiUdpSendReceiveString/WiFiUdpSendReceiveString.ino index c320c059..6e230a61 100644 --- a/examples/WiFiUdpSendReceiveString/WiFiUdpSendReceiveString.ino +++ b/examples/WiFiUdpSendReceiveString/WiFiUdpSendReceiveString.ino @@ -40,9 +40,13 @@ // To use whenever WiFi101-FirmwareUpdater-Plugin is not sync'ed with nina-fw version #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" -#include -#include -#include +#if USING_WIFI101 + #include + #include +#else + #include + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -68,10 +72,15 @@ void setup() Serial.print(F("\nStart WiFiUdpSendReceiveString on ")); Serial.println(BOARD_NAME); + +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else Serial.println(WIFININA_GENERIC_VERSION); - - // check for the WiFi module: + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiUdpSendReceiveString/defines.h b/examples/WiFiUdpSendReceiveString/defines.h index 61befa0e..92e3be84 100644 --- a/examples/WiFiUdpSendReceiveString/defines.h +++ b/examples/WiFiUdpSendReceiveString/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) @@ -394,7 +396,9 @@ #endif #define DEBUG_WIFININA_PORT Serial + // Debug Level from 0 to 4 #define _WIFININA_LOGLEVEL_ 1 +#define _WIFIMULTI_LOGLEVEL_ 2 #endif //defines_h diff --git a/examples/WiFiWebClient/WiFiWebClient.ino b/examples/WiFiWebClient/WiFiWebClient.ino index 8a0d91be..a842e66a 100644 --- a/examples/WiFiWebClient/WiFiWebClient.ino +++ b/examples/WiFiWebClient/WiFiWebClient.ino @@ -50,7 +50,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -79,10 +84,15 @@ void setup() Serial.print(F("\nStart WiFiWebClient on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - // check for the WiFi module: +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiWebClient/defines.h b/examples/WiFiWebClient/defines.h index 21444112..92e3be84 100644 --- a/examples/WiFiWebClient/defines.h +++ b/examples/WiFiWebClient/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) @@ -327,7 +329,6 @@ #endif #endif - #if ( defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) || \ defined(__AVR_ATmega640__) || defined(__AVR_ATmega641__)) #define BOARD_TYPE "Arduino AVR Mega2560/ADK" @@ -395,7 +396,9 @@ #endif #define DEBUG_WIFININA_PORT Serial + // Debug Level from 0 to 4 #define _WIFININA_LOGLEVEL_ 1 +#define _WIFIMULTI_LOGLEVEL_ 2 #endif //defines_h diff --git a/examples/WiFiWebClientRepeating/WiFiWebClientRepeating.ino b/examples/WiFiWebClientRepeating/WiFiWebClientRepeating.ino index 108b4fb7..10893bfb 100644 --- a/examples/WiFiWebClientRepeating/WiFiWebClientRepeating.ino +++ b/examples/WiFiWebClientRepeating/WiFiWebClientRepeating.ino @@ -45,7 +45,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -73,10 +78,15 @@ void setup() Serial.print(F("\nStart WiFiWebClientRepeating on ")); Serial.println(BOARD_NAME); - Serial.println(WIFININA_GENERIC_VERSION); - // check for the WiFi module: +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiWebClientRepeating/defines.h b/examples/WiFiWebClientRepeating/defines.h index 61befa0e..92e3be84 100644 --- a/examples/WiFiWebClientRepeating/defines.h +++ b/examples/WiFiWebClientRepeating/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) @@ -394,7 +396,9 @@ #endif #define DEBUG_WIFININA_PORT Serial + // Debug Level from 0 to 4 #define _WIFININA_LOGLEVEL_ 1 +#define _WIFIMULTI_LOGLEVEL_ 2 #endif //defines_h diff --git a/examples/WiFiWebServer/WiFiWebServer.ino b/examples/WiFiWebServer/WiFiWebServer.ino index 5b3b8c01..e33919ed 100644 --- a/examples/WiFiWebServer/WiFiWebServer.ino +++ b/examples/WiFiWebServer/WiFiWebServer.ino @@ -46,7 +46,12 @@ #define WIFI_FIRMWARE_LATEST_VERSION "1.4.8" #include -#include + +#if USING_WIFI101 + #include +#else + #include +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_SSID; // your network SSID (name) @@ -67,10 +72,15 @@ void setup() Serial.print(F("\nStart WiFiWebServer on ")); Serial.println(BOARD_NAME); - //Serial.println(WIFININA_GENERIC_VERSION); - // check for the WiFi module: +// check for the WiFi module: +#if USING_WIFI101 + if (WiFi.status() == WL_NO_SHIELD) +#else + Serial.println(WIFININA_GENERIC_VERSION); + if (WiFi.status() == WL_NO_MODULE) +#endif { Serial.println(F("Communication with WiFi module failed!")); diff --git a/examples/WiFiWebServer/defines.h b/examples/WiFiWebServer/defines.h index 61befa0e..92e3be84 100644 --- a/examples/WiFiWebServer/defines.h +++ b/examples/WiFiWebServer/defines.h @@ -49,8 +49,10 @@ #define BOARD_TYPE "SAMD Zero" #elif defined(ARDUINO_SAMD_MKR1000) #define BOARD_TYPE "SAMD MKR1000" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_MKRWIFI1010) #define BOARD_TYPE "SAMD MKRWIFI1010" + #define USING_WIFI101 true #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_TYPE "SAMD NANO_33_IOT" #elif defined(ARDUINO_SAMD_MKRFox1200) @@ -394,7 +396,9 @@ #endif #define DEBUG_WIFININA_PORT Serial + // Debug Level from 0 to 4 #define _WIFININA_LOGLEVEL_ 1 +#define _WIFIMULTI_LOGLEVEL_ 2 #endif //defines_h diff --git a/examples/WiFiWebServer_BigData/WiFiWebServer_BigData.ino b/examples/WiFiWebServer_BigData/WiFiWebServer_BigData.ino index f9daac10..fb4a9240 100644 --- a/examples/WiFiWebServer_BigData/WiFiWebServer_BigData.ino +++ b/examples/WiFiWebServer_BigData/WiFiWebServer_BigData.ino @@ -47,6 +47,7 @@ #include #include + #include ///////please enter your sensitive data in the Secret tab/arduino_secrets.h diff --git a/examples/WiFiWebServer_BigData/defines.h b/examples/WiFiWebServer_BigData/defines.h index 61befa0e..1793b661 100644 --- a/examples/WiFiWebServer_BigData/defines.h +++ b/examples/WiFiWebServer_BigData/defines.h @@ -394,7 +394,9 @@ #endif #define DEBUG_WIFININA_PORT Serial + // Debug Level from 0 to 4 #define _WIFININA_LOGLEVEL_ 1 +#define _WIFIMULTI_LOGLEVEL_ 2 #endif //defines_h