• Stars
    star
    3,632
  • Rank 12,183 (Top 0.3 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 16 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A client library for the Arduino Ethernet Shield that provides support for MQTT.

Arduino Client for MQTT

This library provides a client for doing simple publish/subscribe messaging with a server that supports MQTT.

Examples

The library comes with a number of example sketches. See File > Examples > PubSubClient within the Arduino application.

Full API documentation is available here: https://pubsubclient.knolleary.net

Limitations

  • 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).
  • 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).
  • 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.

Compatible Hardware

The library uses the Arduino Ethernet Client api for interacting with the underlying network hardware. This means it Just Works with a growing number of boards and shields, including:

  • Arduino Ethernet
  • Arduino Ethernet Shield
  • 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.
  • Sparkfun WiFly Shield – library
  • TI CC3000 WiFi - library
  • Intel Galileo/Edison
  • ESP8266
  • ESP32

The library cannot currently be used with hardware based on the ENC28J60 chip – such as the Nanode or the Nuelectronics Ethernet Shield. For those, there is an alternative library available.

License

This code is released under the MIT License.

More Repositories

1

node-red-in-production-workshop

This workshop takes you through how to setup a Node-RED environment suitable for creating cloud-native applications. It was first delivered as a part of NodeConfEU 2019
24
star
2

twitter-to-mqtt

A python daemon that uses the Twitter Streaming API to access tweets and republishes them to an MQTT topic.
Python
16
star
3

node-red-workshop-photobooth

Dockerfile
12
star
4

puck-remote

A simple example of using a Puck.js button as a remote control.
JavaScript
9
star
5

node-red-todo-app

A Todo-Backend implementation using Node-RED and CouchDB. A sample application for https://github.com/knolleary/node-red-in-production-workshop
JavaScript
8
star
6

node-red-nodes-workshop

8
star
7

amazing

Django app for a Little Printer publication that generates a random maze with each edition
Python
7
star
8

node-red-workshop-photobooth-project

Dockerfile
3
star
9

wp-knolleary-theme

The wordpress theme for knolleary.net
PHP
3
star
10

node-red-demo-4

2
star
11

knolleary.github.io

Source for knolleary.net
JavaScript
2
star
12

node-red-resin-sensehat-demo

Dockerfile
2
star
13

wp-knolleary-funcs

A collection of useful wordpress-based functions used on knolleary.net
PHP
2
star
14

multi-channel-orb

Slowly turning an old idea into a Thing
Arduino
2
star
15

bleep-the-tjbot

The various bits and pieces I have put together to make Bleep the TJBot.
2
star
16

soreport

Django app for a Little Printer publication that generates a daily report on your Stack Overflow activity
Python
1
star
17

appsody-node-red-stack

A POC Appsody Stack for building Node-RED applications
JavaScript
1
star
18

kallisto

JavaScript
1
star
19

aws-photo-sync

A set of scripts and things to handle uploading photos to S3, and thumbnailing them when they're up there.
Python
1
star
20

flow-library-redux

JavaScript
1
star