From a8ff80f40fb22dffaa887911c23ea9e8718030ba Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Wed, 28 Aug 2019 16:23:57 -0700 Subject: [PATCH 01/46] make TX_PAYLOAD_BUFFER_SIZE overridable --- src/MqttClient.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index af93a03..dba8947 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -29,10 +29,12 @@ #endif #endif -#ifdef __AVR__ -#define TX_PAYLOAD_BUFFER_SIZE 128 -#else -#define TX_PAYLOAD_BUFFER_SIZE 256 +#ifndef TX_PAYLOAD_BUFFER_SIZE + #ifdef __AVR__ + #define TX_PAYLOAD_BUFFER_SIZE 128 + #else + #define TX_PAYLOAD_BUFFER_SIZE 256 + #endif #endif #define MQTT_CONNECT 1 From 0527344d37ec4eb3d991eb58549ea2da72bf405d Mon Sep 17 00:00:00 2001 From: Chris Hatton Date: Fri, 10 Apr 2020 22:35:29 +1000 Subject: [PATCH 02/46] Add support for using std::function callbacks instead of C-pointers --- src/MqttClient.cpp | 15 +++++++++++++++ src/MqttClient.h | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index 8e2684e..1bd0eb2 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -97,10 +97,17 @@ MqttClient::~MqttClient() } } +#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK +void MqttClient::onMessage(MqttMessageCallback callback) +{ + _onMessage = callback; +} +#else void MqttClient::onMessage(void(*callback)(int)) { _onMessage = callback; } +#endif int MqttClient::parseMessage() { @@ -550,7 +557,11 @@ void MqttClient::poll() _rxState = MQTT_CLIENT_RX_STATE_READ_PUBLISH_PAYLOAD; if (_onMessage) { +#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK + _onMessage(this,_rxLength); +#else _onMessage(_rxLength); +#endif if (_rxLength == 0) { _rxState = MQTT_CLIENT_RX_STATE_READ_TYPE; @@ -573,7 +584,11 @@ void MqttClient::poll() _rxState = MQTT_CLIENT_RX_STATE_READ_PUBLISH_PAYLOAD; if (_onMessage) { +#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK + _onMessage(this,_rxLength); +#else _onMessage(_rxLength); +#endif } if (_rxLength == 0) { diff --git a/src/MqttClient.h b/src/MqttClient.h index e0e9d63..4382e3b 100644 --- a/src/MqttClient.h +++ b/src/MqttClient.h @@ -32,12 +32,24 @@ #define MQTT_BAD_USER_NAME_OR_PASSWORD 4 #define MQTT_NOT_AUTHORIZED 5 +// Make this definition in your application code to use std::functions for onMessage callbacks instead of C-pointers: +// #define MQTT_CLIENT_STD_FUNCTION_CALLBACK + +#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK +#include +#endif + class MqttClient : public Client { public: MqttClient(Client& client); virtual ~MqttClient(); +#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK + typedef std::function MessageCallback; + void onMessage(MessageCallback callback); +#else void onMessage(void(*)(int)); +#endif int parseMessage(); String messageTopic() const; @@ -128,7 +140,11 @@ class MqttClient : public Client { private: Client* _client; +#ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK + MqttClient::MessageCallback _onMessage; +#else void (*_onMessage)(int); +#endif String _id; String _username; From 9d22ef1a2f9d197cba2fa0873abe97f13f9bdc7c Mon Sep 17 00:00:00 2001 From: Chris Hatton Date: Fri, 10 Apr 2020 22:52:23 +1000 Subject: [PATCH 03/46] Remove some redundancy --- src/MqttClient.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index 1bd0eb2..ff7cf61 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -99,15 +99,12 @@ MqttClient::~MqttClient() #ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK void MqttClient::onMessage(MqttMessageCallback callback) -{ - _onMessage = callback; -} #else void MqttClient::onMessage(void(*callback)(int)) +#endif { _onMessage = callback; } -#endif int MqttClient::parseMessage() { From 0179fcdc5a9f789b3b12b8bd52579bb9f180671c Mon Sep 17 00:00:00 2001 From: Chris Hatton Date: Sat, 11 Apr 2020 00:46:50 +1000 Subject: [PATCH 04/46] Fix compile error & redundant class qualifier. --- src/MqttClient.cpp | 2 +- src/MqttClient.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index ff7cf61..0ab6863 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -98,7 +98,7 @@ MqttClient::~MqttClient() } #ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK -void MqttClient::onMessage(MqttMessageCallback callback) +void MqttClient::onMessage(MessageCallback callback) #else void MqttClient::onMessage(void(*callback)(int)) #endif diff --git a/src/MqttClient.h b/src/MqttClient.h index 4382e3b..27c1787 100644 --- a/src/MqttClient.h +++ b/src/MqttClient.h @@ -141,7 +141,7 @@ class MqttClient : public Client { Client* _client; #ifdef MQTT_CLIENT_STD_FUNCTION_CALLBACK - MqttClient::MessageCallback _onMessage; + MessageCallback _onMessage; #else void (*_onMessage)(int); #endif From 79f512ff77b32767c267c98cb304d04e452fe167 Mon Sep 17 00:00:00 2001 From: Kacp3r3 Date: Tue, 28 Jul 2020 11:51:17 +0200 Subject: [PATCH 05/46] Added function to extend default size of tx_payload_buffer --- src/MqttClient.cpp | 16 +++++++++++----- src/MqttClient.h | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index feef510..fe4703f 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -77,7 +77,8 @@ MqttClient::MqttClient(Client* client) : _willBuffer(NULL), _willBufferIndex(0), _willMessageIndex(0), - _willFlags(0x00) + _willFlags(0x00), + _tx_payload_buffer_size(TX_PAYLOAD_BUFFER_SIZE) { setTimeout(0); } @@ -282,7 +283,7 @@ int MqttClient::beginWill(const String& topic, unsigned short size, bool retain, int MqttClient::beginWill(const char* topic, bool retain, uint8_t qos) { - return beginWill(topic, TX_PAYLOAD_BUFFER_SIZE, retain, qos); + return beginWill(topic, _tx_payload_buffer_size, retain, qos); } int MqttClient::beginWill(const String& topic, bool retain, uint8_t qos) @@ -653,12 +654,12 @@ size_t MqttClient::write(const uint8_t *buf, size_t size) return clientWrite(buf, size); } - if ((_txPayloadBufferIndex + size) >= TX_PAYLOAD_BUFFER_SIZE) { - size = (TX_PAYLOAD_BUFFER_SIZE - _txPayloadBufferIndex); + if ((_txPayloadBufferIndex + size) >= _tx_payload_buffer_size) { + size = (_tx_payload_buffer_size - _txPayloadBufferIndex); } if (_txPayloadBuffer == NULL) { - _txPayloadBuffer = (uint8_t*)malloc(TX_PAYLOAD_BUFFER_SIZE); + _txPayloadBuffer = (uint8_t*)malloc(_tx_payload_buffer_size); } memcpy(&_txPayloadBuffer[_txPayloadBufferIndex], buf, size); @@ -793,6 +794,11 @@ void MqttClient::setConnectionTimeout(unsigned long timeout) _connectionTimeout = timeout; } +void MqttClient::setTxPayloadSize(unsigned short size) +{ + _tx_payload_buffer_size = size; +} + int MqttClient::connectError() const { return _connectError; diff --git a/src/MqttClient.h b/src/MqttClient.h index de19a98..007c4ba 100644 --- a/src/MqttClient.h +++ b/src/MqttClient.h @@ -96,6 +96,7 @@ class MqttClient : public Client { void setKeepAliveInterval(unsigned long interval); void setConnectionTimeout(unsigned long timeout); + void setTxPayloadSize(unsigned short size); int connectError() const; int subscribeQoS() const; @@ -142,6 +143,7 @@ class MqttClient : public Client { unsigned long _keepAliveInterval; unsigned long _connectionTimeout; + unsigned short _tx_payload_buffer_size; int _connectError; bool _connected; From 33a8fb9a5d17601e878cce2de2ab914694eab080 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 11 Apr 2021 05:02:06 -0700 Subject: [PATCH 06/46] Configure Dependabot to check for outdated actions used in workflows 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 sometimes try to pin to the patch version of the action (e.g., updating `uses: foo/bar@v1` to `uses: foo/bar@v2.3.4`). When the action author has provided a major version ref, use that instead (e.g., `uses: foo/bar@v2`). Dependabot will automatically close its PR once the workflow has been updated. More information: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..03600dd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file +version: 2 + +updates: + # Configure check for outdated GitHub Actions actions in workflows. + # See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot + - package-ecosystem: github-actions + directory: / # Check the repository's workflows under /.github/workflows/ + schedule: + interval: daily From 103ae6ffb9c58524f79bfde365d174ea7c9be1b5 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 11 Apr 2021 05:03:12 -0700 Subject: [PATCH 07/46] Update CI workflow to check for commonly misspelled words On every push, pull request, and periodically, use the codespell-project/actions-codespell action to check for commonly misspelled words. In the event of a false positive, the problematic word should be added, in all lowercase, to the ignore-words-list field of ./.codespellrc. Regardless of the case of the word in the false positive, it must be in all lowercase in the ignore list. The ignore list is comma-separated with no spaces. --- .codespellrc | 7 +++++++ .github/workflows/spell-check.yml | 29 ++++++++++++++++++++--------- README.adoc | 6 ++++-- 3 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..101edae --- /dev/null +++ b/.codespellrc @@ -0,0 +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 = , +check-filenames = +check-hidden = +skip = ./.git diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 7b45d77..01bee87 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -1,11 +1,22 @@ name: Spell Check -on: [push, pull_request] + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + pull_request: + schedule: + # Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates. + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - uses: arduino/actions/libraries/spell-check@master + spellcheck: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Spell check + uses: codespell-project/actions-codespell@master diff --git a/README.adoc b/README.adoc index df7b57f..ee2f706 100644 --- a/README.adoc +++ b/README.adoc @@ -1,7 +1,9 @@ -= ArduinoMqttClient Library for Arduino = +:repository-owner: arduino-libraries +:repository-name: ArduinoMqttClient -image:https://github.com/arduino-libraries/ArduinoMqttClient/workflows/Compile%20Examples/badge.svg["Compile Examples Status", link="https://github.com/arduino-libraries/ArduinoMqttClient/actions?workflow=Compile+Examples"] image:https://github.com/arduino-libraries/ArduinoMqttClient/workflows/Spell%20Check/badge.svg["Spell Check Status", link="https://github.com/arduino-libraries/ArduinoMqttClient/actions?workflow=Spell+Check"] += {repository-name} Library for Arduino = +image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"] Allows you to send and receive MQTT messages using Arduino. From 7f43e68e1f01e6201b15282b267b414401f44ede Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 11 Apr 2021 05:17:39 -0700 Subject: [PATCH 08/46] Correct typos in comments and documentation --- .../WiFiAdvancedCallback.ino | 18 +++++++++--------- examples/WiFiEcho/WiFiEcho.ino | 10 +++++----- examples/WiFiEchoCallback/WiFiEchoCallback.ino | 10 +++++----- .../WiFiSimpleReceive/WiFiSimpleReceive.ino | 8 ++++---- .../WiFiSimpleReceiveCallback.ino | 8 ++++---- examples/WiFiSimpleSender/WiFiSimpleSender.ino | 8 ++++---- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino index 87746d0..ecf31ea 100644 --- a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino +++ b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino @@ -3,14 +3,14 @@ This example connects to a MQTT broker and subscribes to a single topic, it also publishes a message to another topic every 10 seconds. - When a message is received it prints the message to the serial monitor, + When a message is received it prints the message to the Serial Monitor, it uses the callback functionality of the library. It also demonstrates how to set the will message, get/set QoS, duplicate and retain values of messages. The circuit: - - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev.2 board + - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev2 board This example code is in the public domain. */ @@ -26,7 +26,7 @@ #include "arduino_secrets.h" ///////please enter your sensitive data in the Secret tab/arduino_secrets.h -char ssid[] = SECRET_SSID; // your network SSID (name) +char ssid[] = SECRET_SSID; // your network SSID (name) char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP) // To connect with SSL/TLS: @@ -56,7 +56,7 @@ void setup() { ; // wait for serial port to connect. Needed for native USB port only } - // attempt to connect to Wifi network: + // attempt to connect to WiFi network: Serial.print("Attempting to connect to WPA SSID: "); Serial.println(ssid); while (WiFi.begin(ssid, pass) != WL_CONNECTED) { @@ -68,7 +68,7 @@ void setup() { Serial.println("You're connected to the network"); Serial.println(); - // You can provide a unique client ID, if not set the library uses Arduin-millis() + // You can provide a unique client ID, if not set the library uses Arduino-millis() // Each client must have a unique client ID // mqttClient.setId("clientId"); @@ -79,8 +79,8 @@ void setup() { // you can disable this behaviour by using // mqttClient.setCleanSession(false); - // set a will message, used by the broker when the connection dies unexpectantly - // you must know the size of the message before hand, and it must be set before connecting + // set a will message, used by the broker when the connection dies unexpectedly + // you must know the size of the message beforehand, and it must be set before connecting String willPayload = "oh no!"; bool willRetain = true; int willQos = 1; @@ -110,7 +110,7 @@ void setup() { Serial.println(); // subscribe to a topic - // the second parameter set's the QoS of the subscription, + // the second parameter sets the QoS of the subscription, // the the library supports subscribing at QoS 0, 1, or 2 int subscribeQos = 1; @@ -129,7 +129,7 @@ void loop() { // send MQTT keep alives which avoids being disconnected by the broker mqttClient.poll(); - // avoid having delays in loop, we'll use the strategy from BlinkWithoutDelay + // to avoid having delays in loop, we'll use the strategy from BlinkWithoutDelay // see: File -> Examples -> 02.Digital -> BlinkWithoutDelay for more info unsigned long currentMillis = millis(); diff --git a/examples/WiFiEcho/WiFiEcho.ino b/examples/WiFiEcho/WiFiEcho.ino index 980dcf3..ad04cd6 100644 --- a/examples/WiFiEcho/WiFiEcho.ino +++ b/examples/WiFiEcho/WiFiEcho.ino @@ -3,10 +3,10 @@ This example connects to a MQTT broker and subscribes to a single topic, it also publishes a message to the same topic once a second. - When a message is received it prints the message to the serial monitor. + When a message is received it prints the message to the Serial Monitor. The circuit: - - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev.2 board + - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev2 board This example code is in the public domain. */ @@ -22,7 +22,7 @@ #include "arduino_secrets.h" ///////please enter your sensitive data in the Secret tab/arduino_secrets.h -char ssid[] = SECRET_SSID; // your network SSID (name) +char ssid[] = SECRET_SSID; // your network SSID (name) char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP) // To connect with SSL/TLS: @@ -51,7 +51,7 @@ void setup() { ; // wait for serial port to connect. Needed for native USB port only } - // attempt to connect to Wifi network: + // attempt to connect to WiFi network: Serial.print("Attempting to connect to WPA SSID: "); Serial.println(ssid); while (WiFi.begin(ssid, pass) != WL_CONNECTED) { @@ -118,7 +118,7 @@ void loop() { Serial.println(); } - // avoid having delays in loop, we'll use the strategy from BlinkWithoutDelay + // to avoid having delays in loop, we'll use the strategy from BlinkWithoutDelay // see: File -> Examples -> 02.Digital -> BlinkWithoutDelay for more info unsigned long currentMillis = millis(); diff --git a/examples/WiFiEchoCallback/WiFiEchoCallback.ino b/examples/WiFiEchoCallback/WiFiEchoCallback.ino index f168a9f..6772fb0 100644 --- a/examples/WiFiEchoCallback/WiFiEchoCallback.ino +++ b/examples/WiFiEchoCallback/WiFiEchoCallback.ino @@ -3,11 +3,11 @@ This example connects to a MQTT broker and subscribes to a single topic, it also publishes a message to the same topic once a second. - When a message is received it prints the message to the serial monitor, + When a message is received it prints the message to the Serial Monitor, it uses the callback functionality of the library. The circuit: - - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev.2 board + - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev2 board This example code is in the public domain. */ @@ -23,7 +23,7 @@ #include "arduino_secrets.h" ///////please enter your sensitive data in the Secret tab/arduino_secrets.h -char ssid[] = SECRET_SSID; // your network SSID (name) +char ssid[] = SECRET_SSID; // your network SSID (name) char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP) // To connect with SSL/TLS: @@ -51,7 +51,7 @@ void setup() { ; // wait for serial port to connect. Needed for native USB port only } - // attempt to connect to Wifi network: + // attempt to connect to WiFi network: Serial.print("Attempting to connect to WPA SSID: "); Serial.println(ssid); while (WiFi.begin(ssid, pass) != WL_CONNECTED) { @@ -106,7 +106,7 @@ void loop() { // send MQTT keep alives which avoids being disconnected by the broker mqttClient.poll(); - // avoid having delays in loop, we'll use the strategy from BlinkWithoutDelay + // to avoid having delays in loop, we'll use the strategy from BlinkWithoutDelay // see: File -> Examples -> 02.Digital -> BlinkWithoutDelay for more info unsigned long currentMillis = millis(); diff --git a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino index 88df6e7..b3cde83 100644 --- a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino +++ b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino @@ -2,10 +2,10 @@ ArduinoMqttClient - WiFi Simple Receive This example connects to a MQTT broker and subscribes to a single topic. - When a message is received it prints the message to the serial monitor. + When a message is received it prints the message to the Serial Monitor. The circuit: - - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev.2 board + - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev2 board This example code is in the public domain. */ @@ -21,7 +21,7 @@ #include "arduino_secrets.h" ///////please enter your sensitive data in the Secret tab/arduino_secrets.h -char ssid[] = SECRET_SSID; // your network SSID (name) +char ssid[] = SECRET_SSID; // your network SSID (name) char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP) // To connect with SSL/TLS: @@ -44,7 +44,7 @@ void setup() { ; // wait for serial port to connect. Needed for native USB port only } - // attempt to connect to Wifi network: + // attempt to connect to WiFi network: Serial.print("Attempting to connect to WPA SSID: "); Serial.println(ssid); while (WiFi.begin(ssid, pass) != WL_CONNECTED) { diff --git a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino index 3e1bd09..315adda 100644 --- a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino +++ b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino @@ -2,11 +2,11 @@ ArduinoMqttClient - WiFi Simple Receive Callback This example connects to a MQTT broker and subscribes to a single topic. - When a message is received it prints the message to the serial monitor, + When a message is received it prints the message to the Serial Monitor, it uses the callback functionality of the library. The circuit: - - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev.2 board + - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev2 board This example code is in the public domain. */ @@ -22,7 +22,7 @@ #include "arduino_secrets.h" ///////please enter your sensitive data in the Secret tab/arduino_secrets.h -char ssid[] = SECRET_SSID; // your network SSID (name) +char ssid[] = SECRET_SSID; // your network SSID (name) char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP) // To connect with SSL/TLS: @@ -45,7 +45,7 @@ void setup() { ; // wait for serial port to connect. Needed for native USB port only } - // attempt to connect to Wifi network: + // attempt to connect to WiFi network: Serial.print("Attempting to connect to WPA SSID: "); Serial.println(ssid); while (WiFi.begin(ssid, pass) != WL_CONNECTED) { diff --git a/examples/WiFiSimpleSender/WiFiSimpleSender.ino b/examples/WiFiSimpleSender/WiFiSimpleSender.ino index 33ce01d..f2d3567 100644 --- a/examples/WiFiSimpleSender/WiFiSimpleSender.ino +++ b/examples/WiFiSimpleSender/WiFiSimpleSender.ino @@ -5,7 +5,7 @@ a topic once a second. The circuit: - - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev.2 board + - Arduino MKR 1000, MKR 1010 or Uno WiFi Rev2 board This example code is in the public domain. */ @@ -21,7 +21,7 @@ #include "arduino_secrets.h" ///////please enter your sensitive data in the Secret tab/arduino_secrets.h -char ssid[] = SECRET_SSID; // your network SSID (name) +char ssid[] = SECRET_SSID; // your network SSID (name) char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP) // To connect with SSL/TLS: @@ -49,7 +49,7 @@ void setup() { ; // wait for serial port to connect. Needed for native USB port only } - // attempt to connect to Wifi network: + // attempt to connect to WiFi network: Serial.print("Attempting to connect to WPA SSID: "); Serial.println(ssid); while (WiFi.begin(ssid, pass) != WL_CONNECTED) { @@ -87,7 +87,7 @@ void loop() { // avoids being disconnected by the broker mqttClient.poll(); - // avoid having delays in loop, we'll use the strategy from BlinkWithoutDelay + // to avoid having delays in loop, we'll use the strategy from BlinkWithoutDelay // see: File -> Examples -> 02.Digital -> BlinkWithoutDelay for more info unsigned long currentMillis = millis(); From 69fc1d9d0511e1f02de6567814ba68444f6eae54 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 11 Apr 2021 05:18:05 -0700 Subject: [PATCH 09/46] Add CI workflow to do Arduino project-specific linting On every push, pull request, and periodically, run Arduino Lint to check for common problems not related to the project code. --- .github/workflows/check-arduino.yml | 28 ++++++++++++++++++++++++++++ README.adoc | 1 + 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/check-arduino.yml diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml new file mode 100644 index 0000000..0d969f6 --- /dev/null +++ b/.github/workflows/check-arduino.yml @@ -0,0 +1,28 @@ +name: Check Arduino + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + pull_request: + schedule: + # Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint. + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Arduino Lint + uses: arduino/arduino-lint-action@v1 + with: + compliance: specification + library-manager: update + # Always use this setting for official repositories. Remove for 3rd party projects. + official: true + project-type: library diff --git a/README.adoc b/README.adoc index ee2f706..153d99f 100644 --- a/README.adoc +++ b/README.adoc @@ -3,6 +3,7 @@ = {repository-name} Library for Arduino = +image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml/badge.svg["Check Arduino status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml"] image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"] Allows you to send and receive MQTT messages using Arduino. From ae6da13030870e8962f9a43b7181c76918f73890 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 11 Apr 2021 05:19:10 -0700 Subject: [PATCH 10/46] Add license file This defines the license in a standardized place, which allows GitHub's automated license detection system to detect the license type: https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository#detecting-a-license This is the exact license text provided by choosealicense.com This text should not be modified in any way. Doing so may interfere with GitHub's license detection or even the licence's function as a legal instrument. --- LICENSE.txt | 504 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.adoc | 18 -- 2 files changed, 504 insertions(+), 18 deletions(-) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..8000a6f --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random + Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/README.adoc b/README.adoc index 153d99f..678caf8 100644 --- a/README.adoc +++ b/README.adoc @@ -7,21 +7,3 @@ image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/ image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"] Allows you to send and receive MQTT messages using Arduino. - -== License == - -Copyright (c) 2019 Arduino SA. All rights reserved. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA From 8362a5a33b624669313027b8ff2f95e1bd72e503 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 11 Apr 2021 05:19:39 -0700 Subject: [PATCH 11/46] Update "smoke test" examples compilation CI workflow On every push or pull request that affects library source or example files, and periodically, compile all example sketches for the specified boards. --- .github/workflows/compile-examples.yml | 92 +++++++++++++++++++------- README.adoc | 1 + 2 files changed, 70 insertions(+), 23 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 11d8047..43c3850 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -1,27 +1,73 @@ name: Compile Examples -on: [push, pull_request] + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/compile-examples.yml" + - "examples/**" + - "src/**" + pull_request: + paths: + - ".github/workflows/compile-examples.yml" + - "examples/**" + - "src/**" + schedule: + # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms). + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + jobs: - build: - runs-on: ubuntu-latest - env: - LIBRARIES: WiFi101 WiFiNINA + build: + name: ${{ matrix.board.fqbn }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + board: + - fqbn: arduino:megaavr:uno2018 + platforms: | + - name: arduino:megaavr + libraries: | + - name: WiFiNINA + - fqbn: arduino:samd:mkrwifi1010 + platforms: | + - name: arduino:samd + libraries: | + - name: WiFiNINA + - fqbn: arduino:samd:mkr1000 + platforms: | + - name: arduino:samd + libraries: | + - name: WiFi101 + - fqbn: arduino:samd:nano_33_iot + platforms: | + - name: arduino:samd + libraries: | + - name: WiFiNINA + - fqbn: esp8266:esp8266:huzzah + platforms: | + - name: esp8266:esp8266 + source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json + libraries: "" + + steps: + - name: Checkout repository + uses: actions/checkout@v2 - strategy: - matrix: - fqbn: [ - "arduino:samd:mkr1000", - "arduino:samd:mkrwifi1010", - "arduino:samd:nano_33_iot", - "arduino:megaavr:uno2018", - '"esp8266:esp8266:huzzah" "https://arduino.esp8266.com/stable/package_esp8266com_index.json"' - ] + - name: Compile examples + uses: arduino/compile-sketches@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + fqbn: ${{ matrix.board.fqbn }} + platforms: ${{ matrix.board.platforms }} + libraries: | + # Install the library from the local path. + - source-path: ./ + ${{ matrix.board.libraries }} + sketch-paths: | + - examples - steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - name: compile-examples for official Arduino boards - uses: arduino/actions/libraries/compile-examples@master - with: - fqbn: ${{ matrix.fqbn }} - libraries: ${{ env.LIBRARIES }} diff --git a/README.adoc b/README.adoc index 678caf8..050baca 100644 --- a/README.adoc +++ b/README.adoc @@ -4,6 +4,7 @@ = {repository-name} Library for Arduino = image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml/badge.svg["Check Arduino status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml"] +image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml/badge.svg["Compile Examples status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml"] image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"] Allows you to send and receive MQTT messages using Arduino. From 5da580c46a8cf2fa9a44f366e6e21d173659ac6b Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 11 Apr 2021 05:19:53 -0700 Subject: [PATCH 12/46] Report changes in memory usage that would result from merging a PR On creation or commit to a pull request, a report of the resulting change in memory usage of the examples will be commented to the PR thread. --- .github/workflows/compile-examples.yml | 11 +++++++++++ .github/workflows/report-size-deltas.yml | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 43c3850..1b0a4ec 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -23,6 +23,9 @@ jobs: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest + env: + SKETCHES_REPORTS_PATH: sketches-reports + strategy: fail-fast: false @@ -70,4 +73,12 @@ jobs: ${{ matrix.board.libraries }} sketch-paths: | - examples + enable-deltas-report: true + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} + - name: Save sketches report as workflow artifact + uses: actions/upload-artifact@v2 + with: + if-no-files-found: error + path: ${{ env.SKETCHES_REPORTS_PATH }} + name: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..652be5d --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,24 @@ +name: Report Size Deltas + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/report-size-deltas.yml" + schedule: + # Run at the minimum interval allowed by GitHub Actions. + # Note: GitHub Actions periodically has outages which result in workflow failures. + # In this event, the workflows will start passing again once the service recovers. + - cron: "*/5 * * * *" + workflow_dispatch: + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@v1 + with: + # The name of the workflow artifact created by the sketch compilation workflow + sketches-reports-source: sketches-reports From db0c4a68fc356343b39009b26f146b6cc046736c Mon Sep 17 00:00:00 2001 From: Thomas Baust Date: Sun, 5 Dec 2021 12:27:29 +0100 Subject: [PATCH 13/46] small compiler fix --- src/MqttClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index c611968..e6e87bc 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -69,6 +69,7 @@ MqttClient::MqttClient(Client* client) : _cleanSession(true), _keepAliveInterval(60 * 1000L), _connectionTimeout(30 * 1000L), + _tx_payload_buffer_size(TX_PAYLOAD_BUFFER_SIZE), _connectError(MQTT_SUCCESS), _connected(false), _subscribeQos(0x00), @@ -79,8 +80,7 @@ MqttClient::MqttClient(Client* client) : _willBuffer(NULL), _willBufferIndex(0), _willMessageIndex(0), - _willFlags(0x00), - _tx_payload_buffer_size(TX_PAYLOAD_BUFFER_SIZE) + _willFlags(0x00) { setTimeout(0); } From 30165fbce7e148a1d3f0cbfea850bdf9d970eb14 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 15 Dec 2021 10:46:49 +0100 Subject: [PATCH 14/46] Adding sync-labels workflow for sharing one set of labels across all repos. (#59) --- .github/workflows/sync-labels.yml | 138 ++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 .github/workflows/sync-labels.yml diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 0000000..fe53570 --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -0,0 +1,138 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md +name: Sync Labels + +# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/sync-labels.ya?ml" + - ".github/label-configuration-files/*.ya?ml" + pull_request: + paths: + - ".github/workflows/sync-labels.ya?ml" + - ".github/label-configuration-files/*.ya?ml" + schedule: + # Run daily at 8 AM UTC to sync with changes to shared label configurations. + - cron: "0 8 * * *" + workflow_dispatch: + repository_dispatch: + +env: + CONFIGURATIONS_FOLDER: .github/label-configuration-files + CONFIGURATIONS_ARTIFACT: label-configuration-files + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Download JSON schema for labels configuration file + id: download-schema + uses: carlosperate/download-file-action@v1.0.3 + with: + file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json + location: ${{ runner.temp }}/label-configuration-schema + + - name: Install JSON schema validator + run: | + sudo npm install \ + --global \ + ajv-cli \ + ajv-formats + + - name: Validate local labels configuration + run: | + # See: https://github.com/ajv-validator/ajv-cli#readme + ajv validate \ + --all-errors \ + -c ajv-formats \ + -s "${{ steps.download-schema.outputs.file-path }}" \ + -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}" + + download: + needs: check + runs-on: ubuntu-latest + + strategy: + matrix: + filename: + # Filenames of the shared configurations to apply to the repository in addition to the local configuration. + # https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels + - universal.yml + + steps: + - name: Download + uses: carlosperate/download-file-action@v1.0.3 + with: + 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 + with: + path: | + *.yaml + *.yml + if-no-files-found: error + name: ${{ env.CONFIGURATIONS_ARTIFACT }} + + sync: + needs: download + runs-on: ubuntu-latest + + steps: + - name: Set environment variables + run: | + # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable + echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV" + + - name: Determine whether to dry run + id: dry-run + if: > + github.event_name == 'pull_request' || + ( + ( + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' + ) && + github.ref != format('refs/heads/{0}', github.event.repository.default_branch) + ) + run: | + # Use of this flag in the github-label-sync command will cause it to only check the validity of the + # configuration. + echo "::set-output name=flag::--dry-run" + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Download configuration files artifact + uses: actions/download-artifact@v2 + with: + name: ${{ env.CONFIGURATIONS_ARTIFACT }} + path: ${{ env.CONFIGURATIONS_FOLDER }} + + - name: Remove unneeded artifact + uses: geekyeggo/delete-artifact@v1 + with: + name: ${{ env.CONFIGURATIONS_ARTIFACT }} + + - name: Merge label configuration files + run: | + # Merge all configuration files + shopt -s extglob + cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}" + + - name: Install github-label-sync + run: sudo npm install --global github-label-sync + + - name: Sync labels + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # See: https://github.com/Financial-Times/github-label-sync + github-label-sync \ + --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \ + ${{ steps.dry-run.outputs.flag }} \ + ${{ github.repository }} From b7195a9947dcb9e4851e4c3859874ee99955b376 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 20 Dec 2021 05:06:53 -0800 Subject: [PATCH 15/46] Use major version ref of `carlosperate/download-file-action` (#61) The `carlosperate/download-file-action` action is used in the GitHub Actions workflows as a convenient way to download external resources. A major version ref has been added to that repository. It will always point to the latest release of the "1" major version series. This means it is no longer necessary to do a full pin of the action version in use as before. Use of the major version ref will cause the workflow to use a stable version of the action, while also benefiting from ongoing development to the action up until such time as a new major release of an action is made. At that time we would need to evaluate whether any changes to the workflow are required by the breaking change that triggered the major release before manually updating the major ref (e.g., uses: `carlosperate/download-file-action@v2`). I think this approach strikes the right balance between stability and maintainability for these workflows. --- .github/workflows/sync-labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index fe53570..3ee6feb 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -31,7 +31,7 @@ jobs: - name: Download JSON schema for labels configuration file id: download-schema - uses: carlosperate/download-file-action@v1.0.3 + uses: carlosperate/download-file-action@v1 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json location: ${{ runner.temp }}/label-configuration-schema @@ -65,7 +65,7 @@ jobs: steps: - name: Download - uses: carlosperate/download-file-action@v1.0.3 + uses: carlosperate/download-file-action@v1 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} From c0365f80b5646f23946181b046f373cd4ef81956 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 22:27:07 +0000 Subject: [PATCH 16/46] Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [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...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-arduino.yml | 2 +- .github/workflows/compile-examples.yml | 2 +- .github/workflows/spell-check.yml | 2 +- .github/workflows/sync-labels.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml index 0d969f6..3e0d26c 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@v3 - name: Arduino Lint uses: arduino/arduino-lint-action@v1 diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 1b0a4ec..b45a0ac 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -59,7 +59,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Compile examples uses: arduino/compile-sketches@v1 diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 01bee87..3f6b03f 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Spell check uses: codespell-project/actions-codespell@master diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 3ee6feb..4ea5755 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@v3 - 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@v3 - name: Download configuration files artifact uses: actions/download-artifact@v2 From 4f66c4d7436d875dac8c50f30fd30594b4543596 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Apr 2022 22:16:11 +0000 Subject: [PATCH 17/46] Bump actions/upload-artifact from 2 to 3 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .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 b45a0ac..dee1d4a 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -77,7 +77,7 @@ jobs: sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} - name: Save sketches report as workflow artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: if-no-files-found: error path: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 4ea5755..1d969d5 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@v3 with: path: | *.yaml From 6fa8b2f49da59f3b18b7888467d6f2b3d05fbabd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Apr 2022 22:16:13 +0000 Subject: [PATCH 18/46] Bump actions/download-artifact from 2 to 3 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .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 4ea5755..e84e803 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -108,7 +108,7 @@ jobs: uses: actions/checkout@v3 - name: Download configuration files artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} From a7e69d8f9fb0cbd9db21369886b20ded4c2fc1a6 Mon Sep 17 00:00:00 2001 From: Michael Ammann Date: Sun, 10 Apr 2022 23:16:28 +0200 Subject: [PATCH 19/46] Update MqttClient.cpp --- src/MqttClient.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index e6e87bc..f04fdd2 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -230,6 +230,7 @@ int MqttClient::endMessage() return 0; } } + yield(); } // reply with PUBREL @@ -245,6 +246,7 @@ int MqttClient::endMessage() if (_returnCode != -1) { return (_returnCode == 0); } + yield(); } return 0; @@ -348,6 +350,7 @@ int MqttClient::subscribe(const char* topic, uint8_t qos) return (_returnCode >= 0 && _returnCode <= 2); } + yield(); } stop(); @@ -391,6 +394,7 @@ int MqttClient::unsubscribe(const char* topic) if (_returnCode != -1) { return (_returnCode == 0); } + yield(); } stop(); @@ -919,6 +923,7 @@ int MqttClient::connect(IPAddress ip, const char* host, uint16_t port) if (_returnCode != MQTT_CONNECTION_TIMEOUT) { break; } + yield(); } _connectError = _returnCode; From 11a8d5e3921052f248fc771fd787fc480cd8fcdb Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 6 Jul 2022 08:31:25 +0200 Subject: [PATCH 20/46] Fix buffer overflow introduced in #44. (#71) PR #44 introduced a buffer overflow bug that will corrupt the heap if the transmit payload size is increased after any send. Co-authored-by: Dr. Fred Nugen --- src/MqttClient.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index f04fdd2..146e38f 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -802,6 +802,12 @@ void MqttClient::setConnectionTimeout(unsigned long timeout) void MqttClient::setTxPayloadSize(unsigned short size) { + if (_txPayloadBuffer) { + free(_txPayloadBuffer); + _txPayloadBuffer = NULL; + _txPayloadBufferIndex = 0; + } + _tx_payload_buffer_size = size; } From 0fe67a4e00c1321ab016d836bf401e698744c6be Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 8 Jul 2022 10:34:08 +0200 Subject: [PATCH 21/46] Fix gcc reorder warning --- src/MqttClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index c611968..e6e87bc 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -69,6 +69,7 @@ MqttClient::MqttClient(Client* client) : _cleanSession(true), _keepAliveInterval(60 * 1000L), _connectionTimeout(30 * 1000L), + _tx_payload_buffer_size(TX_PAYLOAD_BUFFER_SIZE), _connectError(MQTT_SUCCESS), _connected(false), _subscribeQos(0x00), @@ -79,8 +80,7 @@ MqttClient::MqttClient(Client* client) : _willBuffer(NULL), _willBufferIndex(0), _willMessageIndex(0), - _willFlags(0x00), - _tx_payload_buffer_size(TX_PAYLOAD_BUFFER_SIZE) + _willFlags(0x00) { setTimeout(0); } From a6ba6019aeba059017a08f01b35a3020e730408d Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 8 Jul 2022 10:48:53 +0200 Subject: [PATCH 22/46] Add esp32 platform to compile examples github workflow --- .github/workflows/compile-examples.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 1b0a4ec..a5c552e 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -56,6 +56,11 @@ jobs: - name: esp8266:esp8266 source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json libraries: "" + - fqbn: "esp32:esp32:esp32" + platforms: | + - name: esp32:esp32 + source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json + libraries: "" steps: - name: Checkout repository From 30ec7e97ab6f06842d32e4fda9a912efce8a7abc Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 8 Jul 2022 11:15:07 +0200 Subject: [PATCH 23/46] Add esp32 WiFi.h include --- examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino | 2 ++ examples/WiFiEcho/WiFiEcho.ino | 2 ++ examples/WiFiEchoCallback/WiFiEchoCallback.ino | 2 ++ examples/WiFiSimpleReceive/WiFiSimpleReceive.ino | 2 ++ .../WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino | 2 ++ examples/WiFiSimpleSender/WiFiSimpleSender.ino | 2 ++ 6 files changed, 12 insertions(+) diff --git a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino index ecf31ea..b9ec885 100644 --- a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino +++ b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino @@ -22,6 +22,8 @@ #include #elif defined(ARDUINO_ESP8266_ESP12) #include +#elif defined(ARDUINO_ARCH_ESP32) + #include #endif #include "arduino_secrets.h" diff --git a/examples/WiFiEcho/WiFiEcho.ino b/examples/WiFiEcho/WiFiEcho.ino index ad04cd6..209f853 100644 --- a/examples/WiFiEcho/WiFiEcho.ino +++ b/examples/WiFiEcho/WiFiEcho.ino @@ -18,6 +18,8 @@ #include #elif defined(ARDUINO_ESP8266_ESP12) #include +#elif defined(ARDUINO_ARCH_ESP32) + #include #endif #include "arduino_secrets.h" diff --git a/examples/WiFiEchoCallback/WiFiEchoCallback.ino b/examples/WiFiEchoCallback/WiFiEchoCallback.ino index 6772fb0..a6fc7cc 100644 --- a/examples/WiFiEchoCallback/WiFiEchoCallback.ino +++ b/examples/WiFiEchoCallback/WiFiEchoCallback.ino @@ -19,6 +19,8 @@ #include #elif defined(ARDUINO_ESP8266_ESP12) #include +#elif defined(ARDUINO_ARCH_ESP32) + #include #endif #include "arduino_secrets.h" diff --git a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino index b3cde83..201bb24 100644 --- a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino +++ b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino @@ -17,6 +17,8 @@ #include #elif defined(ARDUINO_ESP8266_ESP12) #include +#elif defined(ARDUINO_ARCH_ESP32) + #include #endif #include "arduino_secrets.h" diff --git a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino index 315adda..1a68cdf 100644 --- a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino +++ b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino @@ -18,6 +18,8 @@ #include #elif defined(ARDUINO_ESP8266_ESP12) #include +#elif defined(ARDUINO_ARCH_ESP32) + #include #endif #include "arduino_secrets.h" diff --git a/examples/WiFiSimpleSender/WiFiSimpleSender.ino b/examples/WiFiSimpleSender/WiFiSimpleSender.ino index f2d3567..7750411 100644 --- a/examples/WiFiSimpleSender/WiFiSimpleSender.ino +++ b/examples/WiFiSimpleSender/WiFiSimpleSender.ino @@ -17,6 +17,8 @@ #include #elif defined(ARDUINO_ESP8266_ESP12) #include +#elif defined(ARDUINO_ARCH_ESP32) + #include #endif #include "arduino_secrets.h" From ed72c9211911bfca195ded2ce1e05a752c2c6852 Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 8 Jul 2022 12:30:00 +0200 Subject: [PATCH 24/46] Extend example support to generic ARDUINO_ARCH_ESP8266 --- examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino | 2 +- examples/WiFiEcho/WiFiEcho.ino | 2 +- examples/WiFiEchoCallback/WiFiEchoCallback.ino | 2 +- examples/WiFiSimpleReceive/WiFiSimpleReceive.ino | 2 +- .../WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino | 2 +- examples/WiFiSimpleSender/WiFiSimpleSender.ino | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino index ecf31ea..a331022 100644 --- a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino +++ b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino @@ -20,7 +20,7 @@ #include #elif defined(ARDUINO_SAMD_MKR1000) #include -#elif defined(ARDUINO_ESP8266_ESP12) +#elif defined(ARDUINO_ARCH_ESP8266) #include #endif diff --git a/examples/WiFiEcho/WiFiEcho.ino b/examples/WiFiEcho/WiFiEcho.ino index ad04cd6..cfd35c0 100644 --- a/examples/WiFiEcho/WiFiEcho.ino +++ b/examples/WiFiEcho/WiFiEcho.ino @@ -16,7 +16,7 @@ #include #elif defined(ARDUINO_SAMD_MKR1000) #include -#elif defined(ARDUINO_ESP8266_ESP12) +#elif defined(ARDUINO_ARCH_ESP8266) #include #endif diff --git a/examples/WiFiEchoCallback/WiFiEchoCallback.ino b/examples/WiFiEchoCallback/WiFiEchoCallback.ino index 6772fb0..99fcdde 100644 --- a/examples/WiFiEchoCallback/WiFiEchoCallback.ino +++ b/examples/WiFiEchoCallback/WiFiEchoCallback.ino @@ -17,7 +17,7 @@ #include #elif defined(ARDUINO_SAMD_MKR1000) #include -#elif defined(ARDUINO_ESP8266_ESP12) +#elif defined(ARDUINO_ARCH_ESP8266) #include #endif diff --git a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino index b3cde83..e12805c 100644 --- a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino +++ b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino @@ -15,7 +15,7 @@ #include #elif defined(ARDUINO_SAMD_MKR1000) #include -#elif defined(ARDUINO_ESP8266_ESP12) +#elif defined(ARDUINO_ARCH_ESP8266) #include #endif diff --git a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino index 315adda..3f47d88 100644 --- a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino +++ b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino @@ -16,7 +16,7 @@ #include #elif defined(ARDUINO_SAMD_MKR1000) #include -#elif defined(ARDUINO_ESP8266_ESP12) +#elif defined(ARDUINO_ARCH_ESP8266) #include #endif diff --git a/examples/WiFiSimpleSender/WiFiSimpleSender.ino b/examples/WiFiSimpleSender/WiFiSimpleSender.ino index f2d3567..8163421 100644 --- a/examples/WiFiSimpleSender/WiFiSimpleSender.ino +++ b/examples/WiFiSimpleSender/WiFiSimpleSender.ino @@ -15,7 +15,7 @@ #include #elif defined(ARDUINO_SAMD_MKR1000) #include -#elif defined(ARDUINO_ESP8266_ESP12) +#elif defined(ARDUINO_ARCH_ESP8266) #include #endif From f97f49ba99f7d85a0b9ef5d6e3f04d1a20e8e72c Mon Sep 17 00:00:00 2001 From: Mattia Pennasilico Date: Thu, 21 Jul 2022 13:09:15 +0200 Subject: [PATCH 25/46] Version 0.1.6 --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 5a44ad9..79e24de 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ArduinoMqttClient -version=0.1.5 +version=0.1.6 author=Arduino maintainer=Arduino sentence=[BETA] Allows you to send and receive MQTT messages using Arduino. From c04fc705326d37f9ee827abeb85fe755462f3541 Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 22 Jul 2022 14:34:19 +0200 Subject: [PATCH 26/46] Add Portenta H7 and Nicla Vision boards to compile examples workflow --- .github/workflows/compile-examples.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index fdd0de7..641866a 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -51,6 +51,14 @@ jobs: - name: arduino:samd libraries: | - name: WiFiNINA + - fqbn: arduino:mbed:envie_m7 + platforms: | + - name: arduino:mbed + libraries: "" + - fqbn: arduino:mbed_nicla:nicla_vision + platforms: | + - name: arduino:mbed_nicla + libraries: "" - fqbn: esp8266:esp8266:huzzah platforms: | - name: esp8266:esp8266 From 52a7393a0d2bb2768d7735a46afbfb3c2c63126a Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 22 Jul 2022 14:46:45 +0200 Subject: [PATCH 27/46] Fix examples to build correctly for PORTENTA_H7_M7 and NICLA_VISION --- examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino | 2 +- examples/WiFiEcho/WiFiEcho.ino | 2 +- examples/WiFiEchoCallback/WiFiEchoCallback.ino | 2 +- examples/WiFiSimpleReceive/WiFiSimpleReceive.ino | 2 +- .../WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino | 2 +- examples/WiFiSimpleSender/WiFiSimpleSender.ino | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino index c4bec66..3aed2c6 100644 --- a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino +++ b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino @@ -22,7 +22,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) #include #endif diff --git a/examples/WiFiEcho/WiFiEcho.ino b/examples/WiFiEcho/WiFiEcho.ino index 53ad4e3..840f088 100644 --- a/examples/WiFiEcho/WiFiEcho.ino +++ b/examples/WiFiEcho/WiFiEcho.ino @@ -18,7 +18,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) #include #endif diff --git a/examples/WiFiEchoCallback/WiFiEchoCallback.ino b/examples/WiFiEchoCallback/WiFiEchoCallback.ino index ef17c54..8438be3 100644 --- a/examples/WiFiEchoCallback/WiFiEchoCallback.ino +++ b/examples/WiFiEchoCallback/WiFiEchoCallback.ino @@ -19,7 +19,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) #include #endif diff --git a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino index 753989b..4cb406a 100644 --- a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino +++ b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino @@ -17,7 +17,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) #include #endif diff --git a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino index 4dc4b96..77a4d93 100644 --- a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino +++ b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino @@ -18,7 +18,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) #include #endif diff --git a/examples/WiFiSimpleSender/WiFiSimpleSender.ino b/examples/WiFiSimpleSender/WiFiSimpleSender.ino index b7f94bd..2513609 100644 --- a/examples/WiFiSimpleSender/WiFiSimpleSender.ino +++ b/examples/WiFiSimpleSender/WiFiSimpleSender.ino @@ -17,7 +17,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) #include #endif From d0d99ee1a9b04d77186562e439eccb7d6dbc6bcb Mon Sep 17 00:00:00 2001 From: Mattia Pennasilico Date: Mon, 8 Aug 2022 09:10:50 +0200 Subject: [PATCH 28/46] Use mbed_portenta platform Co-authored-by: per1234 --- .github/workflows/compile-examples.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 641866a..1b3a6ca 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -51,9 +51,9 @@ jobs: - name: arduino:samd libraries: | - name: WiFiNINA - - fqbn: arduino:mbed:envie_m7 + - fqbn: arduino:mbed_portenta:envie_m7 platforms: | - - name: arduino:mbed + - name: arduino:mbed_portenta libraries: "" - fqbn: arduino:mbed_nicla:nicla_vision platforms: | From bc3675c4a3ee07e1a81fb7249c5e7ae5a6501c12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 22:11:28 +0000 Subject: [PATCH 29/46] Bump geekyeggo/delete-artifact from 1 to 2 Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 1 to 2. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v1...v2) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .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 986bda6..10abaea 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@v2 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From 63ba82983b8c1f01e410f9b83c1100ea30202e67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 22:11:33 +0000 Subject: [PATCH 30/46] Bump carlosperate/download-file-action from 1 to 2 Bumps [carlosperate/download-file-action](https://github.com/carlosperate/download-file-action) from 1 to 2. - [Release notes](https://github.com/carlosperate/download-file-action/releases) - [Commits](https://github.com/carlosperate/download-file-action/compare/v1...v2) --- updated-dependencies: - dependency-name: carlosperate/download-file-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 10abaea..94938f3 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -31,7 +31,7 @@ jobs: - name: Download JSON schema for labels configuration file id: download-schema - uses: carlosperate/download-file-action@v1 + uses: carlosperate/download-file-action@v2 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json location: ${{ runner.temp }}/label-configuration-schema @@ -65,7 +65,7 @@ jobs: steps: - name: Download - uses: carlosperate/download-file-action@v1 + uses: carlosperate/download-file-action@v2 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} From ad35618f15aa8d74307a340b06f4b9002dfdabbf Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 27 Mar 2023 06:12:31 +0200 Subject: [PATCH 31/46] CI: Add Arduino Giga as CI build target. --- .github/workflows/compile-examples.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 1b3a6ca..c1bfe9b 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -59,6 +59,9 @@ jobs: platforms: | - name: arduino:mbed_nicla libraries: "" + - fqbn: arduino:mbed_giga:giga + platforms: | + - name: arduino:mbed_giga - fqbn: esp8266:esp8266:huzzah platforms: | - name: esp8266:esp8266 From d783a2f36317386ade6dd8dab56365bedc63ff00 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 27 Mar 2023 06:20:47 +0200 Subject: [PATCH 32/46] Add missing #define in order to select correct WiFi library. --- examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino | 2 +- examples/WiFiEcho/WiFiEcho.ino | 2 +- examples/WiFiEchoCallback/WiFiEchoCallback.ino | 2 +- examples/WiFiSimpleReceive/WiFiSimpleReceive.ino | 2 +- .../WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino | 2 +- examples/WiFiSimpleSender/WiFiSimpleSender.ino | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino index 3aed2c6..5cf2b58 100644 --- a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino +++ b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino @@ -22,7 +22,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) #include #endif diff --git a/examples/WiFiEcho/WiFiEcho.ino b/examples/WiFiEcho/WiFiEcho.ino index 840f088..e5e47ee 100644 --- a/examples/WiFiEcho/WiFiEcho.ino +++ b/examples/WiFiEcho/WiFiEcho.ino @@ -18,7 +18,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) #include #endif diff --git a/examples/WiFiEchoCallback/WiFiEchoCallback.ino b/examples/WiFiEchoCallback/WiFiEchoCallback.ino index 8438be3..7f1afa9 100644 --- a/examples/WiFiEchoCallback/WiFiEchoCallback.ino +++ b/examples/WiFiEchoCallback/WiFiEchoCallback.ino @@ -19,7 +19,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) #include #endif diff --git a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino index 4cb406a..6af92a3 100644 --- a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino +++ b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino @@ -17,7 +17,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) #include #endif diff --git a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino index 77a4d93..5f6c47a 100644 --- a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino +++ b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino @@ -18,7 +18,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) #include #endif diff --git a/examples/WiFiSimpleSender/WiFiSimpleSender.ino b/examples/WiFiSimpleSender/WiFiSimpleSender.ino index 2513609..236a6e8 100644 --- a/examples/WiFiSimpleSender/WiFiSimpleSender.ino +++ b/examples/WiFiSimpleSender/WiFiSimpleSender.ino @@ -17,7 +17,7 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) #include #endif From 03d2faff0520f34a0734e2e7a5588f68bccd1fc5 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 27 Mar 2023 06:49:58 +0200 Subject: [PATCH 33/46] Release v0.1.7. --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 79e24de..47629db 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ArduinoMqttClient -version=0.1.6 +version=0.1.7 author=Arduino maintainer=Arduino sentence=[BETA] Allows you to send and receive MQTT messages using Arduino. From fa0a2b3779a57951d3f6650cec62ee4b916cc586 Mon Sep 17 00:00:00 2001 From: pennam Date: Tue, 25 Jul 2023 16:28:38 +0200 Subject: [PATCH 34/46] CI: Add new boards to compile examples workflow --- .github/workflows/compile-examples.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index c1bfe9b..4ffc309 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -59,9 +59,26 @@ jobs: platforms: | - name: arduino:mbed_nicla libraries: "" + - fqbn: arduino:mbed_opta:opta + platforms: | + - name: arduino:mbed_opta + libraries: "" - fqbn: arduino:mbed_giga:giga platforms: | - name: arduino:mbed_giga + libraries: "" + - fqbn: arduino:renesas_portenta:portenta_c33 + platforms: | + - name: arduino:renesas_portenta + libraries: "" + - fqbn: arduino:renesas_uno:unor4wifi + platforms: | + - name: arduino:renesas_uno + libraries: "" + - fqbn: arduino:esp32:nano_nora + platforms: | + - name: arduino:esp32 + libraries: "" - fqbn: esp8266:esp8266:huzzah platforms: | - name: esp8266:esp8266 From 1d934560d5a58f7c4a136447284033a914a37f50 Mon Sep 17 00:00:00 2001 From: pennam Date: Tue, 25 Jul 2023 16:40:24 +0200 Subject: [PATCH 35/46] Fix build for new boards --- examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino | 6 +++++- examples/WiFiEcho/WiFiEcho.ino | 6 +++++- examples/WiFiEchoCallback/WiFiEchoCallback.ino | 6 +++++- examples/WiFiSimpleReceive/WiFiSimpleReceive.ino | 6 +++++- .../WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino | 6 +++++- examples/WiFiSimpleSender/WiFiSimpleSender.ino | 6 +++++- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino index 5cf2b58..4b1a196 100644 --- a/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino +++ b/examples/WiFiAdvancedCallback/WiFiAdvancedCallback.ino @@ -22,8 +22,12 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) #include +#elif defined(ARDUINO_PORTENTA_C33) + #include +#elif defined(ARDUINO_UNOR4_WIFI) + #include #endif #include "arduino_secrets.h" diff --git a/examples/WiFiEcho/WiFiEcho.ino b/examples/WiFiEcho/WiFiEcho.ino index e5e47ee..a8dc3a0 100644 --- a/examples/WiFiEcho/WiFiEcho.ino +++ b/examples/WiFiEcho/WiFiEcho.ino @@ -18,8 +18,12 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) #include +#elif defined(ARDUINO_PORTENTA_C33) + #include +#elif defined(ARDUINO_UNOR4_WIFI) + #include #endif #include "arduino_secrets.h" diff --git a/examples/WiFiEchoCallback/WiFiEchoCallback.ino b/examples/WiFiEchoCallback/WiFiEchoCallback.ino index 7f1afa9..e409e83 100644 --- a/examples/WiFiEchoCallback/WiFiEchoCallback.ino +++ b/examples/WiFiEchoCallback/WiFiEchoCallback.ino @@ -19,8 +19,12 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) #include +#elif defined(ARDUINO_PORTENTA_C33) + #include +#elif defined(ARDUINO_UNOR4_WIFI) + #include #endif #include "arduino_secrets.h" diff --git a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino index 6af92a3..62c34e4 100644 --- a/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino +++ b/examples/WiFiSimpleReceive/WiFiSimpleReceive.ino @@ -17,8 +17,12 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) #include +#elif defined(ARDUINO_PORTENTA_C33) + #include +#elif defined(ARDUINO_UNOR4_WIFI) + #include #endif #include "arduino_secrets.h" diff --git a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino index 5f6c47a..e96399d 100644 --- a/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino +++ b/examples/WiFiSimpleReceiveCallback/WiFiSimpleReceiveCallback.ino @@ -18,8 +18,12 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) #include +#elif defined(ARDUINO_PORTENTA_C33) + #include +#elif defined(ARDUINO_UNOR4_WIFI) + #include #endif #include "arduino_secrets.h" diff --git a/examples/WiFiSimpleSender/WiFiSimpleSender.ino b/examples/WiFiSimpleSender/WiFiSimpleSender.ino index 236a6e8..db8840e 100644 --- a/examples/WiFiSimpleSender/WiFiSimpleSender.ino +++ b/examples/WiFiSimpleSender/WiFiSimpleSender.ino @@ -17,8 +17,12 @@ #include #elif defined(ARDUINO_ARCH_ESP8266) #include -#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) #include +#elif defined(ARDUINO_PORTENTA_C33) + #include +#elif defined(ARDUINO_UNOR4_WIFI) + #include #endif #include "arduino_secrets.h" From 107090e420563295a586fd8bd44dc0cbff77a889 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 06:02:24 +0200 Subject: [PATCH 36/46] Bump actions/checkout from 3 to 4 (#92) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 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/v3...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 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml index 3e0d26c..adb330f 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@v3 + 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 c1bfe9b..d11505c 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -75,7 +75,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compile examples uses: arduino/compile-sketches@v1 diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 3f6b03f..ef7d894 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + 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 94938f3..9cde1ac 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@v3 + 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@v3 + uses: actions/checkout@v4 - name: Download configuration files artifact uses: actions/download-artifact@v3 From f2574327f8e29c792225514e2d5fa00791a4e581 Mon Sep 17 00:00:00 2001 From: Mattia Pennasilico Date: Wed, 31 Jan 2024 08:51:10 +0100 Subject: [PATCH 37/46] Release v0.1.8 --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 47629db..9b6cf4b 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ArduinoMqttClient -version=0.1.7 +version=0.1.8 author=Arduino maintainer=Arduino sentence=[BETA] Allows you to send and receive MQTT messages using Arduino. From 8172f7a82e7300b62538142f43f2ceda1db47b91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 09:47:39 +0100 Subject: [PATCH 38/46] Bump actions/download-artifact from 3 to 4 (#95) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...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 9cde1ac..885a8ac 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -108,7 +108,7 @@ jobs: uses: actions/checkout@v4 - name: Download configuration files artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} From a473876380f4b7a58df3c372f101769471e00ea9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 09:47:54 +0100 Subject: [PATCH 39/46] Bump actions/upload-artifact from 3 to 4 (#96) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...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 b2f0568..0bc14d2 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -110,7 +110,7 @@ jobs: sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} - name: Save sketches report as workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error path: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 885a8ac..2e1d6e0 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@v3 + uses: actions/upload-artifact@v4 with: path: | *.yaml From a9047eca03118f7372017416da851397fc1d2b5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 09:48:07 +0100 Subject: [PATCH 40/46] Bump geekyeggo/delete-artifact from 2 to 4 (#97) Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 2 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/v2...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 2e1d6e0..47ac50a 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@v2 + uses: geekyeggo/delete-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From 24142a0c78b15b593e8b216bd66fe83396afbbb0 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 19 Feb 2024 10:17:31 +0100 Subject: [PATCH 41/46] Fix regression re report-size-deltas after updating actions/upload-artifact. (#99) 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 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 0bc14d2..30d4835 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -36,59 +36,72 @@ jobs: - name: arduino:megaavr libraries: | - name: WiFiNINA + artifact-name-suffix: arduino-megaavr-uno2018 - fqbn: arduino:samd:mkrwifi1010 platforms: | - name: arduino:samd libraries: | - name: WiFiNINA + artifact-name-suffix: arduino-samd-mkrwifi1010 - fqbn: arduino:samd:mkr1000 platforms: | - name: arduino:samd libraries: | - name: WiFi101 + artifact-name-suffix: arduino-samd-mkr1000 - fqbn: arduino:samd:nano_33_iot platforms: | - name: arduino:samd libraries: | - name: WiFiNINA + artifact-name-suffix: arduino-samd-nano_33_iot - fqbn: arduino:mbed_portenta:envie_m7 platforms: | - name: arduino:mbed_portenta libraries: "" + artifact-name-suffix: arduino-mbed_portenta-envie_m7 - fqbn: arduino:mbed_nicla:nicla_vision platforms: | - name: arduino:mbed_nicla libraries: "" + artifact-name-suffix: arduino-mbed_nicla-nicla_vision - fqbn: arduino:mbed_opta:opta platforms: | - name: arduino:mbed_opta libraries: "" + artifact-name-suffix: arduino-mbed_opta-opta - fqbn: arduino:mbed_giga:giga platforms: | - name: arduino:mbed_giga libraries: "" + artifact-name-suffix: arduino-mbed_giga-giga - fqbn: arduino:renesas_portenta:portenta_c33 platforms: | - name: arduino:renesas_portenta libraries: "" + artifact-name-suffix: arduino-renesas_portenta-portenta_c33 - fqbn: arduino:renesas_uno:unor4wifi platforms: | - name: arduino:renesas_uno libraries: "" + artifact-name-suffix: arduino-renesas_uno-unor4wifi - fqbn: arduino:esp32:nano_nora platforms: | - name: arduino:esp32 libraries: "" + artifact-name-suffix: arduino-esp32-nano_nora - fqbn: esp8266:esp8266:huzzah platforms: | - name: esp8266:esp8266 source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json libraries: "" + artifact-name-suffix: esp8266-esp8266-huzzah - fqbn: "esp32:esp32:esp32" platforms: | - name: esp32:esp32 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json libraries: "" + artifact-name-suffix: esp32-esp32-esp32 steps: - name: Checkout repository @@ -114,4 +127,4 @@ jobs: with: if-no-files-found: error path: ${{ env.SKETCHES_REPORTS_PATH }} - name: ${{ env.SKETCHES_REPORTS_PATH }} + name: sketches-report-${{ matrix.board.artifact-name-suffix }} From f55722db90d69084ba8c3dc14c0a287b09917f38 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 21 Feb 2024 07:30:53 +0100 Subject: [PATCH 42/46] Fix regression: report size delta size on PR. (#101) The necessary steps have in fact been documented here: https://github.com/arduino/report-size-deltas/blob/main/docs/FAQ.md#workflow-triggered-by-pull_request-event but I have overlooked them when I fixed the upload issue. With this PR the size deltas are - once again - reported within the PR. --- .github/workflows/compile-examples.yml | 23 +++++++++++++++++++---- .github/workflows/report-size-deltas.yml | 24 ------------------------ .gitignore | 1 + 3 files changed, 20 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/report-size-deltas.yml create mode 100644 .gitignore diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 30d4835..e608289 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -18,14 +18,14 @@ on: workflow_dispatch: repository_dispatch: +env: + SKETCHES_REPORTS_PATH: sketches-reports + jobs: - build: + compile: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest - env: - SKETCHES_REPORTS_PATH: sketches-reports - strategy: fail-fast: false @@ -128,3 +128,18 @@ jobs: if-no-files-found: error path: ${{ env.SKETCHES_REPORTS_PATH }} name: sketches-report-${{ matrix.board.artifact-name-suffix }} + + report: + needs: compile + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + + steps: + - name: Download sketches reports artifacts + uses: actions/download-artifact@v4 + with: + path: ${{ env.SKETCHES_REPORTS_PATH }} + + - uses: arduino/report-size-deltas@v1 + with: + sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml deleted file mode 100644 index 652be5d..0000000 --- a/.github/workflows/report-size-deltas.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Report Size Deltas - -# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows -on: - push: - paths: - - ".github/workflows/report-size-deltas.yml" - schedule: - # Run at the minimum interval allowed by GitHub Actions. - # Note: GitHub Actions periodically has outages which result in workflow failures. - # In this event, the workflows will start passing again once the service recovers. - - cron: "*/5 * * * *" - workflow_dispatch: - repository_dispatch: - -jobs: - report: - runs-on: ubuntu-latest - steps: - - name: Comment size deltas reports to PRs - uses: arduino/report-size-deltas@v1 - with: - # The name of the workflow artifact created by the sketch compilation workflow - sketches-reports-source: sketches-reports diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ From c65ae9effa50f04e5435895168dcbbac89d5646a Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 21 Feb 2024 19:08:06 +0100 Subject: [PATCH 43/46] Revert "Fix regression: report size delta size on PR." This reverts commit 0dbb6848ec0df501c7b072b110c0d682b655b23a. --- .github/workflows/compile-examples.yml | 23 ++++------------------- .github/workflows/report-size-deltas.yml | 24 ++++++++++++++++++++++++ .gitignore | 1 - 3 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/report-size-deltas.yml delete mode 100644 .gitignore diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index e608289..30d4835 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -18,14 +18,14 @@ on: workflow_dispatch: repository_dispatch: -env: - SKETCHES_REPORTS_PATH: sketches-reports - jobs: - compile: + build: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest + env: + SKETCHES_REPORTS_PATH: sketches-reports + strategy: fail-fast: false @@ -128,18 +128,3 @@ jobs: if-no-files-found: error path: ${{ env.SKETCHES_REPORTS_PATH }} name: sketches-report-${{ matrix.board.artifact-name-suffix }} - - report: - needs: compile - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - - steps: - - name: Download sketches reports artifacts - uses: actions/download-artifact@v4 - with: - path: ${{ env.SKETCHES_REPORTS_PATH }} - - - uses: arduino/report-size-deltas@v1 - with: - sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..652be5d --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,24 @@ +name: Report Size Deltas + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/report-size-deltas.yml" + schedule: + # Run at the minimum interval allowed by GitHub Actions. + # Note: GitHub Actions periodically has outages which result in workflow failures. + # In this event, the workflows will start passing again once the service recovers. + - cron: "*/5 * * * *" + workflow_dispatch: + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@v1 + with: + # The name of the workflow artifact created by the sketch compilation workflow + sketches-reports-source: sketches-reports diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9f11b75..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.idea/ From c319dcacc6bb428722819e79abb4107a1d8963f0 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 21 Feb 2024 19:08:50 +0100 Subject: [PATCH 44/46] Correct workflow artifact name pattern in size deltas report workflow The "sketches-reports-source" input of the "arduino/report-size-deltas" GitHub Actions action defines the regular expression that matches the names of the sketches report workflow artifacts produced by the "Compile Examples" workflow. The key string in the names of these artifacts was set to "sketches-report" when the "Compile Examples" workflow was adjusted for compatibility with the breaking changes introduced by updating to version 4.x of the workflow's "actions/upload-artifact" GitHub Actions action dependency. The pattern set in the size deltas report workflow was "sketches-reports". The "s" at the end of that pattern caused it to no longer match against the key string in the artifact names after that adjustment of the "Compile Examples" workflow, resulting in size deltas reports no longer being generated by the workflow. Although a minimal fix would be to simply remove the "s" from the end of the pattern, the decision was made to use a more strict regular expression. This will make it easier for maintainers and contributors to understand that this value is a regular expression and the exact nature of how that regular expression functions (which is less clear when relying on the "arduino/report-size-deltas" action's partial pattern matching behavior). --- .github/workflows/report-size-deltas.yml | 4 ++-- .gitignore | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml index 652be5d..39e2a0a 100644 --- a/.github/workflows/report-size-deltas.yml +++ b/.github/workflows/report-size-deltas.yml @@ -20,5 +20,5 @@ jobs: - name: Comment size deltas reports to PRs uses: arduino/report-size-deltas@v1 with: - # The name of the workflow artifact created by the sketch compilation workflow - sketches-reports-source: sketches-reports + # Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow + sketches-reports-source: ^sketches-report-.+ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ From d2f5935f5d2d5023714d2e5dea7458f952eecf2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:54:46 +0100 Subject: [PATCH 45/46] Bump geekyeggo/delete-artifact from 4 to 5 (#104) Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 4 to 5. - [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/v4...v5) --- 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 47ac50a..53a9f54 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@v4 + uses: geekyeggo/delete-artifact@v5 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From 99d6b26c8c2b010c5f5f0d2ca1c4dc170f26d794 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:41:12 +0000 Subject: [PATCH 46/46] Bump arduino/arduino-lint-action from 1 to 2 Bumps [arduino/arduino-lint-action](https://github.com/arduino/arduino-lint-action) from 1 to 2. - [Release notes](https://github.com/arduino/arduino-lint-action/releases) - [Commits](https://github.com/arduino/arduino-lint-action/compare/v1...v2) --- updated-dependencies: - dependency-name: arduino/arduino-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-arduino.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml index adb330f..e818685 100644 --- a/.github/workflows/check-arduino.yml +++ b/.github/workflows/check-arduino.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v4 - name: Arduino Lint - uses: arduino/arduino-lint-action@v1 + uses: arduino/arduino-lint-action@v2 with: compliance: specification library-manager: update