# knolleary/pubsubclient

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/knolleary-pubsubclient).**

4,010 stars · 1,506 forks · C++ · MIT

## Links

- GitHub: https://github.com/knolleary/pubsubclient
- Homepage: http://pubsubclient.knolleary.net/
- awesome-repositories: https://awesome-repositories.com/repository/knolleary-pubsubclient.md

## Description

This project is a lightweight MQTT client library for Arduino boards, specifically designed for embedded systems utilizing an Ethernet Shield. It functions as an embedded messaging client that allows hardware devices to publish and subscribe to topics on a remote message broker.

The library provides core MQTT integration, including broker connection management and the maintenance of server heartbeats. It supports topic-based message publishing and subscription management, enabling the registration of listeners to trigger functions upon message arrival.

The system covers network connection configuration, such as buffer sizes and socket timeouts, alongside client state monitoring to identify failed connection attempts. It implements a non-blocking execution loop to process incoming packets and manage network transport.

## Tags

### Hardware & IoT

- [Arduino MQTT Clients](https://awesome-repositories.com/f/hardware-iot/arduino-mqtt-clients.md) — Provides a lightweight MQTT client implementation specifically for Arduino boards with Ethernet shields.
- [PubSub IoT Messaging](https://awesome-repositories.com/f/hardware-iot/hardware-device-integration/iot-message-handlers/pubsub-iot-messaging.md) — Implements a publish and subscribe messaging pattern for IoT devices to exchange information.
- [Remote Telemetry Reporting](https://awesome-repositories.com/f/hardware-iot/hardware-sensor-monitoring/remote-telemetry-reporting.md) — Enables sending sensor readings from an Ethernet shield to a remote dashboard using MQTT.
- [Physical Hardware Control](https://awesome-repositories.com/f/hardware-iot/physical-hardware-control.md) — Enables triggering physical actions on a microcontroller by sending command messages over MQTT.

### Data & Databases

- [MQTT Broker Connections](https://awesome-repositories.com/f/data-databases/redis-clients/cluster-connectivity/message-broker-connectivity/mqtt-broker-connections.md) — Manages TCP connections to MQTT brokers and negotiates protocol versions for messaging. ([source](https://cdn.jsdelivr.net/gh/knolleary/pubsubclient@master/README.md))
- [Subject Subscription Filtering](https://awesome-repositories.com/f/data-databases/data-stream-subscriptions/subject-subscription-filtering.md) — Allows registering interest in MQTT topics using string identifiers to filter incoming data streams.

### Networking & Communication

- [Client-to-Client Messaging](https://awesome-repositories.com/f/networking-communication/communication-platforms-services/messaging-notification-systems/messaging-services/message-broker-infrastructure/publish-subscribe-messaging/client-to-client-messaging.md) — Provides a client-side implementation for publish-subscribe communication between hardware devices and brokers.
- [MQTT Clients](https://awesome-repositories.com/f/networking-communication/communication-platforms-services/messaging-notification-systems/messaging-services/message-broker-infrastructure/publish-subscribe-messaging/mqtt-clients.md) — Implements the MQTT client protocol for publishing and subscribing to messages via a broker.
- [MQTT Topic Publishing](https://awesome-repositories.com/f/networking-communication/messaging-notifications/cloud-topic-publishing/mqtt-topic-publishing.md) — Enables sending data to specific topics using standard payloads or memory-stored messages. ([source](http://pubsubclient.knolleary.net/api))
- [Socket Networking](https://awesome-repositories.com/f/networking-communication/socket-networking.md) — Establishes a persistent TCP socket connection with a remote MQTT broker via hardware interfaces.
- [Topic Subscription Management](https://awesome-repositories.com/f/networking-communication/topic-subscription-management.md) — Manages the registration of interests in specific communication topics to receive messages. ([source](http://pubsubclient.knolleary.net/api))
- [Connection State Management](https://awesome-repositories.com/f/networking-communication/tcp-connection-lifecycles/connection-state-management.md) — Tracks the internal client state to manage reconnections and publishing permissions.
- [Heartbeat Frames](https://awesome-repositories.com/f/networking-communication/tcp-connection-lifecycles/tcp-connection-acceptance/application-level-connection-acceptance/heartbeat-frames.md) — Implements application-level keep-alive heartbeats to maintain persistent connections with the MQTT broker. ([source](http://pubsubclient.knolleary.net/api))

### Software Engineering & Architecture

- [Non-Blocking Event Loops](https://awesome-repositories.com/f/software-engineering-architecture/non-blocking-event-loops.md) — Utilizes a non-blocking event loop to process network packets and maintain the MQTT heartbeat.
- [Callback-Based Event Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/callback-based-event-dispatchers.md) — Provides a system to route incoming MQTT messages to application-defined callback functions.

### Part of an Awesome List

- [MQTT Libraries and Brokers](https://awesome-repositories.com/f/awesome-lists/data/mqtt-libraries-and-brokers.md) — MQTT client for Arduino Ethernet Shield.
