From 967290694df358e8f6ee0325392229f0689e4c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:05:50 +0200 Subject: [PATCH 01/21] IoT Cloud Docs --- docs/api.md | 531 +++++++++++++++++++++++++++++++++++++++++++++++++ docs/readme.md | 23 +++ 2 files changed, 554 insertions(+) create mode 100644 docs/api.md create mode 100644 docs/readme.md diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 00000000..913319fa --- /dev/null +++ b/docs/api.md @@ -0,0 +1,531 @@ +## ArduinoCloud Class (Base) + +### `ArduinoCloud (Class)` + +#### Description + +`ArduinoIoTCloud` is a class for interfacing with the Arduino IoT Cloud. It provides an interface for managing IoT Cloud connectivity, updating data, and handling events. + +Depending on what type of connection is used (TCP/LPWAN), either the `ArduinoIoTCloudTCP` or `ArduinoIoTCloudLPWAN` base classes are initialized. This specification is done in the Arduino IoT Cloud's "Thing" interface, and is reflected in the automatically generated `thingProperties.h` file. + +The above classes are inherited from the `ArduinoIoTCloudClass` base class, with methods used depending on what connection is used. + +#### Syntax + +``` +ArduinoCloud.method() +``` + +### `push()` + +#### Description + +Pushes data to the IoT Cloud. + +#### Syntax + +``` +ArduinoCloud.push() +``` + +#### Parameters + +None. + +#### Returns + +Nothing. + +### `setTimestamp()` + +Sets a timestamp for a cloud variable. + +#### Syntax + +``` +ArduinoCloud.setTimestamp(cloudVariable, timestamp) +``` + +#### Parameters + +- `String` - property name +- `unsigned long const` - timestamp + +### `setThingId()` + +Sets the Thing ID. + +#### Syntax + +``` +ArduinoCloud.setThingId(thingId) +``` + +#### Parameters +- `String` - your Thing's ID. Obtainable in the IoT Cloud interface. + +### `String & getThingId()` + +Gets the Thing ID. + +#### Syntax + +#### Parameters + +### `setDeviceId()` + +Sets the Device ID. + +#### Syntax + +``` +ArduinoCloud.setDeviceId(deviceId) +``` + +#### Parameters + +- `String` - Device ID. + +### `getDeviceId()` + +Gets the Device ID. + +#### Syntax + +``` +ArduinoCloud.getDeviceId() +``` + +#### Parameters + +None + +#### Returns + +- `String` - Device ID. + +### `setThingIdOutdatedFlag()` + +Sets a flag indicating that the Thing ID is outdated. + +#### Syntax + +``` +ArduinoCloud.setThingIdOutdatedFlag() +``` + +#### Parameters +None. + +#### Returns +Nothing. + +### `clrThingIdOutdatedFlag()` + +Clears the flag indicating that the Thing ID is outdated. + +#### Syntax + +``` +ArduinoCloud.clrThingIdOutdatedFlag() +``` + +#### Parameters +None. + +#### Returns +Nothing. + +### `getThingIdOutdatedFlag()` + +Gets the flag indicating whether the Thing ID is outdated. + +#### Syntax + +``` +ArduinoCloud.getThingOutdatedFlag() +``` + +#### Parameters +None. + +#### Returns +- Boolean (true/false) + +### `deviceNotAttached()` + +Checks if the device is not attached. + +#### Syntax + +``` +ArduinoCloud.deviceNotAttached() +``` + +#### Parameters +None. + +#### Returns + +- Boolean (true/false) + +### `getConnection()` + +Gets the connection handler used. + +#### Syntax + +``` +ArduinoCloud.getConnection() +``` + +#### Parameters + +### `getInternalTime()` + +Gets the internal time. + +#### Syntax + +``` +ArduinoCloud.getInternalTime() +``` + +#### Parameters +None. + +#### Returns +- `unsigned long` - internal time + +### `getLocalTime()` + +Gets the local time (based on your time zone). + +#### Syntax + +``` +ArduinoCloud.getLocalTime() +``` + +#### Parameters +None + +#### Returns +- `unsigned long` - local time + + +### `updateInternalTimezoneInfo()` + +Updates the internal timezone information. + +#### Syntax + +#### Parameters + +### `addCallback(ArduinoIoTCloudEvent const event, OnCloudEventCallback callback)` + +Adds a callback function for IoT Cloud events. + +#### Syntax + +``` +ArduinoCloud.addCallback(ArduinoIoTCloudEvent::CONNECT, doThisOnConnect); +ArduinoCloud.addCallback(ArduinoIoTCloudEvent::SYNC, doThisOnSync); +ArduinoCloud.addCallback(ArduinoIoTCloudEvent::DISCONNECT, doThisOnDisconnect); +``` + +#### Parameters +- Event (CONNECT, SYNC, DISCONNECT) +- Callback function + +#### Example + +See the [ArduinoIoTCloud-Callbacks](https://github.com/arduino-libraries/ArduinoIoTCloud/blob/master/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino) example. + + + +## ArduinoCloud Class (TCP) + +### `begin()` (TCP) + +#### Description + +Initialises the library with the connection handler specified in `thingProperties.h`. This is automatically generated based on the type of device. + +#### Syntax + +``` +ArduinoCloud.begin() +``` + +#### Parameters + +The `ArduinoIoTPreferredConnection` object is created automatically inside a `thingProperties.h` file when configuring a Thing and depends on what type of device you use. The connection handler classes are not part of the Arduino IoT Cloud, but exists inside the [Arduino_ConnectionHandler](https://github.com/arduino-libraries/Arduino_ConnectionHandler) library (listed as a dependency). + +For example, using the `WiFiConnectionHandler`, we use the `SSID`, `PASS` parameters which are defined in the `arduino_secrets.h` file, also generated based on what you input in the Arduino IoT Cloud interface. + +``` +WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS); +``` + +#### Returns +Nothing. + +### `update()` (TCP) + +#### Description + +**Note:** for LoRa devices, the `update()` function is implemented differently. See + +Responsible for updating the IoT Cloud connection. +- First it feeds a watchdog timer, making sure it is not stuck anywhere, +- then sends variable updates to the IoT Cloud (via MQTT client) +- finally, it checks for new data from the IoT Cloud (via the MQTT client) + +Any IoT Cloud sketch needs to continuously call the `update()` function, as it will otherwise time out and reset. The `update()` is by default placed inside of the `loop()`. + +**Note:** do not use the `delay()` function in the sketch, as the watchdog timer will cause the board to reset and attempt to reconnect. + +#### Syntax + +``` +ArduinoCloud.update() +``` + +#### Parameters +None. + +#### Returns +Nothing. + + +### `connected()` (TCP) + +#### Description + +Checks the connection status and returns an integer the connection status (int). + +#### Syntax + +``` +ArduinoCloud.connected() +``` + +#### Parameters +None. + +#### Returns +- `int` - status of connection + +### `printDebugInfo()` (TCP) + +#### Description + +Print any available debug information. + +#### Parameters +None + +#### Returns +Nothing. + +### `setBoardId()` + +#### Description + +This method is only enabled if you are using an ESP32/ESP8266 board, and sets the board/device id. + +#### Syntax + +``` +ArduinoCloud.setBoardId(DEVICE_LOGIN_NAME); +``` + +### `setSecretDeviceKey()` + +#### Description + +This method is only enabled if you are using an ESP32/ESP8266 based board, and sets the secret device key for the device. The secret key is only obtainable from the Arduino IoT Cloud during device configuration. + +#### Syntax + +``` +ArduinoCloud.setSecretDeviceKey(DEVICE_KEY); +``` + +### `getBrokerAddress()` + +#### Description + +Get the MQTT broker address used. + +#### Syntax + +``` +ArduinoCloud.getBrokerAddress() +``` + +#### Parameters +None. + +#### Return +- `String` - the MQTT broker address. + +### `getBrokerPort()` + +#### Description + +Get the MQTT broker port used. + +#### Syntax + +``` +ArduinoCloud.getBrokerPort() +``` + +#### Parameters +None. + +#### Return +- `int` - the MQTT broker port. + + + +## ArduinoCloud Class (LPWAN) + +### `begin()` (LPWAN) + +### Description +This function initializes the ArduinoIoTCloudLPWAN library with the specified connection handler and retry settings. + +#### Parameters +- `ConnectionHandler` - object containing `APPEUI`, `APPKEY` and frequency band (e.g. `_lora_band::EU868`) +- `bool` - a boolean value that decides whether retry functionality is enabled (`true`) or disabled (`false`) + +#### Returns + +- `int` - returns `1` on successful initialization. + +### `update()` (LPWAN) + +#### Description + +**Note:** for TCP devices, the `update()` function is implemented differently. See [ArduinoCloud Class (TCP)](). + +Responsible for updating the IoT Cloud connection. +- First it feeds a watchdog timer, making sure it is not stuck anywhere, +- then sends variable updates to the IoT Cloud (via MQTT client) +- finally, it checks for new data from the IoT Cloud (via the MQTT client) + +Any IoT Cloud sketch needs to continuously call the `update()` function, as it will otherwise time out and reset. The `update()` is by default placed inside of the `loop()`. + +**Note:** do not use the `delay()` function in the sketch, as the watchdog timer will cause the board to reset and attempt to reconnect. + +#### Syntax + +``` +ArduinoCloud.update() +``` + +#### Parameters +None. + +#### Returns +Nothing. + + +### `connected()` (LPWAN) + +#### Description + +Checks the connection status and returns an integer the connection status (int). + +#### Syntax + +``` +ArduinoCloud.connected() +``` + +#### Parameters +None. + +#### Returns +- `int` - status of connection + +### `printDebugInfo()` (LPWAN) + +#### Description + +Print any available debug information. + +#### Parameters +None. + +#### Returns +Nothing. + +## `isRetryEnabled()` + +#### Description +This method is used to check whether retry functionality is enabled. + +#### Parameters +None. + +#### Returns +- `bool` - returns `true` if retry functionality is enabled, otherwise returns `false`. + + +### `getMaxRetry()` + +#### Description +This method is used to retrieve the maximum number of retry attempts. + +#### Parameters +None. + +#### Returns +- `int` - returns the maximum number of retry attempts as an integer. + +### `getIntervalRetry()` + +#### Description +This method is used to retrieve the interval in milliseconds between the retry attempts. + +#### Parameters +None. + +#### Returns +- `long` - returns the interval between retry attempts in milliseconds. + +### `enableRetry()` + +#### Description +This method is used to enable or disable retry functionality. + +#### Parameters +- `bool` - if `true`, retry functionality is enabled; if `false`, retry functionality is disabled. + +#### Returns +Nothing. + +### `setMaxRetry()` + +Used to set the maximum number of retry attempts. + +#### Parameters +- `int` - the maximum number of retry attempts to set. + +#### Returns +Nothing. + +### `setIntervalRetry()` + +#### Description +Sets the interval in milliseconds between retry attempts. + +#### Parameters +- `long` - the interval between retry attempts in milliseconds to set. + +#### Returns +Nothing. \ No newline at end of file diff --git a/docs/readme.md b/docs/readme.md new file mode 100644 index 00000000..b4c95612 --- /dev/null +++ b/docs/readme.md @@ -0,0 +1,23 @@ +# ArduinoIoTCloud + +The ArduinoIoTCloud library is the central element of the firmware enabling certain Arduino boards to connect to the [Arduino IoT Cloud](https://create.arduino.cc/iot/). + +- To get started, check out the [official documentation](https://docs.arduino.cc/arduino-cloud/) +- For source code, check out the [GitHub repository](https://github.com/arduino-libraries/ArduinoIoTCloud) + + +## TCP / LPWAN + +Depending on what type of connection is used (TCP/LPWAN), either the `ArduinoIoTCloudTCP` or `ArduinoIoTCloudLPWAN` base classes are initialized. This specification is done in the Arduino IoT Cloud's "Thing" interface, and is reflected in the automatically generated `thingProperties.h` file. + +- If a board is configured as a **TCP** device, it will automatically include the `ArduinoIoTCloudTCP.h` file, and methods of the `ArduinoIoTCloudTCP` class will be made available. This is the most common option. +- If a board is configured as an **LPWAN** device, it will instead include the `ArduinoIoTCloudLPWAN.h` file, and methods of the `ArduinoIoTCloudLPWAN` class will be made available. + +As a result, functions such as `begin()`, `update()`, `connected()` and `printDebugInfo()` are documented under each corresponding class. + +## Connection Handler Library + +When the library is initalized via the `begin()` function, it will choose the specified **connection handler**, which is automatically added to your `thingProperties.h` file when configuring a Thing. + +The connection handler is done via another library, [Arduino_ConnectionHandler](https://github.com/arduino-libraries/Arduino_ConnectionHandler), which supports Wi-Fi®, GSM, NB-IoT, LoRa® & Ethernet. + From 9f3cd5a4fba87c278296c135431a0c4c1944abef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:08:11 +0200 Subject: [PATCH 02/21] Update readme.md --- docs/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/readme.md b/docs/readme.md index b4c95612..b14ec789 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -17,7 +17,7 @@ As a result, functions such as `begin()`, `update()`, `connected()` and `printDe ## Connection Handler Library -When the library is initalized via the `begin()` function, it will choose the specified **connection handler**, which is automatically added to your `thingProperties.h` file when configuring a Thing. +When the library is initialized via the `begin()` function, it will choose the specified **connection handler**, which is automatically added to your `thingProperties.h` file when configuring a Thing. The connection handler is done via another library, [Arduino_ConnectionHandler](https://github.com/arduino-libraries/Arduino_ConnectionHandler), which supports Wi-Fi®, GSM, NB-IoT, LoRa® & Ethernet. From 0bc469f4ec6c1ecf5030da5d79d9c0b36148fe7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:38:33 +0200 Subject: [PATCH 03/21] Added addProperty method --- docs/api.md | 43 ++++++++++++++++++++++++++++++++++++++++++- docs/readme.md | 13 +++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index 913319fa..ad4dc29f 100644 --- a/docs/api.md +++ b/docs/api.md @@ -222,7 +222,7 @@ Updates the internal timezone information. #### Parameters -### `addCallback(ArduinoIoTCloudEvent const event, OnCloudEventCallback callback)` +### `addCallback()` Adds a callback function for IoT Cloud events. @@ -329,6 +329,26 @@ None #### Returns Nothing. +### `addProperty()` (TCP) + +#### Description + +Adds a variable/property with a set of parameters. + +#### Syntax +``` +ArduinoCloud.addProperty(cloudVariable, tag, permission, policy, callbackFunction) +``` + +#### Parameters +- `cloudVariable` - name of the variable/property. +- `permission` - can either be `READ` / `WRITE` or `READWRITE` +- `policy` - `ON_CHANGE` (whenever variable data changes) or ` * SECONDS`. `` is specified in the Thing configuration. +- `callBackFunction` - by default, a callback function is added to a variable with **WRITE** permissions. A variable called `test` will automatically be added as `onTestChange` which also is added to your sketch. + +#### Returns +Nothing. + ### `setBoardId()` #### Description @@ -464,6 +484,27 @@ None. #### Returns Nothing. +### `addProperty()` (LPWAN) + +#### Description + +Adds a variable/property with a set of parameters. + +#### Syntax +``` +ArduinoCloud.addProperty(cloudVariable, tag, permission, policy, callbackFunction) +``` + +#### Parameters +- `cloudVariable` - name of the variable/property. +- `permission` - can either be `READ` / `WRITE` or `READWRITE` +- `tag` - matches the cloud and local variables with a number. E.g. adding a second variable will have the tag `2`. +- `policy` - `ON_CHANGE` (whenever variable data changes) or ` * SECONDS`. `` is specified in the Thing configuration. +- `callBackFunction` - by default, a callback function is added to a variable with **WRITE** permissions. A variable called `test` will automatically be added as `onTestChange` which also is added to your sketch. + +#### Returns +Nothing. + ## `isRetryEnabled()` #### Description diff --git a/docs/readme.md b/docs/readme.md index b14ec789..16c3cea7 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -5,6 +5,19 @@ The ArduinoIoTCloud library is the central element of the firmware enabling cert - To get started, check out the [official documentation](https://docs.arduino.cc/arduino-cloud/) - For source code, check out the [GitHub repository](https://github.com/arduino-libraries/ArduinoIoTCloud) +## thingProperties.h + +When you are create and configure a Thing in the [Arduino IoT Cloud interface](https://create.arduino.cc/iot/), the `thingProperties.h` file is generated automatically. + +This file adds all the variable/properties along with its specifications (e.g. update policy, read/write permissions), and the type of connection handler depending on what device you have attached. + +Methods such as `addProperty()` and `setThingId()` are implemented here, so there's no need for manually entering anything. + +We recommend that **you do not edit this file** as it is automatically updating whenever you make changes in the Arduino IoT Cloud. + +### Offline Editing + +If you have set up your sketch in an offline environment, make sure that whatever changes you make are reflected in this file, as it will be updated in the online environment. ## TCP / LPWAN From 732c2d9fbbcae19af72818bab04298a5ee77ec5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:55:44 +0200 Subject: [PATCH 04/21] Update based on feedback removed a number of methods that are not going to be public soon, and general revised some of the other methods --- docs/api.md | 57 +++++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/docs/api.md b/docs/api.md index ad4dc29f..40aa89f6 100644 --- a/docs/api.md +++ b/docs/api.md @@ -51,26 +51,22 @@ ArduinoCloud.setTimestamp(cloudVariable, timestamp) - `String` - property name - `unsigned long const` - timestamp -### `setThingId()` -Sets the Thing ID. +### `getThingId()` + +Gets the Thing ID. #### Syntax ``` -ArduinoCloud.setThingId(thingId) +ArduinoCloud.getThingId() ``` #### Parameters -- `String` - your Thing's ID. Obtainable in the IoT Cloud interface. - -### `String & getThingId()` - -Gets the Thing ID. - -#### Syntax +None. -#### Parameters +#### Returns +- `String` - Thing ID. ### `setDeviceId()` @@ -214,14 +210,6 @@ None - `unsigned long` - local time -### `updateInternalTimezoneInfo()` - -Updates the internal timezone information. - -#### Syntax - -#### Parameters - ### `addCallback()` Adds a callback function for IoT Cloud events. @@ -355,6 +343,10 @@ Nothing. This method is only enabled if you are using an ESP32/ESP8266 board, and sets the board/device id. +Currently, the following official Arduino boards uses this method: +- [Arduino UNO R4 WiFi](https://store.arduino.cc/products/uno-r4-wifi) +- [Arduino Nano ESP32](https://store.arduino.cc/products/nano-esp32) + #### Syntax ``` @@ -430,16 +422,7 @@ This function initializes the ArduinoIoTCloudLPWAN library with the specified co #### Description -**Note:** for TCP devices, the `update()` function is implemented differently. See [ArduinoCloud Class (TCP)](). - -Responsible for updating the IoT Cloud connection. -- First it feeds a watchdog timer, making sure it is not stuck anywhere, -- then sends variable updates to the IoT Cloud (via MQTT client) -- finally, it checks for new data from the IoT Cloud (via the MQTT client) - -Any IoT Cloud sketch needs to continuously call the `update()` function, as it will otherwise time out and reset. The `update()` is by default placed inside of the `loop()`. - -**Note:** do not use the `delay()` function in the sketch, as the watchdog timer will cause the board to reset and attempt to reconnect. +This method handles the update between the board and the IoT Cloud. #### Syntax @@ -505,7 +488,21 @@ ArduinoCloud.addProperty(cloudVariable, tag, permission, policy, callbackFunctio #### Returns Nothing. -## `isRetryEnabled()` +### `setThingId()` + +Sets the Thing ID. + +#### Syntax + +``` +ArduinoCloud.setThingId(thingId) +``` + +#### Parameters +- `String` - your Thing's ID. Obtainable in the IoT Cloud interface. + + +### `isRetryEnabled()` #### Description This method is used to check whether retry functionality is enabled. From 7e66828df26bcdad2eb0fb0b466ea30526562b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:03:16 +0200 Subject: [PATCH 05/21] Update api.md --- docs/api.md | 65 ----------------------------------------------------- 1 file changed, 65 deletions(-) diff --git a/docs/api.md b/docs/api.md index 40aa89f6..e4825e2d 100644 --- a/docs/api.md +++ b/docs/api.md @@ -100,71 +100,6 @@ None - `String` - Device ID. -### `setThingIdOutdatedFlag()` - -Sets a flag indicating that the Thing ID is outdated. - -#### Syntax - -``` -ArduinoCloud.setThingIdOutdatedFlag() -``` - -#### Parameters -None. - -#### Returns -Nothing. - -### `clrThingIdOutdatedFlag()` - -Clears the flag indicating that the Thing ID is outdated. - -#### Syntax - -``` -ArduinoCloud.clrThingIdOutdatedFlag() -``` - -#### Parameters -None. - -#### Returns -Nothing. - -### `getThingIdOutdatedFlag()` - -Gets the flag indicating whether the Thing ID is outdated. - -#### Syntax - -``` -ArduinoCloud.getThingOutdatedFlag() -``` - -#### Parameters -None. - -#### Returns -- Boolean (true/false) - -### `deviceNotAttached()` - -Checks if the device is not attached. - -#### Syntax - -``` -ArduinoCloud.deviceNotAttached() -``` - -#### Parameters -None. - -#### Returns - -- Boolean (true/false) - ### `getConnection()` Gets the connection handler used. From 095d4543a5cd796ba20ed557a4bbb39305e4819c Mon Sep 17 00:00:00 2001 From: pennam Date: Mon, 27 Nov 2023 15:10:38 +0100 Subject: [PATCH 06/21] Portenta H7: allow watchdog feed during CAT.M1 connection process --- src/ArduinoIoTCloudTCP.cpp | 5 ++-- src/utility/watchdog/Watchdog.cpp | 48 ++++++++++++++++--------------- src/utility/watchdog/Watchdog.h | 8 +++++- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/ArduinoIoTCloudTCP.cpp b/src/ArduinoIoTCloudTCP.cpp index 9e018d60..fe2c473e 100644 --- a/src/ArduinoIoTCloudTCP.cpp +++ b/src/ArduinoIoTCloudTCP.cpp @@ -233,9 +233,10 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress, */ #if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED) if (enable_watchdog) { + /* Initialize watchdog hardware */ watchdog_enable(); - bool const use_ethernet = _connection->getInterface() == NetworkAdapter::ETHERNET ? true : false; - watchdog_enable_network_feed(use_ethernet); + /* Setup callbacks to feed the watchdog during offloaded network operations (connection/download)*/ + watchdog_enable_network_feed(_connection->getInterface()); } #endif diff --git a/src/utility/watchdog/Watchdog.cpp b/src/utility/watchdog/Watchdog.cpp index aeb27abd..942b569f 100644 --- a/src/utility/watchdog/Watchdog.cpp +++ b/src/utility/watchdog/Watchdog.cpp @@ -39,8 +39,6 @@ # define EDGE_CONTROL_WATCHDOG_MAX_TIMEOUT_ms (65536) #endif /* ARDUINO_ARCH_MBED */ -#include - /****************************************************************************** * GLOBAL VARIABLES ******************************************************************************/ @@ -66,24 +64,18 @@ static void samd_watchdog_reset() } } -/* This function is called within the WiFiNINA library when invoking - * the method 'connectBearSSL' in order to prevent a premature bite - * of the watchdog (max timeout on SAMD is 16 s). wifi_nina_feed... +/* This function is called within the GSMConnectionHandler. mkr_gsm_feed... * is defined a weak function there and overwritten by this "strong" * function here. */ -#ifndef WIFI_HAS_FEED_WATCHDOG_FUNC -void wifi_nina_feed_watchdog() -{ - samd_watchdog_reset(); -} -#endif - void mkr_gsm_feed_watchdog() { samd_watchdog_reset(); } - +/* This function is called within the GSMConnectionHandler. mkr_nb_feed... + * is defined a weak function there and overwritten by this "strong" + * function here. + */ void mkr_nb_feed_watchdog() { samd_watchdog_reset(); @@ -119,18 +111,26 @@ static void mbed_watchdog_reset() } } -#if defined (ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC) -static void mbed_watchdog_enable_network_feed(const bool use_ethernet) +static void mbed_watchdog_enable_network_feed(NetworkAdapter ni) { + if (ni == NetworkAdapter::ETHERNET) { #if defined(BOARD_HAS_ETHERNET) - if(use_ethernet) { Ethernet.setFeedWatchdogFunc(watchdog_reset); - } else #endif + } + + if (ni == NetworkAdapter::WIFI) { +#if defined(ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC) && defined(BOARD_HAS_WIFI) WiFi.setFeedWatchdogFunc(watchdog_reset); +#endif + } -} + if (ni == NetworkAdapter::CATM1) { +#if defined(BOARD_HAS_CATM1_NBIOT) + GSM.setFeedWatchdogFunc(watchdog_reset); #endif + } +} void mbed_watchdog_trigger_reset() { @@ -167,15 +167,17 @@ void watchdog_reset() #endif } -void watchdog_enable_network_feed(const bool use_ethernet) +void watchdog_enable_network_feed(NetworkAdapter ni) { -#ifdef WIFI_HAS_FEED_WATCHDOG_FUNC - (void)use_ethernet; + /* Setup WiFi NINA watchdog feed callback function */ +#if defined(ARDUINO_ARCH_SAMD) && defined(WIFI_HAS_FEED_WATCHDOG_FUNC) + (void)ni; WiFi.setFeedWatchdogFunc(watchdog_reset); #endif -#ifdef ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC - mbed_watchdog_enable_network_feed(use_ethernet); + /* Setup mbed sockets watchdog feed callback function */ +#if defined(ARDUINO_ARCH_MBED) + mbed_watchdog_enable_network_feed(ni); #endif } #endif /* (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED) */ diff --git a/src/utility/watchdog/Watchdog.h b/src/utility/watchdog/Watchdog.h index dbaf2abd..3bfd3545 100644 --- a/src/utility/watchdog/Watchdog.h +++ b/src/utility/watchdog/Watchdog.h @@ -18,6 +18,12 @@ #ifndef ARDUINO_AIOTC_UTILITY_WATCHDOG_H_ #define ARDUINO_AIOTC_UTILITY_WATCHDOG_H_ +/****************************************************************************** + * INCLUDE + ******************************************************************************/ + +#include + /****************************************************************************** * FUNCTION DECLARATION ******************************************************************************/ @@ -25,7 +31,7 @@ #if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED) void watchdog_enable(); void watchdog_reset(); -void watchdog_enable_network_feed(const bool use_ethernet); +void watchdog_enable_network_feed(NetworkAdapter ni); #endif /* (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED) */ #ifdef ARDUINO_ARCH_MBED From d1e2fc8c13d4c0179d0905e4491f8591bfd9fd07 Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 10 Jan 2024 21:30:30 +0100 Subject: [PATCH 07/21] Use DEFAULT_MIN_TIME_BETWEEN_UPDATES_MILLIS as default period for publishOnChange --- src/property/Property.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/property/Property.h b/src/property/Property.h index 90848b64..7393da19 100644 --- a/src/property/Property.h +++ b/src/property/Property.h @@ -143,7 +143,7 @@ class Property /* Composable configuration of the Property class */ Property & onUpdate(UpdateCallbackFunc func); Property & onSync(OnSyncCallbackFunc func); - Property & publishOnChange(float const min_delta_property, unsigned long const min_time_between_updates_millis = 0); + Property & publishOnChange(float const min_delta_property, unsigned long const min_time_between_updates_millis = DEFAULT_MIN_TIME_BETWEEN_UPDATES_MILLIS); Property & publishEvery(unsigned long const seconds); Property & publishOnDemand(); Property & encodeTimestamp(); From 349ae46b1f97710a4160c6c098373be65e233a9a Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 10 Jan 2024 21:35:32 +0100 Subject: [PATCH 08/21] Unit tests: force publishOnChange interval to 0 - The test was intended to run with a default interval of 0, changing the default we need to manually force interval to 0 --- extras/test/src/test_publishOnChange.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/test/src/test_publishOnChange.cpp b/extras/test/src/test_publishOnChange.cpp index 8d5f3f53..2896e00b 100644 --- a/extras/test/src/test_publishOnChange.cpp +++ b/extras/test/src/test_publishOnChange.cpp @@ -21,7 +21,7 @@ SCENARIO("An Arduino cloud property is published on value change", "[ArduinoClou CloudInt test = 10; int const DELTA = 6; - addPropertyToContainer(property_container, test, "test", Permission::ReadWrite).publishOnChange(DELTA); + addPropertyToContainer(property_container, test, "test", Permission::ReadWrite).publishOnChange(DELTA,0); WHEN("test = 10, delta = 6, the property is encoded for the 1st time") { THEN("The property should be encoded") { From eb39dbe6b64657391a68119ce38a63bbd8bfdb10 Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 12 Jan 2024 15:12:16 +0100 Subject: [PATCH 09/21] Avoid library to call deprecated functions itself --- src/ArduinoIoTCloud.cpp | 32 +++++++++++++++++++++----------- src/ArduinoIoTCloud.h | 2 ++ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/ArduinoIoTCloud.cpp b/src/ArduinoIoTCloud.cpp index 4997ec9b..58052104 100644 --- a/src/ArduinoIoTCloud.cpp +++ b/src/ArduinoIoTCloud.cpp @@ -126,56 +126,66 @@ Property& ArduinoIoTCloudClass::addPropertyReal(Property& property, String name, /* The following methods are deprecated but still used for non-LoRa boards */ void ArduinoIoTCloudClass::addPropertyReal(bool& property, String name, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { - addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); + Property* p = new CloudWrapperBool(property); + addPropertyRealInternal(*p, name, -1, permission_type, seconds, fn, minDelta, synFn); } void ArduinoIoTCloudClass::addPropertyReal(float& property, String name, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { - addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); + Property* p = new CloudWrapperFloat(property); + addPropertyRealInternal(*p, name, -1, permission_type, seconds, fn, minDelta, synFn); } void ArduinoIoTCloudClass::addPropertyReal(int& property, String name, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { - addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); + Property* p = new CloudWrapperInt(property); + addPropertyRealInternal(*p, name, -1, permission_type, seconds, fn, minDelta, synFn); } void ArduinoIoTCloudClass::addPropertyReal(unsigned int& property, String name, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { - addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); + Property* p = new CloudWrapperUnsignedInt(property); + addPropertyRealInternal(*p, name, -1, permission_type, seconds, fn, minDelta, synFn); } void ArduinoIoTCloudClass::addPropertyReal(String& property, String name, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { - addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); + Property* p = new CloudWrapperString(property); + addPropertyRealInternal(*p, name, -1, permission_type, seconds, fn, minDelta, synFn); } void ArduinoIoTCloudClass::addPropertyReal(Property& property, String name, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { - addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); + addPropertyRealInternal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); } /* The following methods are deprecated but still used for both LoRa and non-LoRa boards */ void ArduinoIoTCloudClass::addPropertyReal(bool& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { Property* p = new CloudWrapperBool(property); - addPropertyReal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); + addPropertyRealInternal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); } void ArduinoIoTCloudClass::addPropertyReal(float& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { Property* p = new CloudWrapperFloat(property); - addPropertyReal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); + addPropertyRealInternal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); } void ArduinoIoTCloudClass::addPropertyReal(int& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { Property* p = new CloudWrapperInt(property); - addPropertyReal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); + addPropertyRealInternal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); } void ArduinoIoTCloudClass::addPropertyReal(unsigned int& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { Property* p = new CloudWrapperUnsignedInt(property); - addPropertyReal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); + addPropertyRealInternal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); } void ArduinoIoTCloudClass::addPropertyReal(String& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { Property* p = new CloudWrapperString(property); - addPropertyReal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); + addPropertyRealInternal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); } void ArduinoIoTCloudClass::addPropertyReal(Property& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) +{ + addPropertyRealInternal(property, name, tag, permission_type, seconds, fn, minDelta, synFn); +} + +void ArduinoIoTCloudClass::addPropertyRealInternal(Property& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) { Permission permission = Permission::ReadWrite; if (permission_type == READ) { diff --git a/src/ArduinoIoTCloud.h b/src/ArduinoIoTCloud.h index bce662eb..6154f25e 100644 --- a/src/ArduinoIoTCloud.h +++ b/src/ArduinoIoTCloud.h @@ -166,6 +166,8 @@ class ArduinoIoTCloudClass private: + void addPropertyRealInternal(Property& property, String name, int tag, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, float minDelta = 0.0f, void(*synFn)(Property & property) = CLOUD_WINS); + String _device_id; OnCloudEventCallback _cloud_event_callback[3]; bool _thing_id_outdated; From d34c500984fbeffeb390ea4502f755210c75b57f Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 31 Jan 2024 10:18:46 +0100 Subject: [PATCH 10/21] Examples: make examples build on cloud web editor --- .../ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino | 1 - examples/ArduinoIoTCloud-Advanced/arduino_secrets.h | 3 --- examples/ArduinoIoTCloud-Advanced/thingProperties.h | 4 ++++ examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino | 1 - examples/ArduinoIoTCloud-Basic/arduino_secrets.h | 3 --- examples/ArduinoIoTCloud-Basic/thingProperties.h | 4 ++++ .../ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino | 1 - examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h | 3 --- examples/ArduinoIoTCloud-Callbacks/thingProperties.h | 4 ++++ .../ArduinoIoTCloud-DeferredOTA.ino | 1 - examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h | 3 --- examples/ArduinoIoTCloud-DeferredOTA/thingProperties.h | 4 ++++ .../ArduinoIoTCloud-Schedule/ArduinoIoTCloud-Schedule.ino | 1 - examples/ArduinoIoTCloud-Schedule/arduino_secrets.h | 3 --- examples/ArduinoIoTCloud-Schedule/thingProperties.h | 4 ++++ 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino b/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino index a026d629..e958594c 100644 --- a/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino +++ b/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino @@ -10,7 +10,6 @@ - https://github.com/arduino-libraries/ArduinoIoTCloud#what */ -#include "arduino_secrets.h" #include "thingProperties.h" void setup() { diff --git a/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h b/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h index fc43514f..3d464a47 100644 --- a/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h @@ -1,6 +1,3 @@ -#include -#include - /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ diff --git a/examples/ArduinoIoTCloud-Advanced/thingProperties.h b/examples/ArduinoIoTCloud-Advanced/thingProperties.h index 97ffee9d..09f96545 100644 --- a/examples/ArduinoIoTCloud-Advanced/thingProperties.h +++ b/examples/ArduinoIoTCloud-Advanced/thingProperties.h @@ -1,3 +1,7 @@ +#include +#include +#include "arduino_secrets.h" + #if !(defined(BOARD_HAS_WIFI) || defined(BOARD_HAS_GSM) || defined(BOARD_HAS_LORA) || \ defined(BOARD_HAS_NB) || defined(BOARD_HAS_ETHERNET) || defined(BOARD_HAS_CATM1_NBIOT)) #error "Please check Arduino IoT Cloud supported boards list: https://github.com/arduino-libraries/ArduinoIoTCloud/#what" diff --git a/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino b/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino index ba4162ba..426c4da5 100644 --- a/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino +++ b/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino @@ -14,7 +14,6 @@ - https://github.com/arduino-libraries/ArduinoIoTCloud#what */ -#include "arduino_secrets.h" #include "thingProperties.h" #if !defined(LED_BUILTIN) && !defined(ARDUINO_NANO_ESP32) diff --git a/examples/ArduinoIoTCloud-Basic/arduino_secrets.h b/examples/ArduinoIoTCloud-Basic/arduino_secrets.h index fc43514f..3d464a47 100644 --- a/examples/ArduinoIoTCloud-Basic/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Basic/arduino_secrets.h @@ -1,6 +1,3 @@ -#include -#include - /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ diff --git a/examples/ArduinoIoTCloud-Basic/thingProperties.h b/examples/ArduinoIoTCloud-Basic/thingProperties.h index 31d49b65..b6025d89 100644 --- a/examples/ArduinoIoTCloud-Basic/thingProperties.h +++ b/examples/ArduinoIoTCloud-Basic/thingProperties.h @@ -1,3 +1,7 @@ +#include +#include +#include "arduino_secrets.h" + #if !(defined(BOARD_HAS_WIFI) || defined(BOARD_HAS_GSM) || defined(BOARD_HAS_LORA) || \ defined(BOARD_HAS_NB) || defined(BOARD_HAS_ETHERNET) || defined(BOARD_HAS_CATM1_NBIOT)) #error "Please check Arduino IoT Cloud supported boards list: https://github.com/arduino-libraries/ArduinoIoTCloud/#what" diff --git a/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino b/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino index 63446471..20b37f29 100644 --- a/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino +++ b/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino @@ -26,7 +26,6 @@ - https://github.com/arduino-libraries/ArduinoIoTCloud#what */ -#include "arduino_secrets.h" #include "thingProperties.h" void setup() { diff --git a/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h b/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h index fc43514f..3d464a47 100644 --- a/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h @@ -1,6 +1,3 @@ -#include -#include - /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ diff --git a/examples/ArduinoIoTCloud-Callbacks/thingProperties.h b/examples/ArduinoIoTCloud-Callbacks/thingProperties.h index 59eff585..daed6909 100644 --- a/examples/ArduinoIoTCloud-Callbacks/thingProperties.h +++ b/examples/ArduinoIoTCloud-Callbacks/thingProperties.h @@ -1,3 +1,7 @@ +#include +#include +#include "arduino_secrets.h" + #if !(defined(BOARD_HAS_WIFI) || defined(BOARD_HAS_GSM) || defined(BOARD_HAS_LORA) || \ defined(BOARD_HAS_NB) || defined(BOARD_HAS_ETHERNET) || defined(BOARD_HAS_CATM1_NBIOT)) #error "Please check Arduino IoT Cloud supported boards list: https://github.com/arduino-libraries/ArduinoIoTCloud/#what" diff --git a/examples/ArduinoIoTCloud-DeferredOTA/ArduinoIoTCloud-DeferredOTA.ino b/examples/ArduinoIoTCloud-DeferredOTA/ArduinoIoTCloud-DeferredOTA.ino index b39439b4..bbe58c37 100644 --- a/examples/ArduinoIoTCloud-DeferredOTA/ArduinoIoTCloud-DeferredOTA.ino +++ b/examples/ArduinoIoTCloud-DeferredOTA/ArduinoIoTCloud-DeferredOTA.ino @@ -16,7 +16,6 @@ - https://github.com/arduino-libraries/ArduinoIoTCloud/#ota */ -#include "arduino_secrets.h" #include "thingProperties.h" #if !defined(LED_BUILTIN) && !defined(ARDUINO_NANO_ESP32) diff --git a/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h b/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h index 1b0bb7fc..412b7db1 100644 --- a/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h @@ -1,6 +1,3 @@ -#include -#include - /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ diff --git a/examples/ArduinoIoTCloud-DeferredOTA/thingProperties.h b/examples/ArduinoIoTCloud-DeferredOTA/thingProperties.h index 525de5aa..1aa4b1be 100644 --- a/examples/ArduinoIoTCloud-DeferredOTA/thingProperties.h +++ b/examples/ArduinoIoTCloud-DeferredOTA/thingProperties.h @@ -1,3 +1,7 @@ +#include +#include +#include "arduino_secrets.h" + #if !(defined(BOARD_HAS_WIFI) || defined(BOARD_HAS_ETHERNET)) #error "Please check Arduino IoT Cloud supported boards list: https://github.com/arduino-libraries/ArduinoIoTCloud/#what" #endif diff --git a/examples/ArduinoIoTCloud-Schedule/ArduinoIoTCloud-Schedule.ino b/examples/ArduinoIoTCloud-Schedule/ArduinoIoTCloud-Schedule.ino index 48454803..9adb8337 100644 --- a/examples/ArduinoIoTCloud-Schedule/ArduinoIoTCloud-Schedule.ino +++ b/examples/ArduinoIoTCloud-Schedule/ArduinoIoTCloud-Schedule.ino @@ -6,7 +6,6 @@ */ -#include "arduino_secrets.h" #include "thingProperties.h" #if !defined(LED_BUILTIN) && !defined(ARDUINO_NANO_ESP32) diff --git a/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h b/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h index fc43514f..3d464a47 100644 --- a/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h @@ -1,6 +1,3 @@ -#include -#include - /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ diff --git a/examples/ArduinoIoTCloud-Schedule/thingProperties.h b/examples/ArduinoIoTCloud-Schedule/thingProperties.h index 4f03c20c..69a47186 100644 --- a/examples/ArduinoIoTCloud-Schedule/thingProperties.h +++ b/examples/ArduinoIoTCloud-Schedule/thingProperties.h @@ -1,3 +1,7 @@ +#include +#include +#include "arduino_secrets.h" + #if !(defined(BOARD_HAS_WIFI) || defined(BOARD_HAS_GSM) || defined(BOARD_HAS_LORA) || \ defined(BOARD_HAS_NB) || defined(BOARD_HAS_ETHERNET) || defined(BOARD_HAS_CATM1_NBIOT)) #error "Please check Arduino IoT Cloud supported boards list: https://github.com/arduino-libraries/ArduinoIoTCloud/#what" From fd69bce0cf845fa0b5834e55620cde876096a718 Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 1 Feb 2024 14:47:35 +0100 Subject: [PATCH 11/21] Examples: restore Arduino_ConnectionHandler.h include in the arduino_secrets.h files The reason is that this makes it easier for the user to understand the origin of the BOARD_HAS_* macros referenced in the file. --- examples/ArduinoIoTCloud-Advanced/arduino_secrets.h | 2 ++ examples/ArduinoIoTCloud-Basic/arduino_secrets.h | 2 ++ examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h | 2 ++ examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h | 2 ++ examples/ArduinoIoTCloud-Schedule/arduino_secrets.h | 2 ++ 5 files changed, 10 insertions(+) diff --git a/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h b/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h index 3d464a47..2f606922 100644 --- a/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h @@ -1,3 +1,5 @@ +#include + /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ diff --git a/examples/ArduinoIoTCloud-Basic/arduino_secrets.h b/examples/ArduinoIoTCloud-Basic/arduino_secrets.h index 3d464a47..2f606922 100644 --- a/examples/ArduinoIoTCloud-Basic/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Basic/arduino_secrets.h @@ -1,3 +1,5 @@ +#include + /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ diff --git a/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h b/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h index 3d464a47..2f606922 100644 --- a/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h @@ -1,3 +1,5 @@ +#include + /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ diff --git a/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h b/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h index 412b7db1..b745cf21 100644 --- a/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h @@ -1,3 +1,5 @@ +#include + /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ diff --git a/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h b/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h index 3d464a47..2f606922 100644 --- a/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h @@ -1,3 +1,5 @@ +#include + /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ From 03f46d2078ed04a19cae0fc1fd2a6d1a21ba717f Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 1 Feb 2024 14:50:43 +0100 Subject: [PATCH 12/21] Examples: fix ArduinoIoTCloud_Travis_CI following the same pattern --- .../ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino | 1 - examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h | 1 - examples/utility/ArduinoIoTCloud_Travis_CI/thingProperties.h | 4 ++++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino b/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino index 6a971f62..8995da36 100644 --- a/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino +++ b/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino @@ -12,7 +12,6 @@ - https://github.com/arduino-libraries/ArduinoIoTCloud#what */ -#include "arduino_secrets.h" #include "thingProperties.h" void setup() { diff --git a/examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h b/examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h index fc43514f..2f606922 100644 --- a/examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h +++ b/examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h @@ -1,4 +1,3 @@ -#include #include /* A complete list of supported boards with WiFi is available here: diff --git a/examples/utility/ArduinoIoTCloud_Travis_CI/thingProperties.h b/examples/utility/ArduinoIoTCloud_Travis_CI/thingProperties.h index a93e8305..3410978b 100644 --- a/examples/utility/ArduinoIoTCloud_Travis_CI/thingProperties.h +++ b/examples/utility/ArduinoIoTCloud_Travis_CI/thingProperties.h @@ -1,3 +1,7 @@ +#include +#include +#include "arduino_secrets.h" + #if !(defined(BOARD_HAS_WIFI) || defined(BOARD_HAS_GSM) || defined(BOARD_HAS_LORA) || \ defined(BOARD_HAS_NB) || defined(BOARD_HAS_ETHERNET) || defined(BOARD_HAS_CATM1_NBIOT)) #error "Please check Arduino IoT Cloud supported boards list: https://github.com/arduino-libraries/ArduinoIoTCloud/#what" From 2f4a7568d7b84960ca85f1aa81ae1ace78695a74 Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 1 Feb 2024 15:01:11 +0100 Subject: [PATCH 13/21] Examples: add newline to improve formatting --- .../ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino | 4 ++-- examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino | 4 ++-- .../ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino | 4 ++-- .../ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino b/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino index e958594c..4f45a395 100644 --- a/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino +++ b/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino @@ -3,8 +3,8 @@ IMPORTANT: This sketch works with WiFi, GSM, NB, Ethernet and Lora enabled boards supported by Arduino IoT Cloud. - 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. + 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. The full list of compatible boards can be found here: - https://github.com/arduino-libraries/ArduinoIoTCloud#what diff --git a/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino b/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino index 426c4da5..cb146900 100644 --- a/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino +++ b/examples/ArduinoIoTCloud-Basic/ArduinoIoTCloud-Basic.ino @@ -7,8 +7,8 @@ IMPORTANT: This sketch works with WiFi, GSM, NB, Ethernet and Lora enabled boards supported by Arduino IoT Cloud. - 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. + 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. The full list of compatible boards can be found here: - https://github.com/arduino-libraries/ArduinoIoTCloud#what diff --git a/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino b/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino index 20b37f29..c01153d9 100644 --- a/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino +++ b/examples/ArduinoIoTCloud-Callbacks/ArduinoIoTCloud-Callbacks.ino @@ -19,8 +19,8 @@ IMPORTANT: This sketch works with WiFi, GSM, NB, Ethernet and Lora enabled boards supported by Arduino IoT Cloud. - 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. + 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. The full list of compatible boards can be found here: - https://github.com/arduino-libraries/ArduinoIoTCloud#what diff --git a/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino b/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino index 8995da36..575b55f4 100644 --- a/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino +++ b/examples/utility/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino @@ -5,8 +5,8 @@ IMPORTANT: This sketch works with WiFi, GSM, NB, Ethernet and Lora enabled boards supported by Arduino IoT Cloud. - 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. + 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. The full list of compatible boards can be found here: - https://github.com/arduino-libraries/ArduinoIoTCloud#what From 094453cfa560e3572217fa45451512616cc5141c Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 2 Feb 2024 16:26:21 +0100 Subject: [PATCH 14/21] Remove remaining ARDUINO_AVR_UNO_WIFI_REV2 configuration defines --- src/AIoTC_Config.h | 51 ++++++++-------------------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/src/AIoTC_Config.h b/src/AIoTC_Config.h index eb2750b4..64f0a33a 100644 --- a/src/AIoTC_Config.h +++ b/src/AIoTC_Config.h @@ -27,64 +27,30 @@ #endif #ifndef DEBUG_ERROR -# if defined(ARDUINO_AVR_UNO_WIFI_REV2) -# define DEBUG_ERROR(fmt, ...) Debug.print(DBG_ERROR, fmt, ## __VA_ARGS__) -# else -# define DEBUG_ERROR(fmt, ...) Debug.print(DBG_ERROR, fmt, ## __VA_ARGS__) -# endif + #define DEBUG_ERROR(fmt, ...) Debug.print(DBG_ERROR, fmt, ## __VA_ARGS__) #endif #ifndef DEBUG_WARNING -# if defined(ARDUINO_AVR_UNO_WIFI_REV2) -# define DEBUG_WARNING(fmt, ...) -# else -# define DEBUG_WARNING(fmt, ...) Debug.print(DBG_WARNING, fmt, ## __VA_ARGS__) -# endif + #define DEBUG_WARNING(fmt, ...) Debug.print(DBG_WARNING, fmt, ## __VA_ARGS__) #endif #ifndef DEBUG_INFO -# if defined(ARDUINO_AVR_UNO_WIFI_REV2) -# define DEBUG_INFO(fmt, ...) -# else -# define DEBUG_INFO(fmt, ...) Debug.print(DBG_INFO, fmt, ## __VA_ARGS__) -# endif + #define DEBUG_INFO(fmt, ...) Debug.print(DBG_INFO, fmt, ## __VA_ARGS__) #endif #ifndef DEBUG_DEBUG -# if defined(ARDUINO_AVR_UNO_WIFI_REV2) -# define DEBUG_DEBUG(fmt, ...) -# else -# define DEBUG_DEBUG(fmt, ...) Debug.print(DBG_DEBUG, fmt, ## __VA_ARGS__) -# endif + #define DEBUG_DEBUG(fmt, ...) Debug.print(DBG_DEBUG, fmt, ## __VA_ARGS__) #endif #ifndef DEBUG_VERBOSE -# if defined(ARDUINO_AVR_UNO_WIFI_REV2) -# define DEBUG_VERBOSE(fmt, ...) -# else -# define DEBUG_VERBOSE(fmt, ...) //Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__) -# endif -#endif - -#if defined(ARDUINO_AVR_UNO_WIFI_REV2) && !(defined(DEBUG_ERROR) || defined(DEBUG_WARNING) || defined(DEBUG_INFO) || defined(DEBUG_DEBUG) || defined(DEBUG_VERBOSE)) -/* Provide defines for constants provided within Arduino_DebugUtils - * in order to allow older sketches using those constants to still - * compile. - */ -# define DBG_NONE -1 -# define DBG_ERROR 0 -# define DBG_WARNING 1 -# define DBG_INFO 2 -# define DBG_DEBUG 3 -# define DBG_VERBOSE 4 + #define DEBUG_VERBOSE(fmt, ...) //Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__) #endif /****************************************************************************** * AUTOMATICALLY CONFIGURED DEFINES ******************************************************************************/ -#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) || \ - defined(ARDUINO_AVR_UNO_WIFI_REV2) +#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) #define OTA_STORAGE_SNU (1) #else #define OTA_STORAGE_SNU (0) @@ -112,7 +78,7 @@ #define OTA_STORAGE_ESP (1) #endif -#if (OTA_STORAGE_SFU || OTA_STORAGE_SSU || OTA_STORAGE_SNU || OTA_STORAGE_PORTENTA_QSPI || OTA_STORAGE_ESP) && !defined(ARDUINO_AVR_UNO_WIFI_REV2) +#if (OTA_STORAGE_SFU || OTA_STORAGE_SSU || OTA_STORAGE_SNU || OTA_STORAGE_PORTENTA_QSPI || OTA_STORAGE_ESP) #define OTA_ENABLED (1) #else #define OTA_ENABLED (0) @@ -131,8 +97,7 @@ #define HAS_TCP #endif -#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || \ - defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) +#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_HAS_OFFLOADED_ECCX08 #define HAS_TCP #endif From 42f62d30f306d675f2212acf9b89c532f0b22505 Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 10 Jan 2024 22:18:21 +0100 Subject: [PATCH 15/21] Add build configuration file for ECCX08 --- src/AIoTC_Config.h | 2 ++ src/ArduinoECCX08Config.h | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/ArduinoECCX08Config.h diff --git a/src/AIoTC_Config.h b/src/AIoTC_Config.h index eb2750b4..62d62e34 100644 --- a/src/AIoTC_Config.h +++ b/src/AIoTC_Config.h @@ -18,6 +18,8 @@ #ifndef ARDUINO_AIOTC_CONFIG_H_ #define ARDUINO_AIOTC_CONFIG_H_ +#include + /****************************************************************************** * USER CONFIGURABLE DEFINES ******************************************************************************/ diff --git a/src/ArduinoECCX08Config.h b/src/ArduinoECCX08Config.h new file mode 100644 index 00000000..41edf970 --- /dev/null +++ b/src/ArduinoECCX08Config.h @@ -0,0 +1,27 @@ +/* + This file is part of ArduinoIoTCloud. + + Copyright 2020 ARDUINO SA (http://www.arduino.cc/) + + This software is released under the GNU General Public License version 3, + which covers the main part of arduino-cli. + The terms of this license can be found at: + https://www.gnu.org/licenses/gpl-3.0.en.html + + You can be released from the requirements of the above licenses by purchasing + a commercial license. Buying such a license is mandatory if you want to modify or + otherwise use the software for commercial activities involving the Arduino + software without disclosing the source code of your own applications. To purchase + a commercial license, send an email to license@arduino.cc. +*/ + +#ifndef ARDUINO_ECCX08_CONFIG_H +#define ARDUINO_ECCX08_CONFIG_H + +#define ECCX08_DISABLE_ASN1 +#define ECCX08_DISABLE_CSR +#define ECCX08_DISABLE_JWS +#define ECCX08_DISABLE_SSC +#define ECCX08_DISABLE_PEM + +#endif /* ARDUINO_ECCX08_CONFIG_H */ From c27e49526fa18c787db2b931f0cac72fcea36c84 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Fri, 16 Feb 2024 08:34:52 +0100 Subject: [PATCH 16/21] Configure Dependabot to check for outdated actions used in workflows (#417) Dependabot will periodically check the versions of all actions used in the repository's workflows. If any are found to be outdated, it will submit a pull request to update them. NOTE: Dependabot's PRs will occasionally propose to pin to the patch version of the action (e.g., updating to ). When the action author has provided a major version ref, use that instead (e.g., ). Dependabot will automatically close its PR once the workflow has been updated. More information: https://docs.github.com/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..03b0e93f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# See: https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#about-the-dependabotyml-file +version: 2 + +updates: + # Configure check for outdated GitHub Actions actions in workflows. + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/dependabot/README.md + # See: https://docs.github.com/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot + - package-ecosystem: github-actions + directory: /.github/workflows/ + schedule: + interval: daily + labels: + - "topic: infrastructure" From beaba783ab05fc23660908cf25993033fce87c0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 08:40:13 +0100 Subject: [PATCH 17/21] Bump actions/upload-artifact from 2 to 4 in /.github/workflows (#419) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/compile-examples.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 48e3bbf7..fd135929 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -277,7 +277,7 @@ jobs: - name: Save memory usage change report as artifact if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ env.SKETCHES_REPORTS_PATH }} path: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 3ee6febd..93adc5e9 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -70,7 +70,7 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: path: | *.yaml From 24f601ea0c0187c42ef14c58f3ba84524287a01c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 08:40:34 +0100 Subject: [PATCH 18/21] Bump actions/download-artifact from 2 to 4 in /.github/workflows (#420) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 93adc5e9..781ac624 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -108,7 +108,7 @@ jobs: uses: actions/checkout@v2 - name: Download configuration files artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} From d5e6e70c725cc2d44cdf62d195ece39db6cb60fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 08:41:10 +0100 Subject: [PATCH 19/21] Bump actions/checkout from 2 to 4 in /.github/workflows (#421) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check-arduino.yml | 2 +- .github/workflows/compile-examples.yml | 2 +- .github/workflows/spell-check.yml | 2 +- .github/workflows/sync-labels.yml | 4 ++-- .github/workflows/unit-tests.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml index 15f7c2e7..19bd32de 100644 --- a/.github/workflows/check-arduino.yml +++ b/.github/workflows/check-arduino.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Arduino Lint uses: arduino/arduino-lint-action@v1 diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index fd135929..46cb41c7 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -245,7 +245,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install ESP32 platform dependencies if: matrix.board.type == 'esp32' diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index b96e8e9d..4253ed87 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Spell check uses: codespell-project/actions-codespell@master diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 781ac624..c6688743 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Download JSON schema for labels configuration file id: download-schema @@ -105,7 +105,7 @@ jobs: echo "::set-output name=flag::--dry-run" - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Download configuration files artifact uses: actions/download-artifact@v4 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 2b428374..10d06cf2 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: arduino/cpp-test-action@main with: From 88fd69531eb67166f63e887125e594a4c1eccbd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 08:41:29 +0100 Subject: [PATCH 20/21] Bump geekyeggo/delete-artifact from 1 to 4 in /.github/workflows (#422) Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 1 to 4. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v1...v4) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index c6688743..d9398481 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -114,7 +114,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v1 + uses: geekyeggo/delete-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From dfd03781c109c4bdc2988ce1297e151e022fa340 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Sat, 17 Feb 2024 06:07:06 +0100 Subject: [PATCH 21/21] Fix regression re report-size-deltas after updating actions/upload-artifact. (#423) For more information see https://github.com/arduino/report-size-deltas/blob/main/docs/FAQ.md#size-deltas-report-workflow-triggered-by-schedule-event . --- .github/workflows/compile-examples.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 46cb41c7..46837b40 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -40,38 +40,55 @@ jobs: board: - fqbn: arduino:samd:mkr1000 type: mkr1000 + artifact-name-suffix: arduino-samd-mkr1000 - fqbn: arduino:samd:mkrwifi1010 type: nina + artifact-name-suffix: arduino-samd-mkrwifi1010 - fqbn: arduino:samd:nano_33_iot type: nina + artifact-name-suffix: arduino-samd-nano_33_iot - fqbn: arduino:samd:mkrwan1300 type: wan + artifact-name-suffix: arduino-samd-mkrwan1300 - fqbn: arduino:samd:mkrgsm1400 type: gsm + artifact-name-suffix: arduino-samd-mkrgsm1400 - fqbn: arduino:samd:mkrnb1500 type: nb + artifact-name-suffix: arduino-samd-mkrnb1500 - fqbn: arduino:mbed_portenta:envie_m7 type: mbed_portenta + artifact-name-suffix: arduino-mbed_portenta-envie_m7 - fqbn: esp8266:esp8266:huzzah type: esp8266 + artifact-name-suffix: esp8266-esp8266-huzzah - fqbn: esp32:esp32:esp32 type: esp32 + artifact-name-suffix: esp32-esp32-esp32 - fqbn: arduino:mbed_nano:nanorp2040connect type: nina + artifact-name-suffix: arduino-mbed_nano-nanorp2040connect - fqbn: arduino:mbed_nicla:nicla_vision type: mbed_nicla + artifact-name-suffix: arduino-mbed_nicla-nicla_vision - fqbn: arduino:mbed_opta:opta type: mbed_opta + artifact-name-suffix: arduino-mbed_opta-opta - fqbn: arduino:mbed_giga:giga type: mbed_giga + artifact-name-suffix: arduino-mbed_giga-giga - fqbn: arduino:renesas_portenta:portenta_c33 type: renesas_portenta + artifact-name-suffix: arduino-renesas_portenta-portenta_c33 - fqbn: arduino:renesas_uno:unor4wifi type: renesas_uno + artifact-name-suffix: arduino-renesas_uno-unor4wifi - fqbn: arduino:esp32:nano_nora type: arduino_esp32 + artifact-name-suffix: arduino-esp32-nano_nora - fqbn: arduino:mbed_edge:edge_control type: mbed_edge + artifact-name-suffix: arduino-mbed_edge-edge_control # make board type-specific customizations to the matrix jobs @@ -279,5 +296,5 @@ jobs: if: github.event_name == 'pull_request' uses: actions/upload-artifact@v4 with: - name: ${{ env.SKETCHES_REPORTS_PATH }} + name: sketches-report-${{ matrix.board.artifact-name-suffix }} path: ${{ env.SKETCHES_REPORTS_PATH }}