[209] | 1 | # Arduino Client for MQTT
|
---|
| 2 |
|
---|
| 3 | This library provides a client for doing simple publish/subscribe messaging with
|
---|
| 4 | a server that supports MQTT.
|
---|
| 5 |
|
---|
| 6 | ## Examples
|
---|
| 7 |
|
---|
| 8 | The library comes with a number of example sketches. See File > Examples > PubSubClient
|
---|
| 9 | within the Arduino application.
|
---|
| 10 |
|
---|
| 11 | Full API documentation is available here: http://pubsubclient.knolleary.net
|
---|
| 12 |
|
---|
| 13 | ## Limitations
|
---|
| 14 |
|
---|
| 15 | - It can only publish QoS 0 messages. It can subscribe at QoS 0 or QoS 1.
|
---|
| 16 | - The maximum message size, including header, is **128 bytes** by default. This
|
---|
| 17 | is configurable via `MQTT_MAX_PACKET_SIZE` in `PubSubClient.h`.
|
---|
| 18 | - The keepalive interval is set to 15 seconds by default. This is configurable
|
---|
| 19 | via `MQTT_KEEPALIVE` in `PubSubClient.h`.
|
---|
| 20 | - The client uses MQTT 3.1.1 by default. It can be changed to use MQTT 3.1 by
|
---|
| 21 | changing value of `MQTT_VERSION` in `PubSubClient.h`.
|
---|
| 22 |
|
---|
| 23 |
|
---|
| 24 | ## Compatible Hardware
|
---|
| 25 |
|
---|
| 26 | The library uses the Arduino Ethernet Client api for interacting with the
|
---|
| 27 | underlying network hardware. This means it Just Works with a growing number of
|
---|
| 28 | boards and shields, including:
|
---|
| 29 |
|
---|
| 30 | - Arduino Ethernet
|
---|
| 31 | - Arduino Ethernet Shield
|
---|
| 32 | - Arduino YUN â use the included `YunClient` in place of `EthernetClient`, and
|
---|
| 33 | be sure to do a `Bridge.begin()` first
|
---|
| 34 | - Arduino WiFi Shield - if you want to send packets > 90 bytes with this shield,
|
---|
| 35 | enable the `MQTT_MAX_TRANSFER_SIZE` define in `PubSubClient.h`.
|
---|
| 36 | - Sparkfun WiFly Shield â [library](https://github.com/dpslwk/WiFly)
|
---|
| 37 | - TI CC3000 WiFi - [library](https://github.com/sparkfun/SFE_CC3000_Library)
|
---|
| 38 | - Intel Galileo/Edison
|
---|
| 39 | - ESP8266
|
---|
| 40 |
|
---|
| 41 | The library cannot currently be used with hardware based on the ENC28J60 chip â
|
---|
| 42 | such as the Nanode or the Nuelectronics Ethernet Shield. For those, there is an
|
---|
| 43 | [alternative library](https://github.com/njh/NanodeMQTT) available.
|
---|
| 44 |
|
---|
| 45 | ## License
|
---|
| 46 |
|
---|
| 47 | This code is released under the MIT License.
|
---|