diff --git a/README.md b/README.md index 19e04c8..0bedbcc 100644 --- a/README.md +++ b/README.md @@ -15,15 +15,15 @@ The code will manage the LTE-M, GSM and WiFi connection (depending on currently | Arduino MKR 1010 WiFi | OK | OK | - | | Arduino MKR 1400 GSM | OK | OK | OK | | Arduino MKR 1500 NB | OK | OK | OK | -| Arduino MKR VIDOR 4000 | OK | OK* | - | +| Arduino MKR VIDOR 4000 | OK | OK | - | | Arduino Nano 33 IoT | OK | OK | - | -| ESP8266 Boards | OK | OK** | - | +| ESP8266 Boards | OK | OPT1) | - | | ESP32 Boards | OK | OK | - | -| Adafruit Feather M0 WiFi| OK | OK | - | +| Adafruit Feather M0 WiFi| OK | - | - | | Adafruit Feather 32u4 | OK | - | OK | ## Prerequisites/dependecies ## -This code needs 2 ~~3~~ external libraries to run, that you can install using the built-in [Library Manager](https://www.arduino.cc/en/guide/libraries) of the Arduino IDE. +This code needs external libraries to run, that you can install using the built-in [Library Manager](https://www.arduino.cc/en/guide/libraries) of the Arduino IDE. #### Libraries provided by Arduino - [MKRNB](https://www.arduino.cc/en/Reference/MKRNB) in order to handle the LTE-M module on **Arduino MKR NB 1500** @@ -31,15 +31,14 @@ This code needs 2 ~~3~~ external libraries to run, that you can install using th - [WiFiNINA](https://www.arduino.cc/en/Reference/WiFiNINA) in order to handle WiFi module on **Arduino MKRWIFI 1010** and **Arduino Nano 33 IoT** - [WiFi101](https://www.arduino.cc/en/Reference/WiFi101) in order to handle WiFi module on **Arduino MKR 1000** -- ~~[ArduinoMqttClient](https://github.com/arduino-libraries/ArduinoMqttClient) that implements a MQTT client for Arduino~~ * +- ~~[ArduinoMqttClient](https://github.com/arduino-libraries/ArduinoMqttClient) that implements a MQTT client for Arduino~~ * - \* currently integrated into this SDK, until https://github.com/arduino-libraries/ArduinoMqttClient/pull/44 fix will be merged + * currently integrated into this SDK, until https://github.com/arduino-libraries/ArduinoMqttClient/pull/44 fix will be merged #### Library for ESP8266 and ESP32 boards - [PubSubClient](https://pubsubclient.knolleary.net/) library provides a client for doing simple publish/subscribe messaging with a server that supports MQTT -#### Library developed by Benoît Blanchon* -*mandatory for both Arduino, ESP and Adafruit boards +#### Library developed by Benoît Blanchon (mandatory for both Arduino, ESP and Adafruit boards) - [ArduinoJson](https://arduinojson.org/), a powerful library used to parse, store and handle JSON easily #### SAMD21 Arduino core @@ -53,20 +52,21 @@ This code needs 2 ~~3~~ external libraries to run, that you can install using th 4. In the **'src/arduino_secrets.h'** file : - Paste it as initialization value for the `SECRET_LIVEOBJECTS_API_KEY` variable in the 'arduino_secrets.h' file -keep the double quotes! - In case of feather 32u4 you have to change type of this variable to char* from String + - In case of feather 32u4 you have to change type of this variable to *char** from *String*. - Fill in the connection(WIFI or GSM) credentials if needed (pin code, APN information, etc). In case of GSM connection, most of the time, APN will set up automatically. Your SIM card may have a default pin code (like "0000"), unless you deactivated it using the [Pin management](https://github.com/arduino-libraries/MKRNB/blob/master/examples/Tools/PinManagement/PinManagement.ino) sketch, provided with the MKRNB library. - In case of feather32u4 you have to change APN in library file LiveObjectsFona.cpp + - In case of Feather 32u4 you have to change APN in library file LiveObjectsFona.cpp - Line ~165 - m_Fona.setGPRSNetworkSettings(F("APN"), F(""), F("")); + - Line ~179 - m_Fona.setGPRSNetworkSettings(F("APN"), F(""), F("")); 5. Import library into the Arduino IDE, to do this select: *Sketch-> Include Library-> Add .ZIP Library* and select folder which you cloned in the previous step(actually it doesn't need to be .ZIP-ed to be imported). After successful import you should see example sketches in *File->Examples->LiveObjectsSDK* 6. Modules MKR 1010 WiFi, MKR VIDOR 4000, Nano 33 IoT should work "out of the box" using MQTTS. If not, you need to upgrade theirs firmwares and certificates using embedded updater in Arduino IDE: -*Tools -> WiFi101/WiFiNINA Firmware Updater*. +*Tools -> WiFi101/WiFiNINA Firmware Updater*. +**Due to bug, MKR VIDOR4000 needs WiFiNINA library at the most v.1.8.5.** -**Optionally for ESP8266 for getting MQTTS: +1) *Optionally for ESP8266, for getting MQTTS:* -ESP8266 can use MQTT as default. If you want to use MQTTS, you need to do below steps. +ESP8266 uses MQTT as default. If you want to use MQTTS, you need to do below steps. Install [**ESP8266 updater**](https://github.com/esp8266/arduino-esp8266fs-plugin) plugin for Arduino IDE. diff --git a/src/Adafruit_MQTT.cpp b/src/Adafruit_MQTT.cpp index 6862a54..f59792c 100644 --- a/src/Adafruit_MQTT.cpp +++ b/src/Adafruit_MQTT.cpp @@ -127,7 +127,6 @@ Adafruit_MQTT::Adafruit_MQTT(const char *server, uint16_t port, const char *user, const char *pass) { servername = server; portnum = port; - clientid = ""; username = user; password = pass; diff --git a/src/LiveObjects.h b/src/LiveObjects.h index 187ee25..b9669b6 100644 --- a/src/LiveObjects.h +++ b/src/LiveObjects.h @@ -19,7 +19,7 @@ #if defined ARDUINO_SAMD_MKRGSM1400 || defined ARDUINO_SAMD_MKRNB1500 #define Cellular #include "LiveObjectsCellular.h" - #elif defined ARDUINO_SAMD_MKRWIFI1010 || defined ARDUINO_SAMD_NANO_33_IOT || defined ARDUINO_SAMD_MKRVIDOR4000 || defined ARDUINO_SAMD_MKR1000 || ADAFRUIT_FEATHER_M0 + #elif defined ARDUINO_SAMD_MKRWIFI1010 || defined ARDUINO_SAMD_NANO_33_IOT || defined ARDUINO_SAMD_MKRVIDOR4000 || defined ARDUINO_SAMD_MKR1000 || defined ADAFRUIT_FEATHER_M0 #define WIFI_ #include "LiveObjectsWiFi.h" #endif diff --git a/src/LiveObjectsBase.h b/src/LiveObjectsBase.h index 10367d1..eb70959 100644 --- a/src/LiveObjectsBase.h +++ b/src/LiveObjectsBase.h @@ -12,14 +12,14 @@ ******************************************************************************/ #define PAYLOAD_DATA_SIZE 1024 #define KEEP_ALIVE_NETWORK 1000 -#define SW_REVISION "2.0.1" +#define SW_REVISION "2.0.2" /****************************************************************************** LiveObjects MQTT constants ******************************************************************************/ #if defined ARDUINO_SAMD_MKRWIFI1010 || defined ESP8266 || defined ESP32\ - || defined ARDUINO_SAMD_MKRVIDOR4000|| defined ARDUINO_SAMD_NANO_33_IOT + || defined ARDUINO_SAMD_NANO_33_IOT || defined ADAFRUIT_FEATHER_M0 || defined ARDUINO_SAMD_MKR1000 #define MQTT_BROKER "mqtt.liveobjects.orange-business.com" #else #define MQTT_BROKER "liveobjects.orange-business.com" diff --git a/src/LiveObjectsWiFi.h b/src/LiveObjectsWiFi.h index 9fe297c..5c6559c 100644 --- a/src/LiveObjectsWiFi.h +++ b/src/LiveObjectsWiFi.h @@ -5,10 +5,6 @@ * license which can be found in the file 'LICENSE.md' in this package distribution */ #if defined ARDUINO_SAMD_MKRWIFI1010 || defined ARDUINO_SAMD_NANO_33_IOT || defined ARDUINO_SAMD_MKRVIDOR4000 - #ifdef ARDUINO_SAMD_MKRVIDOR4000 - #include - #include - #endif #include "LiveObjectsMKR.h" #define WIFID #include