Skip to content

Commit

Permalink
Merge pull request #13 from tomekmalek/certs_issue_update
Browse files Browse the repository at this point in the history
Certs issue update
  • Loading branch information
tomekmalek authored Jan 13, 2022
2 parents f030a34 + 9bf3888 commit 74cf865
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 22 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,30 @@ 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 | OPT<sup>1)</sup> | - |
| 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**
- [MKRGSM](https://www.arduino.cc/en/Reference/MKRGSM) in order to handle the GSM module on **Arduino MKR GSM 1400**
- [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~~ <sup>*</sup>

\* currently integrated into this SDK, until https://github.com/arduino-libraries/ArduinoMqttClient/pull/44 fix will be merged
<sup>*</sup> 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
Expand All @@ -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:
<sup>1)</sup> *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.

Expand Down
1 change: 0 additions & 1 deletion src/Adafruit_MQTT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/LiveObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/LiveObjectsBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 0 additions & 4 deletions src/LiveObjectsWiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <api/RingBuffer.h>
#include <VidorPeripherals.h>
#endif
#include "LiveObjectsMKR.h"
#define WIFID
#include <WiFiNINA.h>
Expand Down

0 comments on commit 74cf865

Please sign in to comment.