From 18fcfeb6ce8a08a59cfd8cce562cf7c84614a259 Mon Sep 17 00:00:00 2001 From: Illia Barkov Date: Tue, 21 Feb 2023 18:02:47 +0200 Subject: [PATCH 1/9] Create submodule_branch_update.yml --- .github/workflows/submodule_branch_update.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/submodule_branch_update.yml diff --git a/.github/workflows/submodule_branch_update.yml b/.github/workflows/submodule_branch_update.yml new file mode 100644 index 00000000..a797f5bf --- /dev/null +++ b/.github/workflows/submodule_branch_update.yml @@ -0,0 +1,19 @@ +on: + push: + branches: + - master + +jobs: + update_submodule: + name: Update submodule branch + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: + submodule + - run: | + git config user.name github-actions + git config user.email github-actions@github.com + git pull master + git push From f4284033acceeff71ac567cefeb414fbee339f9d Mon Sep 17 00:00:00 2001 From: zbeacon Date: Wed, 22 Feb 2023 13:49:17 +0200 Subject: [PATCH 2/9] removed github action for now --- .github/workflows/submodule_branch_update.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .github/workflows/submodule_branch_update.yml diff --git a/.github/workflows/submodule_branch_update.yml b/.github/workflows/submodule_branch_update.yml deleted file mode 100644 index a797f5bf..00000000 --- a/.github/workflows/submodule_branch_update.yml +++ /dev/null @@ -1,19 +0,0 @@ -on: - push: - branches: - - master - -jobs: - update_submodule: - name: Update submodule branch - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: - submodule - - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git pull master - git push From ed649cd9a85107b0ad3e6a3540f4fc05e95547ff Mon Sep 17 00:00:00 2001 From: Illia Barkov Date: Wed, 22 Feb 2023 15:35:16 +0200 Subject: [PATCH 3/9] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 2e131718..25a6f021 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ +## ThingsBoard note + +This is a fork of the main repository, which was last updated in 2020. +Since we have an SDK based on this client, we decided to continue with this repository. +We also believe that this library provides a lot of opportunities for people who want to build their own IoT devices. +As with our other open source repositories, we appreciate every contribution to this library. + +We were forced to change the name of the library, add it to the Arduino libraries, but it does not contain any specific code to work with our platform, and it is still open to work with any MQTT broker. + # Arduino Client for MQTT This library provides a client for doing simple publish/subscribe messaging with From 11ad69c7f1549ce4becef0c9d07b126434cb3434 Mon Sep 17 00:00:00 2001 From: Illia Barkov Date: Wed, 22 Feb 2023 15:37:52 +0200 Subject: [PATCH 4/9] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 25a6f021..4aac8130 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ Since we have an SDK based on this client, we decided to continue with this repo We also believe that this library provides a lot of opportunities for people who want to build their own IoT devices. As with our other open source repositories, we appreciate every contribution to this library. -We were forced to change the name of the library, add it to the Arduino libraries, but it does not contain any specific code to work with our platform, and it is still open to work with any MQTT broker. # Arduino Client for MQTT From 66e3384f4b7b80526da56e2ef47e1609c8b51aa0 Mon Sep 17 00:00:00 2001 From: Illia Barkov Date: Wed, 22 Feb 2023 16:17:31 +0200 Subject: [PATCH 5/9] Update library.properties --- library.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library.properties b/library.properties index e47ffe92..077cd929 100644 --- a/library.properties +++ b/library.properties @@ -1,7 +1,7 @@ -name=PubSubClient -version=2.8 +name=TBPubSubClient +version=2.9 author=Nick O'Leary -maintainer=Nick O'Leary +maintainer=ThingsBoard Team sentence=A client library for MQTT messaging. paragraph=MQTT is a lightweight messaging protocol ideal for small devices. This library allows you to send and receive MQTT messages. It supports the latest MQTT 3.1.1 protocol and can be configured to use the older MQTT 3.1 if needed. It supports all Arduino Ethernet Client compatible hardware, including the Intel Galileo/Edison, ESP8266 and TI CC3000. category=Communication From 1b33a50034810246b77396f4950453aef454e86a Mon Sep 17 00:00:00 2001 From: Illia Barkov Date: Wed, 22 Feb 2023 16:19:36 +0200 Subject: [PATCH 6/9] Update library.json --- library.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/library.json b/library.json index c0d7bae2..08c544fa 100644 --- a/library.json +++ b/library.json @@ -1,18 +1,19 @@ { - "name": "PubSubClient", - "keywords": "ethernet, mqtt, m2m, iot", + "name": "TBPubSubClient", + "keywords": "ethernet, mqtt, m2m, iot, thingsboard, messages", "description": "A client library for MQTT messaging. MQTT is a lightweight messaging protocol ideal for small devices. This library allows you to send and receive MQTT messages. It supports the latest MQTT 3.1.1 protocol and can be configured to use the older MQTT 3.1 if needed. It supports all Arduino Ethernet Client compatible hardware, including the Intel Galileo/Edison, ESP8266 and TI CC3000.", "repository": { "type": "git", - "url": "https://github.com/knolleary/pubsubclient.git" + "url": "https://github.com/thingsboard/pubsubclient.git" }, - "version": "2.8", + "version": "2.9", "exclude": "tests", "examples": "examples/*/*.ino", "frameworks": "arduino", "platforms": [ "atmelavr", "espressif8266", - "espressif32" + "espressif32", + "rp2040" ] } From 445e9f374a56bc9055015fc23938183f17d4a637 Mon Sep 17 00:00:00 2001 From: zbeacon Date: Wed, 22 Feb 2023 16:32:00 +0200 Subject: [PATCH 7/9] Updated names due to Arduino Library policy --- CHANGES.txt | 2 ++ README.md | 12 ++++++------ examples/mqtt_auth/mqtt_auth.ino | 2 +- examples/mqtt_basic/mqtt_basic.ino | 2 +- examples/mqtt_esp8266/mqtt_esp8266.ino | 2 +- examples/mqtt_large_message/mqtt_large_message.ino | 2 +- .../mqtt_publish_in_callback.ino | 2 +- .../mqtt_reconnect_nonblocking.ino | 2 +- examples/mqtt_stream/mqtt_stream.ino | 2 +- src/{PubSubClient.cpp => TBPubSubClient.cpp} | 0 src/{PubSubClient.h => TBPubSubClient.h} | 6 +++--- tests/src/connect_spec.cpp | 2 +- tests/src/keepalive_spec.cpp | 2 +- tests/src/publish_spec.cpp | 2 +- tests/src/receive_spec.cpp | 2 +- tests/src/subscribe_spec.cpp | 2 +- 16 files changed, 23 insertions(+), 21 deletions(-) rename src/{PubSubClient.cpp => TBPubSubClient.cpp} (100%) rename src/{PubSubClient.h => TBPubSubClient.h} (98%) diff --git a/CHANGES.txt b/CHANGES.txt index e23d5315..2c27d9ca 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,5 @@ +2.9 + * Add ability to use function for callback not just for ESP boards 2.8 * Add setBufferSize() to override MQTT_MAX_PACKET_SIZE * Add setKeepAlive() to override MQTT_KEEPALIVE diff --git a/README.md b/README.md index 4aac8130..915de4c8 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ Full API documentation is available here: https://pubsubclient.knolleary.net - It can only publish QoS 0 messages. It can subscribe at QoS 0 or QoS 1. - The maximum message size, including header, is **256 bytes** by default. This - is configurable via `MQTT_MAX_PACKET_SIZE` in `PubSubClient.h` or can be changed - by calling `PubSubClient::setBufferSize(size)`. + is configurable via `MQTT_MAX_PACKET_SIZE` in `TBPubSubClient.h` or can be changed + by calling `TBPubSubClient::setBufferSize(size)`. - The keepalive interval is set to 15 seconds by default. This is configurable - via `MQTT_KEEPALIVE` in `PubSubClient.h` or can be changed by calling - `PubSubClient::setKeepAlive(keepAlive)`. + via `MQTT_KEEPALIVE` in `TBPubSubClient.h` or can be changed by calling + `TBPubSubClient::setKeepAlive(keepAlive)`. - The client uses MQTT 3.1.1 by default. It can be changed to use MQTT 3.1 by - changing value of `MQTT_VERSION` in `PubSubClient.h`. + changing value of `MQTT_VERSION` in `TBPubSubClient.h`. ## Compatible Hardware @@ -42,7 +42,7 @@ boards and shields, including: - Arduino YUN – use the included `YunClient` in place of `EthernetClient`, and be sure to do a `Bridge.begin()` first - Arduino WiFi Shield - if you want to send packets > 90 bytes with this shield, - enable the `MQTT_MAX_TRANSFER_SIZE` define in `PubSubClient.h`. + enable the `MQTT_MAX_TRANSFER_SIZE` define in `TBPubSubClient.h`. - Sparkfun WiFly Shield – [library](https://github.com/dpslwk/WiFly) - TI CC3000 WiFi - [library](https://github.com/sparkfun/SFE_CC3000_Library) - Intel Galileo/Edison diff --git a/examples/mqtt_auth/mqtt_auth.ino b/examples/mqtt_auth/mqtt_auth.ino index 04bd7bb2..93bfb5d1 100755 --- a/examples/mqtt_auth/mqtt_auth.ino +++ b/examples/mqtt_auth/mqtt_auth.ino @@ -9,7 +9,7 @@ #include #include -#include +#include // Update these with values suitable for your network. byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED }; diff --git a/examples/mqtt_basic/mqtt_basic.ino b/examples/mqtt_basic/mqtt_basic.ino index f545adef..a62f9b7a 100755 --- a/examples/mqtt_basic/mqtt_basic.ino +++ b/examples/mqtt_basic/mqtt_basic.ino @@ -15,7 +15,7 @@ #include #include -#include +#include // Update these with values suitable for your network. byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED }; diff --git a/examples/mqtt_esp8266/mqtt_esp8266.ino b/examples/mqtt_esp8266/mqtt_esp8266.ino index 7e6effd2..979995cc 100644 --- a/examples/mqtt_esp8266/mqtt_esp8266.ino +++ b/examples/mqtt_esp8266/mqtt_esp8266.ino @@ -19,7 +19,7 @@ */ #include -#include +#include // Update these with values suitable for your network. diff --git a/examples/mqtt_large_message/mqtt_large_message.ino b/examples/mqtt_large_message/mqtt_large_message.ino index e048c3ed..5bbe8e0f 100644 --- a/examples/mqtt_large_message/mqtt_large_message.ino +++ b/examples/mqtt_large_message/mqtt_large_message.ino @@ -25,7 +25,7 @@ */ #include -#include +#include // Update these with values suitable for your network. diff --git a/examples/mqtt_publish_in_callback/mqtt_publish_in_callback.ino b/examples/mqtt_publish_in_callback/mqtt_publish_in_callback.ino index 42afb2a3..12feac86 100644 --- a/examples/mqtt_publish_in_callback/mqtt_publish_in_callback.ino +++ b/examples/mqtt_publish_in_callback/mqtt_publish_in_callback.ino @@ -16,7 +16,7 @@ #include #include -#include +#include // Update these with values suitable for your network. byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED }; diff --git a/examples/mqtt_reconnect_nonblocking/mqtt_reconnect_nonblocking.ino b/examples/mqtt_reconnect_nonblocking/mqtt_reconnect_nonblocking.ino index 080b7391..1b57ba89 100644 --- a/examples/mqtt_reconnect_nonblocking/mqtt_reconnect_nonblocking.ino +++ b/examples/mqtt_reconnect_nonblocking/mqtt_reconnect_nonblocking.ino @@ -10,7 +10,7 @@ #include #include -#include +#include // Update these with values suitable for your hardware/network. byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED }; diff --git a/examples/mqtt_stream/mqtt_stream.ino b/examples/mqtt_stream/mqtt_stream.ino index 67c22872..ab271c0d 100644 --- a/examples/mqtt_stream/mqtt_stream.ino +++ b/examples/mqtt_stream/mqtt_stream.ino @@ -11,7 +11,7 @@ #include #include -#include +#include #include // Update these with values suitable for your network. diff --git a/src/PubSubClient.cpp b/src/TBPubSubClient.cpp similarity index 100% rename from src/PubSubClient.cpp rename to src/TBPubSubClient.cpp diff --git a/src/PubSubClient.h b/src/TBPubSubClient.h similarity index 98% rename from src/PubSubClient.h rename to src/TBPubSubClient.h index 24740540..ad74802c 100755 --- a/src/PubSubClient.h +++ b/src/TBPubSubClient.h @@ -1,11 +1,11 @@ /* - PubSubClient.h - A simple client for MQTT. + TBPubSubClient.h - A simple client for MQTT. Nick O'Leary http://knolleary.net */ -#ifndef PubSubClient_h -#define PubSubClient_h +#ifndef TBPubSubClient_h +#define TBPubSubClient_h #include #include "IPAddress.h" diff --git a/tests/src/connect_spec.cpp b/tests/src/connect_spec.cpp index e8545c49..774e60db 100644 --- a/tests/src/connect_spec.cpp +++ b/tests/src/connect_spec.cpp @@ -1,4 +1,4 @@ -#include "PubSubClient.h" +#include "TBPubSubClient.h" #include "ShimClient.h" #include "Buffer.h" #include "BDDTest.h" diff --git a/tests/src/keepalive_spec.cpp b/tests/src/keepalive_spec.cpp index ea643cf1..f09c6ede 100644 --- a/tests/src/keepalive_spec.cpp +++ b/tests/src/keepalive_spec.cpp @@ -1,4 +1,4 @@ -#include "PubSubClient.h" +#include "TBPubSubClient.h" #include "ShimClient.h" #include "Buffer.h" #include "BDDTest.h" diff --git a/tests/src/publish_spec.cpp b/tests/src/publish_spec.cpp index ee3d3bed..6ae55832 100644 --- a/tests/src/publish_spec.cpp +++ b/tests/src/publish_spec.cpp @@ -1,4 +1,4 @@ -#include "PubSubClient.h" +#include "TBPubSubClient.h" #include "ShimClient.h" #include "Buffer.h" #include "BDDTest.h" diff --git a/tests/src/receive_spec.cpp b/tests/src/receive_spec.cpp index 93e909ae..546ad4a1 100644 --- a/tests/src/receive_spec.cpp +++ b/tests/src/receive_spec.cpp @@ -1,4 +1,4 @@ -#include "PubSubClient.h" +#include "TBPubSubClient.h" #include "ShimClient.h" #include "Buffer.h" #include "BDDTest.h" diff --git a/tests/src/subscribe_spec.cpp b/tests/src/subscribe_spec.cpp index 22dc8a44..10d98e02 100644 --- a/tests/src/subscribe_spec.cpp +++ b/tests/src/subscribe_spec.cpp @@ -1,4 +1,4 @@ -#include "PubSubClient.h" +#include "TBPubSubClient.h" #include "ShimClient.h" #include "Buffer.h" #include "BDDTest.h" From 33cd7cb04756e7fa1040e54981ef6df9c935dcf8 Mon Sep 17 00:00:00 2001 From: zbeacon Date: Wed, 22 Feb 2023 18:08:38 +0200 Subject: [PATCH 8/9] Updated name --- src/TBPubSubClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TBPubSubClient.cpp b/src/TBPubSubClient.cpp index 2b48d2b6..7b8b949d 100755 --- a/src/TBPubSubClient.cpp +++ b/src/TBPubSubClient.cpp @@ -5,7 +5,7 @@ http://knolleary.net */ -#include "PubSubClient.h" +#include "TBPubSubClient.h" #include "Arduino.h" PubSubClient::PubSubClient() { From a4d4245561bbd400dd8a8cec6822d49c5c790b0b Mon Sep 17 00:00:00 2001 From: Illia Barkov Date: Mon, 27 Feb 2023 13:04:16 +0200 Subject: [PATCH 9/9] Updated version --- library.json | 2 +- library.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index 08c544fa..82628fad 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "type": "git", "url": "https://github.com/thingsboard/pubsubclient.git" }, - "version": "2.9", + "version": "2.9.1", "exclude": "tests", "examples": "examples/*/*.ino", "frameworks": "arduino", diff --git a/library.properties b/library.properties index 077cd929..1125c05f 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TBPubSubClient -version=2.9 +version=2.9.1 author=Nick O'Leary maintainer=ThingsBoard Team sentence=A client library for MQTT messaging.