Skip to content

Commit a9dbfff

Browse files
committed
update
1 parent d68a479 commit a9dbfff

File tree

2 files changed

+8
-52
lines changed

2 files changed

+8
-52
lines changed

README.md

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# arduino-mqtt
22

3-
**paho mqtt library wrapper for arduino**
3+
**MQTT library for arduino based on the Eclipse Paho projects*
44

5-
This library bundles the [Embedded MQTT C/C++ Client](https://eclipse.org/paho/clients/c/embedded/) library of the eclipse paho project and adds a thin wrapper to get an Arduino like API.
5+
This library bundles the [Embedded MQTT C/C++ Client](https://eclipse.org/paho/clients/c/embedded/) library of the Eclipse Paho project and adds a thin wrapper to get an Arduino like API. Additionally there is an drop-in alternative for the Arduino Yùn that uses a python based client on the linux processor and a binary interface to lower resources usage on the Arduino side.
66

77
The first release of the library only supports QoS0 and the basic features to get going. In the next releases more of the features will be available.
88

@@ -16,52 +16,8 @@ This library is an alternative to the [pubsubclient](https://github.com/knollear
1616

1717
This library has been only tested on the **Arduino Yùn** yet. Other boards and shields should work if they properly extend the Client API.
1818

19-
## Example
19+
## Examples
2020

21-
```c++
22-
#include <Bridge.h>
23-
#include <YunClient.h>
24-
#include <MQTTClient.h>
25-
26-
YunClient net;
27-
MQTTClient client("connect.shiftr.io", 1883, net);
28-
29-
unsigned long lastMillis = 0;
30-
31-
void setup() {
32-
Bridge.begin();
33-
Serial.begin(9600);
34-
Serial.println("connecting...");
35-
if (client.connect("arduino", "demo", "demo")) {
36-
Serial.println("connected!");
37-
client.subscribe("/another/topic");
38-
// client.unsubscribe("/another/topic");
39-
} else {
40-
Serial.println("not connected!");
41-
}
42-
}
43-
44-
void loop() {
45-
client.loop();
46-
// publish message roughly every second
47-
if(millis() - lastMillis > 1000) {
48-
lastMillis = millis();
49-
client.publish("/topic", "Hello world!");
50-
}
51-
}
52-
53-
void messageReceived(String topic, String payload, char * bytes, unsigned int length) {
54-
Serial.print("incomming: ");
55-
Serial.print(topic);
56-
Serial.print(" - ");
57-
Serial.print(payload);
58-
Serial.println();
59-
}
60-
```
61-
62-
## Configuration
63-
64-
```c++
65-
// this buffer gets allocated two times to hold the outgoing and incomming message
66-
#define MQTT_BUFFER_SIZE 64 // default 128
67-
```
21+
- [Example using the standard MQTTClient]().
22+
- [Example using the alternative YunMQTTClient]().
23+
- [Sketch to install the YunMQTTClient python client script]().

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name=MQTT
22
version=1.3.2
33
author=Joel Gaehwiler <joel.gaehwiler@gmail.com>
44
maintainer=Joel Gaehwiler <joel.gaehwiler@gmail.com>
5-
sentence=Paho MQTT library wrapper for Arduino.
6-
paragraph=This library bundles the Embedded MQTT C/C++ Client library of the eclipse paho project and adds a thin wrapper to get an Arduino like API.
5+
sentence=MQTT library for arduino based on the Eclipse Paho projects.
6+
paragraph=This library bundles the Embedded MQTT C/C++ Client library of the Eclipse Paho project and adds a thin wrapper to get an Arduino like API. Additionally there is an drop-in alternative for the Arduino Yùn that uses a python based client on the linux processor and a binary interface to lower resources usage on the Arduino side.
77
url=https://github.com/256dpi/arduino-mqtt
88
architectures=*

0 commit comments

Comments
 (0)