Open skichrome opened 3 years ago
Regarding the Wifi configuration I did the same. And now it works well.
Note: I'm using the ESP32 Dev board and I must modify the following block code:
#include <ArduinoMqttClient.h>
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_AVR_UNO_WIFI_REV2)
#include <WiFiNINA.h>
#elif defined(ARDUINO_SAMD_MKR1000)
#include <WiFi101.h>
#elif defined(ARDUINO_ESP8266_ESP12)
#include <ESP8266WiFi.h>
#endif
By following:
#include <ArduinoMqttClient.h>
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_AVR_UNO_WIFI_REV2)
#include <WiFiNINA.h>
#elif defined(ARDUINO_SAMD_MKR1000)
#include <WiFi101.h>
#elif defined(ARDUINO_ESP8266_ESP12)
#include <ESP8266WiFi.h>
#elif defined (ESP32)
#include <WiFi.h>
#endif
I am testing the library on an ESP8266 based board and samples don't work without codes modifications.
First, I must replace this code bloc with just
#include <ESP8266WiFi.h>
because otherwise I have a compile error on line where theWiFiClient client
is declared.Second, the code is locked in setup, in while loop that check the wifi status and forbid sketch start without wifi connexion.
To get the example working I replaced this :
with this:
Infos: