From 54311f199ab12de88b7caa794ab94b19ba612123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:18:00 +0200 Subject: [PATCH 01/12] consolidate constructor --- README.md | 40 +++++++++++++----------- examples/MQTTClient/MQTTClient.ino | 4 ++- examples/YunMQTTClient/YunMQTTClient.ino | 12 ++----- src/MQTTClient.cpp | 4 --- src/MQTTClient.h | 2 -- src/YunMQTTClient.cpp | 26 +++++++++------ src/YunMQTTClient.h | 7 +++-- 7 files changed, 47 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 0b3f6db..30a3919 100644 --- a/README.md +++ b/README.md @@ -35,13 +35,15 @@ Here is a list of platforms that are supported: #include YunClient net; -MQTTClient client("broker.shiftr.io", net); +MQTTClient client; unsigned long lastMillis = 0; void setup() { Bridge.begin(); Serial.begin(9600); + client.begin("broker.shiftr.io", net); + Serial.println("connecting..."); if (client.connect("arduino", "try", "try")) { Serial.println("connected!"); @@ -72,55 +74,55 @@ void messageReceived(String topic, String payload, char * bytes, unsigned int le ## API -- **`MQTTClient(const char * hostname, Client& client)`** -- **`MQTTClient(const char * hostname, int port, Client& client)`** +Initialize the `MQTTClient` object using the hostname of the broker, the brokers port (default: `1883`) and the underlying Client class for network transport: -Constructor for the `MQTTClient` object using the hostname of the broker, the brokers port (default: `1883`) and the underlying Client class for network transport. +- **`void MQTTClient::begin(const char * hostname, Client& client)`** +- **`void MQTTClient::begin(const char * hostname, int port, Client& client)`** -- **`YunMQTTClient(const char * hostname)`** -- **`YunMQTTClient(const char * hostname, int port)`** +Initialize the `YunMQTTClient` object using the hostname of the broker and the brokers port (default: `1883`): -Constructor for the `YunMQTTClient` object using the hostname of the broker and the brokers port (default: `1883`). +- **`void YunMQTTClient::begin(const char * hostname)`** +- **`void YunMQTTClient::begin(const char * hostname, int port)`** -- **`int installBridge(boolean force)`** - -Installs the python bridge on the linux processor. Pass `true` to force an update if the code already exists. This function only works in conjunction with the `YunMQTTClient` object. A return value of 0 means that there was an error while installing, 1 means that the bridge is already installed and 2 means that there was an update. +Set the will message that gets registered on a connect: - **`void setWill(const char * topic)`** - **`void setWill(const char * topic, const char * payload)`** -Sets the will message that gets registered on a connect. +Connect to broker using the supplied client id and an optional username and password: - **`boolean connect(const char * clientId)`** - **`boolean connect(const char * clientId, const char* username, const char* password)`** -Connects to broker using the supplied client id and an optional username and password. This functions return value indicates if the connection has been established successfully. +- This functions returns a value that indicates if the connection has been established successfully. + +Publishes a message to the broker with an optional payload: - **`void publish(String topic)`** - **`void publish(String topic, String payload)`** - **`void publish(const char * topic, String payload)`** - **`void publish(const char * topic, const char * payload)`** -Publishes a message to the broker with an optional payload. +Subscribe to a topic: - **`void subscribe(String topic)`** - **`void subscribe(const char * topic)`** -Subscribes to a topic. +Unsubscribe from a topic: - **`void unsubscribe(String topic)`** - **`void unsubscribe(const char * topic)`** -Unsubscribes from a topic. +Sends and receives packets: - **`void loop()`** -Sends and receives packets. This function should be called as often as possible. +- This function should be called in every `loop`. + +Check if the client is currently connected: - **`boolean connected()`** -Checks if the client is currently connected. +Disconnects from the broker: - **`void disconnect()`** - -Disconnects from the broker. diff --git a/examples/MQTTClient/MQTTClient.ino b/examples/MQTTClient/MQTTClient.ino index ce462bf..ca7e5c3 100644 --- a/examples/MQTTClient/MQTTClient.ino +++ b/examples/MQTTClient/MQTTClient.ino @@ -3,13 +3,15 @@ #include YunClient net; -MQTTClient client("broker.shiftr.io", net); +MQTTClient client; unsigned long lastMillis = 0; void setup() { Bridge.begin(); Serial.begin(9600); + client.begin("broker.shiftr.io", net); + Serial.println("connecting..."); if (client.connect("arduino", "try", "try")) { Serial.println("connected!"); diff --git a/examples/YunMQTTClient/YunMQTTClient.ino b/examples/YunMQTTClient/YunMQTTClient.ino index 637b620..6bddd85 100644 --- a/examples/YunMQTTClient/YunMQTTClient.ino +++ b/examples/YunMQTTClient/YunMQTTClient.ino @@ -1,22 +1,14 @@ #include #include -YunMQTTClient client("broker.shiftr.io"); +YunMQTTClient client; unsigned long lastMillis = 0; void setup() { Bridge.begin(); Serial.begin(9600); - - // This will install the required python files (pass true to force update). - // Line can also be commented out to save program space. - // If you update the library you also need to update the bridge! - switch(client.installBridge(false)) { - case 0: Serial.println("error while installing bridge!"); break; - case 1: Serial.println("bridge already installed!"); break; - case 2: Serial.println("bridge updated!"); break; - } + client.begin("broker.shiftr.io"); Serial.println("connecting..."); if (client.connect("arduino", "try", "try")) { diff --git a/src/MQTTClient.cpp b/src/MQTTClient.cpp index 16700d7..16d6a06 100644 --- a/src/MQTTClient.cpp +++ b/src/MQTTClient.cpp @@ -17,10 +17,6 @@ void messageArrived(MQTT::MessageData& messageData) { MQTTClient::MQTTClient() {} -MQTTClient::MQTTClient(const char * hostname, int port, Client& client) { - this->begin(hostname, port, client); -} - void MQTTClient::begin(const char * hostname, Client& client) { this->begin(hostname, 1883, client); } diff --git a/src/MQTTClient.h b/src/MQTTClient.h index cb1ba72..d214947 100644 --- a/src/MQTTClient.h +++ b/src/MQTTClient.h @@ -26,8 +26,6 @@ class MQTTClient { int port; public: MQTTClient(); - MQTTClient(const char * hostname, int port, Client& client); - MQTTClient(const char * hostname, Client& client) : MQTTClient(hostname, 1883, client){}; void begin(const char * hostname, Client& client); void begin(const char * hostname, int port, Client& client); void setWill(const char * topic); diff --git a/src/YunMQTTClient.cpp b/src/YunMQTTClient.cpp index 12d3b9a..82c9d95 100644 --- a/src/YunMQTTClient.cpp +++ b/src/YunMQTTClient.cpp @@ -4,19 +4,23 @@ #include -YunMQTTClient::YunMQTTClient(const char * _hostname, int _port) { - this->hostname = _hostname; - this->port = _port; +YunMQTTClient::YunMQTTClient() {} + +void YunMQTTClient::begin(const char * hostname) { + this->begin(hostname, 1883); +} + +void YunMQTTClient::begin(const char * hostname, int port) { + this->hostname = hostname; + this->port = port; } -int YunMQTTClient::installBridge(boolean force) { - if(!force) { - boolean f1 = FileSystem.exists("/usr/mqtt/mqtt.py"); - boolean f2 = FileSystem.exists("/usr/mqtt/bridge.py"); +int YunMQTTClient::installBridge() { + boolean f1 = FileSystem.exists("/usr/mqtt/mqtt.py"); + boolean f2 = FileSystem.exists("/usr/mqtt/bridge.py"); - if(f1 && f2) { + if(f1 && f2) { return 1; - } } Process p; @@ -48,6 +52,10 @@ boolean YunMQTTClient::connect(const char * clientId) { } boolean YunMQTTClient::connect(const char * clientId, const char * username, const char * password) { + if(this->installBridge() == 0) { + return false; + } + this->process.begin("python"); this->process.addParameter("-u"); this->process.addParameter("/usr/mqtt/bridge.py"); diff --git a/src/YunMQTTClient.h b/src/YunMQTTClient.h index 118bc30..5802ed4 100644 --- a/src/YunMQTTClient.h +++ b/src/YunMQTTClient.h @@ -16,10 +16,11 @@ class YunMQTTClient { const char * willTopic = NULL; const char * willPayload = NULL; boolean alive = false; + int installBridge(); public: - YunMQTTClient(const char * hostname, int port); - YunMQTTClient(const char * hostname) : YunMQTTClient(hostname, 1883){}; - int installBridge(boolean force); + YunMQTTClient(); + void begin(const char * hostname); + void begin(const char * hostname, int port); void setWill(const char * topic); void setWill(const char * topic, const char * payload); boolean connect(const char * clientId); From a73f8b2d41d8f9135f821527c957ae2a7bfa4edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:20:22 +0200 Subject: [PATCH 02/12] update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 30a3919..e8dd407 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Connect to broker using the supplied client id and an optional username and pass - **`boolean connect(const char * clientId)`** - **`boolean connect(const char * clientId, const char* username, const char* password)`** -- This functions returns a value that indicates if the connection has been established successfully. +_This functions returns a value that indicates if the connection has been established successfully._ Publishes a message to the broker with an optional payload: @@ -117,7 +117,7 @@ Sends and receives packets: - **`void loop()`** -- This function should be called in every `loop`. +_This function should be called in every `loop`._ Check if the client is currently connected: From 1af8c9442972e52bb95f3d98be2507f64ba19a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:21:17 +0200 Subject: [PATCH 03/12] does that look better? --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e8dd407..8f0b61a 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,10 @@ void messageReceived(String topic, String payload, char * bytes, unsigned int le Initialize the `MQTTClient` object using the hostname of the broker, the brokers port (default: `1883`) and the underlying Client class for network transport: -- **`void MQTTClient::begin(const char * hostname, Client& client)`** -- **`void MQTTClient::begin(const char * hostname, int port, Client& client)`** +```c++ +void MQTTClient::begin(const char * hostname, Client& client) +void MQTTClient::begin(const char * hostname, int port, Client& client) +``` Initialize the `YunMQTTClient` object using the hostname of the broker and the brokers port (default: `1883`): From c19f59e9dc5edc18b5c1ce2be2fe14ae95134ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:22:47 +0200 Subject: [PATCH 04/12] it does! --- README.md | 56 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 8f0b61a..76b905b 100644 --- a/README.md +++ b/README.md @@ -77,54 +77,72 @@ void messageReceived(String topic, String payload, char * bytes, unsigned int le Initialize the `MQTTClient` object using the hostname of the broker, the brokers port (default: `1883`) and the underlying Client class for network transport: ```c++ -void MQTTClient::begin(const char * hostname, Client& client) -void MQTTClient::begin(const char * hostname, int port, Client& client) +void MQTTClient::begin(const char * hostname, Client& client); +void MQTTClient::begin(const char * hostname, int port, Client& client); ``` Initialize the `YunMQTTClient` object using the hostname of the broker and the brokers port (default: `1883`): -- **`void YunMQTTClient::begin(const char * hostname)`** -- **`void YunMQTTClient::begin(const char * hostname, int port)`** +```c++ +void YunMQTTClient::begin(const char * hostname); +void YunMQTTClient::begin(const char * hostname, int port); +``` Set the will message that gets registered on a connect: -- **`void setWill(const char * topic)`** -- **`void setWill(const char * topic, const char * payload)`** +```c++ +void setWill(const char * topic); +void setWill(const char * topic, const char * payload); +``` Connect to broker using the supplied client id and an optional username and password: -- **`boolean connect(const char * clientId)`** -- **`boolean connect(const char * clientId, const char* username, const char* password)`** +```c++ +boolean connect(const char * clientId); +boolean connect(const char * clientId, const char* username, const char* password); +``` _This functions returns a value that indicates if the connection has been established successfully._ Publishes a message to the broker with an optional payload: -- **`void publish(String topic)`** -- **`void publish(String topic, String payload)`** -- **`void publish(const char * topic, String payload)`** -- **`void publish(const char * topic, const char * payload)`** +```c++ +void publish(String topic); +void publish(String topic, String payload); +void publish(const char * topic, String payload); +void publish(const char * topic, const char * payload); +``` Subscribe to a topic: -- **`void subscribe(String topic)`** -- **`void subscribe(const char * topic)`** +```c++ +void subscribe(String topic); +void subscribe(const char * topic); +``` Unsubscribe from a topic: -- **`void unsubscribe(String topic)`** -- **`void unsubscribe(const char * topic)`** +```c++ +void unsubscribe(String topic); +void unsubscribe(const char * topic); +``` Sends and receives packets: -- **`void loop()`** +```c++ +void loop(); +``` _This function should be called in every `loop`._ Check if the client is currently connected: -- **`boolean connected()`** +```c++ +boolean connected(); +``` Disconnects from the broker: -- **`void disconnect()`** +```c++ +void disconnect(); +``` From 224ffbd3f121ed8552be0b7962ac80ef5749d748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:24:04 +0200 Subject: [PATCH 05/12] fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76b905b..943f6b1 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Connect to broker using the supplied client id and an optional username and pass ```c++ boolean connect(const char * clientId); -boolean connect(const char * clientId, const char* username, const char* password); +boolean connect(const char * clientId, const char * username, const char * password); ``` _This functions returns a value that indicates if the connection has been established successfully._ From efed617dffc032a10ef16acc10a6b876179b42fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:41:27 +0200 Subject: [PATCH 06/12] use specific version and update library on every connect --- src/YunMQTTClient.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/YunMQTTClient.cpp b/src/YunMQTTClient.cpp index 82c9d95..08f2434 100644 --- a/src/YunMQTTClient.cpp +++ b/src/YunMQTTClient.cpp @@ -16,18 +16,11 @@ void YunMQTTClient::begin(const char * hostname, int port) { } int YunMQTTClient::installBridge() { - boolean f1 = FileSystem.exists("/usr/mqtt/mqtt.py"); - boolean f2 = FileSystem.exists("/usr/mqtt/bridge.py"); - - if(f1 && f2) { - return 1; - } - Process p; - int r1 = p.runShellCommand("mkdir -p /usr/mqtt"); - int r2 = p.runShellCommand("wget https://raw.githubusercontent.com/256dpi/arduino-mqtt/master/yun/mqtt.py --no-check-certificate -O /usr/mqtt/mqtt.py"); - int r3 = p.runShellCommand("wget https://raw.githubusercontent.com/256dpi/arduino-mqtt/master/yun/bridge.py --no-check-certificate -O /usr/mqtt/bridge.py"); + int r1 = p.runShellCommand("mkdir -p /usr/arduino-mqtt"); + int r2 = p.runShellCommand("wget -N https://raw.githubusercontent.com/256dpi/arduino-mqtt/v1.7.0/yun/mqtt.py --no-check-certificate -P /usr/arduino-mqtt"); + int r3 = p.runShellCommand("wget -N https://raw.githubusercontent.com/256dpi/arduino-mqtt/v1.7.0/yun/bridge.py --no-check-certificate -P /usr/arduino-mqtt"); boolean success = r1 == 0 && r2 == 0 && r3 == 0; From d68032b4ac9783428bb7a7fff6cc0232c5529e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:42:17 +0200 Subject: [PATCH 07/12] renamed --- src/YunMQTTClient.cpp | 4 ++-- src/YunMQTTClient.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/YunMQTTClient.cpp b/src/YunMQTTClient.cpp index 08f2434..b6317b8 100644 --- a/src/YunMQTTClient.cpp +++ b/src/YunMQTTClient.cpp @@ -15,7 +15,7 @@ void YunMQTTClient::begin(const char * hostname, int port) { this->port = port; } -int YunMQTTClient::installBridge() { +int YunMQTTClient::updateBridge() { Process p; int r1 = p.runShellCommand("mkdir -p /usr/arduino-mqtt"); @@ -45,7 +45,7 @@ boolean YunMQTTClient::connect(const char * clientId) { } boolean YunMQTTClient::connect(const char * clientId, const char * username, const char * password) { - if(this->installBridge() == 0) { + if(this->updateBridge() == 0) { return false; } diff --git a/src/YunMQTTClient.h b/src/YunMQTTClient.h index 5802ed4..1b851bb 100644 --- a/src/YunMQTTClient.h +++ b/src/YunMQTTClient.h @@ -16,7 +16,7 @@ class YunMQTTClient { const char * willTopic = NULL; const char * willPayload = NULL; boolean alive = false; - int installBridge(); + int updateBridge(); public: YunMQTTClient(); void begin(const char * hostname); From a4bc9443c335674d96cb0ab19efc469724ea664a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:43:46 +0200 Subject: [PATCH 08/12] updated library --- yun/mqtt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yun/mqtt.py b/yun/mqtt.py index ec02cbd..9dfb0d8 100644 --- a/yun/mqtt.py +++ b/yun/mqtt.py @@ -264,7 +264,7 @@ def _socketpair_compat(): sock1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_IP) sock1.setblocking(0) try: - sock1.connect(("localhost", port)) + sock1.connect(("127.0.0.1", port)) except socket.error as err: if err.errno != errno.EINPROGRESS and err.errno != errno.EWOULDBLOCK and err.errno != EAGAIN: raise From 694c11a067e6710e90b93b6b279959315954299d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:47:49 +0200 Subject: [PATCH 09/12] update --- README.md | 2 +- examples/MQTTClient/MQTTClient.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 943f6b1..9096601 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ void setup() { void loop() { client.loop(); - // publish message roughly every second + // publish a message roughly every second. if(millis() - lastMillis > 1000) { lastMillis = millis(); client.publish("/hello", "world"); diff --git a/examples/MQTTClient/MQTTClient.ino b/examples/MQTTClient/MQTTClient.ino index ca7e5c3..d9be5c7 100644 --- a/examples/MQTTClient/MQTTClient.ino +++ b/examples/MQTTClient/MQTTClient.ino @@ -24,7 +24,7 @@ void setup() { void loop() { client.loop(); - // Publish a message roughly every second. + // publish a message roughly every second. if(millis() - lastMillis > 1000) { lastMillis = millis(); client.publish("/hello", "world"); From dc4411c2b72f79a239175cbe45801a9c8e66aaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:54:22 +0200 Subject: [PATCH 10/12] simplify --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9096601..57ec837 100644 --- a/README.md +++ b/README.md @@ -74,19 +74,14 @@ void messageReceived(String topic, String payload, char * bytes, unsigned int le ## API -Initialize the `MQTTClient` object using the hostname of the broker, the brokers port (default: `1883`) and the underlying Client class for network transport: +Initialize the object using the hostname of the broker, the brokers port (default: `1883`) and the underlying Client class for network transport: ```c++ -void MQTTClient::begin(const char * hostname, Client& client); -void MQTTClient::begin(const char * hostname, int port, Client& client); +void begin(const char * hostname, Client& client); +void begin(const char * hostname, int port, Client& client); ``` -Initialize the `YunMQTTClient` object using the hostname of the broker and the brokers port (default: `1883`): - -```c++ -void YunMQTTClient::begin(const char * hostname); -void YunMQTTClient::begin(const char * hostname, int port); -``` +_The special`YunMQTTClient` does not need the `client` parameter. Set the will message that gets registered on a connect: From 1ff448f33b4a8f6a1b205cdfaf692f789422df63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:54:40 +0200 Subject: [PATCH 11/12] fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 57ec837..23274dd 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ void begin(const char * hostname, Client& client); void begin(const char * hostname, int port, Client& client); ``` -_The special`YunMQTTClient` does not need the `client` parameter. +_The special`YunMQTTClient` does not need the `client` parameter._ Set the will message that gets registered on a connect: From 00732a3969d28f1770f0c48cf18f4fc492105f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=CC=88l=20Ga=CC=88hwiler?= Date: Tue, 29 Sep 2015 15:58:58 +0200 Subject: [PATCH 12/12] bump version --- README.md | 2 +- library.properties | 2 +- src/YunMQTTClient.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 23274dd..8a5a7d3 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The first release of the library only supports QoS0 and the basic features to ge This library is an alternative to the [pubsubclient](https://github.com/knolleary/pubsubclient) library by [knolleary](https://github.com/knolleary) which uses a custom protocol implementation. -[Download version 1.7.0 of the library.](https://github.com/256dpi/arduino-mqtt/releases/download/v1.7.0/mqtt.zip) +[Download version 1.8.0 of the library.](https://github.com/256dpi/arduino-mqtt/releases/download/v1.8.0/mqtt.zip) *Or even better use the newly available Library Manager in the Arduino IDE.* diff --git a/library.properties b/library.properties index c4d95fd..868c541 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=MQTT -version=1.7.0 +version=1.8.0 author=Joel Gaehwiler maintainer=Joel Gaehwiler sentence=MQTT library for Arduino based on the Eclipse Paho projects. diff --git a/src/YunMQTTClient.cpp b/src/YunMQTTClient.cpp index b6317b8..dc1ed0a 100644 --- a/src/YunMQTTClient.cpp +++ b/src/YunMQTTClient.cpp @@ -19,8 +19,8 @@ int YunMQTTClient::updateBridge() { Process p; int r1 = p.runShellCommand("mkdir -p /usr/arduino-mqtt"); - int r2 = p.runShellCommand("wget -N https://raw.githubusercontent.com/256dpi/arduino-mqtt/v1.7.0/yun/mqtt.py --no-check-certificate -P /usr/arduino-mqtt"); - int r3 = p.runShellCommand("wget -N https://raw.githubusercontent.com/256dpi/arduino-mqtt/v1.7.0/yun/bridge.py --no-check-certificate -P /usr/arduino-mqtt"); + int r2 = p.runShellCommand("wget -N https://raw.githubusercontent.com/256dpi/arduino-mqtt/v1.8.0/yun/mqtt.py --no-check-certificate -P /usr/arduino-mqtt"); + int r3 = p.runShellCommand("wget -N https://raw.githubusercontent.com/256dpi/arduino-mqtt/v1.8.0/yun/bridge.py --no-check-certificate -P /usr/arduino-mqtt"); boolean success = r1 == 0 && r2 == 0 && r3 == 0;