diff --git a/.codespellrc b/.codespellrc index b6200a41d..b10d11ce9 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,7 +1,7 @@ # See: https://github.com/codespell-project/codespell#using-a-config-file [codespell] # In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: -ignore-words-list = alocation,wan +ignore-words-list = alocation,bu,wan check-filenames = check-hidden = -skip = ./.git,./extras/test/external,./src/cbor/lib/tinycbor +skip = ./.git,./extras/test/external,./src/cbor/lib/tinycbor,./src/tls/bearssl diff --git a/README.md b/README.md index 3c4a8473d..cde81db0b 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ void onLedChange() { ### FAQ #### Watchdog -This [1.0.0](https://github.com/arduino-libraries/ArduinoIoTCloud/releases/tag/1.0.0) release of this library adds watchdog functionality to all ATSAMD21G18 based cloud connected boards. A watchdog is simply an electronic timer counting down from a preset start value which, upon reaching zero, triggers a reset of the microcontroller. It can be used to automatically recover from temporary hardware faults or unrecoverable software errors. In order to avoid the watchdog from reaching zero the countdown timer needs to be regularly re-set to its start value. This is happening within `ArduinoCloud.update()` which is periodically called at the start of the `loop()` function. Although the watchdog is automatically enabled it can be disabled by setting the second parameter of `ArduinoCloud.begin(...)` to `false`: +The [1.0.0](https://github.com/arduino-libraries/ArduinoIoTCloud/releases/tag/1.0.0) release of this library adds watchdog functionality to all ATSAMD21G18 based cloud connected boards. A watchdog is simply an electronic timer counting down from a preset start value which, upon reaching zero, triggers a reset of the microcontroller. It can be used to automatically recover from temporary hardware faults or unrecoverable software errors. In order to avoid the watchdog from reaching zero the countdown timer needs to be regularly re-set to its start value. This is happening within `ArduinoCloud.update()` which is periodically called at the start of the `loop()` function. Although the watchdog is automatically enabled it can be disabled by setting the second parameter of `ArduinoCloud.begin(...)` to `false`: ```C++ ArduinoCloud.begin(ArduinoIoTPreferredConnection, false). ``` @@ -78,14 +78,14 @@ ArduinoCloud.begin(ArduinoIoTPreferredConnection, false). ``` ArduinoIoTCloudTCP::handle_SubscribeMqttTopics could not subscribe to /a/t/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/e/i ``` -In this case either the device has not been associated with the thing within the Arduino IoT Cloud GUI configuration or there's a typo in the thing id. +In this case either the device has not been associated with the thing within the Arduino IoT Cloud GUI configuration or there's a typo in the thing ID. #### OTA OTA is supported by the following boards: [`MKR WiFi 1010`](https://store.arduino.cc/arduino-mkr-wifi-1010), [`Nano 33 IoT`](https://store.arduino.cc/arduino-nano-33-iot), [`Portenta H7`](https://store.arduino.cc/portenta-h7), [`Nano RP2040 Connect`](https://store.arduino.cc/products/arduino-nano-rp2040-connect), [`Nicla Vision`](https://store.arduino.cc/products/nicla-vision) #### ESP Boards -Support for ESP boards is obtained through third-party core with some differences and limitations compared to Arduino boards. +Support for ESP boards is obtained through a third-party core with some differences and limitations compared to Arduino boards. - **Authentication scheme**: Board authentication is done through `DEVICE_LOGIN_NAME` and `DEVICE_KEY`, both values are included in the `thingProperties.h` file. - **RTC**: RTC support is not included thus each `ArduinoCould.update()` call will lead to an NTP request introducing delay in your `loop()` function. The scheduler widget will not work correctly if connection is lost after configuration. diff --git a/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino b/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino index aa19f05ab..247860cff 100644 --- a/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino +++ b/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino @@ -3,12 +3,12 @@ This sketch is compatible with: - MKR 1000 - - MKR WIFI 1010 + - MKR WiFi 1010 - MKR GSM 1400 - MKR NB 1500 - MKR WAN 1300/1310 - Nano 33 IoT - - ESP 8266 + - ESP8266 */ #include "arduino_secrets.h" diff --git a/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino b/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino index 011a1fef8..097afb6f3 100644 --- a/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino +++ b/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino @@ -7,17 +7,17 @@ IMPORTANT: This sketch works with WiFi, GSM, NB and Lora enabled boards supported by Arduino IoT Cloud. - On a LoRa board, if it is configuered as a class A device (default and preferred option), values from Cloud dashboard are received + On a LoRa board, if it is configured as a class A device (default and preferred option), values from Cloud dashboard are received only after a value is sent to Cloud. This sketch is compatible with: - MKR 1000 - - MKR WIFI 1010 + - MKR WiFi 1010 - MKR GSM 1400 - MKR NB 1500 - MKR WAN 1300/1310 - Nano 33 IoT - - ESP 8266 + - ESP8266 */ #include "arduino_secrets.h" diff --git a/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino b/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino index f78417218..27c9d8f4d 100644 --- a/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino +++ b/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino @@ -19,17 +19,17 @@ IMPORTANT: This sketch works with WiFi, GSM, NB and Lora enabled boards supported by Arduino IoT Cloud. - On a LoRa board, if it is configuered as a class A device (default and preferred option), values from Cloud dashboard are received + On a LoRa board, if it is configured as a class A device (default and preferred option), values from Cloud dashboard are received only after a value is sent to Cloud. This sketch is compatible with: - MKR 1000 - - MKR WIFI 1010 + - MKR WiFi 1010 - MKR GSM 1400 - MKR NB 1500 - MKR WAN 1300/1310 - Nano 33 IoT - - ESP 8266 + - ESP8266 */ #include "arduino_secrets.h" diff --git a/examples/ArduinoIoTCloud-DeferredOTA/ArduinoIoTCloud-DeferredOTA.ino b/examples/ArduinoIoTCloud-DeferredOTA/ArduinoIoTCloud-DeferredOTA.ino index 34abcdc38..bd5b6a4d2 100644 --- a/examples/ArduinoIoTCloud-DeferredOTA/ArduinoIoTCloud-DeferredOTA.ino +++ b/examples/ArduinoIoTCloud-DeferredOTA/ArduinoIoTCloud-DeferredOTA.ino @@ -10,7 +10,7 @@ * ask_user_via_serial callback will read user input from serial to apply or postpone OTA update This sketch is compatible with: - - MKR WIFI 1010 + - MKR WiFi 1010 - Nano 33 IoT - Portenta - Nano RP2040 diff --git a/examples/ArduinoIoTCloud-Schedule/ArduinoIoTCloud-Schedule.ino b/examples/ArduinoIoTCloud-Schedule/ArduinoIoTCloud-Schedule.ino index 3e01f9703..3c97e49f4 100644 --- a/examples/ArduinoIoTCloud-Schedule/ArduinoIoTCloud-Schedule.ino +++ b/examples/ArduinoIoTCloud-Schedule/ArduinoIoTCloud-Schedule.ino @@ -3,11 +3,11 @@ This sketch is compatible with the following boards: - MKR 1000 - - MKR WIFI 1010 + - MKR WiFi 1010 - MKR GSM 1400 - MKR NB 1500 - Nano 33 IoT - - ESP 8266 + - ESP8266 */ #include "arduino_secrets.h" diff --git a/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino b/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino index bcb46b680..d74f9bc66 100644 --- a/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino +++ b/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino @@ -1,6 +1,6 @@ /* This sketch is used in combination with Travis CI to check if - unintentional breaking changes are made to the used facing + unintentional breaking changes are made to the user facing Arduino IoT Cloud API. This sketch is compatible with: diff --git a/examples/utility/Provisioning/Provisioning.ino b/examples/utility/Provisioning/Provisioning.ino index c1503afcb..97394fc2c 100644 --- a/examples/utility/Provisioning/Provisioning.ino +++ b/examples/utility/Provisioning/Provisioning.ino @@ -51,7 +51,7 @@ void setup() { while (1); } - String deviceId = promptAndReadLine("Please enter the device id: "); + String deviceId = promptAndReadLine("Please enter the device ID: "); Certificate.setSubjectCommonName(deviceId); if (!Crypto.buildCSR(Certificate, CryptoSlot::Key, true)) { @@ -88,7 +88,7 @@ void setup() { hexStringToBytes(signature, signatureBytes, sizeof(signatureBytes)); if (!Crypto.writeDeviceId(deviceId, CryptoSlot::DeviceId)) { - Serial.println("Error storing device id!"); + Serial.println("Error storing device ID!"); while (1); } diff --git a/extras/test/src/test_CloudLocation.cpp b/extras/test/src/test_CloudLocation.cpp index d9acd0ae4..a24186d91 100644 --- a/extras/test/src/test_CloudLocation.cpp +++ b/extras/test/src/test_CloudLocation.cpp @@ -14,7 +14,7 @@ TEST CODE **************************************************************************************/ -SCENARIO("Tesing cloud type 'Location' Ctor", "[Location::Location]") +SCENARIO("Testing cloud type 'Location' Ctor", "[Location::Location]") { WHEN("A Location(1.0f, 2.0f) is being instantiated") { @@ -30,7 +30,7 @@ SCENARIO("Tesing cloud type 'Location' Ctor", "[Location::Location]") /**************************************************************************************/ -SCENARIO("Tesing cloud type 'Location' assignment operator", "[Location::operator =]") +SCENARIO("Testing cloud type 'Location' assignment operator", "[Location::operator =]") { Location loc1(1.0f, 2.0f), loc2(3.0f, 4.0f); @@ -47,7 +47,7 @@ SCENARIO("Tesing cloud type 'Location' assignment operator", "[Location::operato /**************************************************************************************/ -SCENARIO("Tesing cloud type 'Location' operator -", "[Location::operator -]") +SCENARIO("Testing cloud type 'Location' operator -", "[Location::operator -]") { Location loc1(1.0f, 2.0f), loc2(3.0f, 4.0f); @@ -64,7 +64,7 @@ SCENARIO("Tesing cloud type 'Location' operator -", "[Location::operator -]") /**************************************************************************************/ -SCENARIO("Tesing cloud type 'Location' comparison operator ==", "[Location::operator ==]") +SCENARIO("Testing cloud type 'Location' comparison operator ==", "[Location::operator ==]") { Location loc1(1.0f, 2.0f), loc2(3.0f, 4.0f), @@ -87,7 +87,7 @@ SCENARIO("Tesing cloud type 'Location' comparison operator ==", "[Location::oper /**************************************************************************************/ -SCENARIO("Tesing cloud type 'Location' comparison operator !=", "[Location::operator !=]") +SCENARIO("Testing cloud type 'Location' comparison operator !=", "[Location::operator !=]") { Location loc1(1.0f, 2.0f), loc2(3.0f, 4.0f), @@ -110,7 +110,7 @@ SCENARIO("Tesing cloud type 'Location' comparison operator !=", "[Location::oper /**************************************************************************************/ -SCENARIO("Tesing cloud type 'Location' function distance for calculating euclidean 2d distance between two points", "[Location::distance]") +SCENARIO("Testing cloud type 'Location' function distance for calculating Euclidean 2d distance between two points", "[Location::distance]") { Location loc1(0.0f, 0.0f), loc2(1.0f, 1.0f); diff --git a/extras/test/src/test_CloudSchedule.cpp b/extras/test/src/test_CloudSchedule.cpp index 53b582aef..88acad6ab 100644 --- a/extras/test/src/test_CloudSchedule.cpp +++ b/extras/test/src/test_CloudSchedule.cpp @@ -28,7 +28,7 @@ unsigned long TimeService::getLocalTime() {return time_now;} TEST CODE **************************************************************************************/ -SCENARIO("Tesing cloud type 'Schedule' Ctor", "[Schedule::Schedule]") +SCENARIO("Testing cloud type 'Schedule' Ctor", "[Schedule::Schedule]") { WHEN("A Schedule(0,0,0,0) is being instantiated") { diff --git a/extras/test/src/test_publishOnChange.cpp b/extras/test/src/test_publishOnChange.cpp index 7b4592790..8d5f3f533 100644 --- a/extras/test/src/test_publishOnChange.cpp +++ b/extras/test/src/test_publishOnChange.cpp @@ -14,7 +14,7 @@ TEST CODE **************************************************************************************/ -SCENARIO("A Arduino cloud property is published on value change", "[ArduinoCloudThing::publishOnChange]") +SCENARIO("An Arduino cloud property is published on value change", "[ArduinoCloudThing::publishOnChange]") { PropertyContainer property_container; diff --git a/extras/test/src/test_publishOnChangeRateLimit.cpp b/extras/test/src/test_publishOnChangeRateLimit.cpp index 9f96a5610..92f8bc40e 100644 --- a/extras/test/src/test_publishOnChangeRateLimit.cpp +++ b/extras/test/src/test_publishOnChangeRateLimit.cpp @@ -14,7 +14,7 @@ TEST CODE **************************************************************************************/ -SCENARIO("A Arduino cloud property is published on value change but the update rate is limited", "[ArduinoCloudThing::publishOnChange]") +SCENARIO("An Arduino cloud property is published on value change but the update rate is limited", "[ArduinoCloudThing::publishOnChange]") { PropertyContainer property_container; diff --git a/extras/test/src/test_readOnly.cpp b/extras/test/src/test_readOnly.cpp index ef080922d..91bcf5cab 100644 --- a/extras/test/src/test_readOnly.cpp +++ b/extras/test/src/test_readOnly.cpp @@ -17,7 +17,7 @@ TEST CODE **************************************************************************************/ -SCENARIO("A Arduino cloud property is marked 'read only'", "[ArduinoCloudThing::decode]") +SCENARIO("An Arduino cloud property is marked 'read only'", "[ArduinoCloudThing::decode]") { PropertyContainer property_container; diff --git a/extras/test/src/test_writeOnly.cpp b/extras/test/src/test_writeOnly.cpp index 82283752e..6a45c3494 100644 --- a/extras/test/src/test_writeOnly.cpp +++ b/extras/test/src/test_writeOnly.cpp @@ -17,7 +17,7 @@ TEST CODE **************************************************************************************/ -SCENARIO("A Arduino cloud property is marked 'write only'", "[ArduinoCloudThing::encode]") +SCENARIO("An Arduino cloud property is marked 'write only'", "[ArduinoCloudThing::encode]") { PropertyContainer property_container; diff --git a/library.properties b/library.properties index 75ecb7a71..e15d45ab0 100644 --- a/library.properties +++ b/library.properties @@ -2,8 +2,8 @@ name=ArduinoIoTCloud version=1.7.0 author=Arduino maintainer=Arduino -sentence=This library allows to connect to the Arduino IoT Cloud service. -paragraph=It provides a ConnectionManager to handle connection/disconnection, property-change updates and events callbacks. The supported boards are MKRGSM, MKR1000 and WiFi101. +sentence=This library allows connecting to the Arduino IoT Cloud service. +paragraph=It provides a ConnectionManager to handle connection/disconnection, property-change updates and events callbacks. The supported boards are MKR GSM, MKR1000 and WiFi101. category=Communication url=https://github.com/arduino-libraries/ArduinoIoTCloud architectures=mbed,samd,esp8266,mbed_nano,mbed_portenta,mbed_nicla,esp32 diff --git a/src/ArduinoIoTCloudTCP.cpp b/src/ArduinoIoTCloudTCP.cpp index 5aab44f95..f7e0c4ca6 100644 --- a/src/ArduinoIoTCloudTCP.cpp +++ b/src/ArduinoIoTCloudTCP.cpp @@ -344,8 +344,8 @@ void ArduinoIoTCloudTCP::update() } _state = next_state; - /* This watchdog feed is actually needed only by the RP2040 CONNECT cause its - * maximum watchdog window is 8389ms; despite this we feed it for all + /* This watchdog feed is actually needed only by the RP2040 Connect because its + * maximum watchdog window is 8389 ms; despite this we feed it for all * supported ARCH to keep code aligned. */ #if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED) @@ -488,7 +488,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_CheckDeviceConfig() if(_deviceSubscribedToThing == true) { - /* Unsubscribe from old things topics and go on with a new subsctiption */ + /* Unsubscribe from old things topics and go on with a new subscription */ _mqttClient.unsubscribe(_shadowTopicIn); _mqttClient.unsubscribe(_dataTopicIn); _deviceSubscribedToThing = false; @@ -570,7 +570,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SubscribeThingTopics() execCloudEventCallback(ArduinoIoTCloudEvent::CONNECT); _deviceSubscribedToThing = true; - /*Add retry wait time otherwise we are trying to reconnect every 250ms...*/ + /*Add retry wait time otherwise we are trying to reconnect every 250 ms...*/ return State::RequestLastValues; } diff --git a/src/cbor/CBOREncoder.cpp b/src/cbor/CBOREncoder.cpp index b15b20837..d166756d4 100644 --- a/src/cbor/CBOREncoder.cpp +++ b/src/cbor/CBOREncoder.cpp @@ -138,7 +138,7 @@ CBOREncoder::EncoderState CBOREncoder::handle_OutOfMemory(PropertyContainerEncod CBOREncoder::EncoderState CBOREncoder::handle_SkipProperty(PropertyContainerEncoder & propertyEncoder) { /* Better to skip this property otherwise we will stay blocked here. This happens only with a message property - * that not fits into the CBOR buffer + * that doesn't fit into the CBOR buffer */ propertyEncoder.current_property_index++; if(propertyEncoder.current_property_index >= propertyEncoder.property_container.size()) @@ -182,7 +182,7 @@ CBOREncoder::EncoderState CBOREncoder::handle_FinishAppend(PropertyContainerEnco /* Restore property message limit to CBOR_ENCODER_NO_PROPERTIES_LIMIT */ propertyEncoder.property_limit_active = false; - /* The append process has been successful, so we don't need to terty to send this properties set. Cleanup _has_been_appended_but_not_sended flag */ + /* The append process has been successful, so we don't need to try to send this properties set. Cleanup _has_been_appended_but_not_sended flag */ PropertyContainer::iterator iter = propertyEncoder.property_container.begin(); std::advance(iter, propertyEncoder.current_property_index); int num_appended_properties = 0; @@ -197,7 +197,7 @@ CBOREncoder::EncoderState CBOREncoder::handle_FinishAppend(PropertyContainerEnco num_appended_properties++; } - /* Advance property index for the nex message */ + /* Advance property index for the next message */ propertyEncoder.current_property_index += propertyEncoder.checked_property_count; if(propertyEncoder.current_property_index >= propertyEncoder.property_container.size()) diff --git a/src/utility/ota/OTA-samd.cpp b/src/utility/ota/OTA-samd.cpp index f555415b8..dc5e1cc1f 100644 --- a/src/utility/ota/OTA-samd.cpp +++ b/src/utility/ota/OTA-samd.cpp @@ -47,7 +47,7 @@ int samd_onOTARequest(char const * ota_url) watchdog_reset(); - /* Trigger direct download to nina module. */ + /* Trigger direct download to NINA module. */ uint8_t nina_ota_err_code = 0; if (!WiFiStorage.downloadOTA(ota_url, &nina_ota_err_code)) {