eclipse-paho/paho.mqtt.embedded-c logo

eclipse-paho/paho.mqtt.embedded-c

Free

Paho MQTT C client library for embedded systems. Paho is an Eclipse IoT project (https://iot.eclipse.org/)

FreeFree tier
Type
Open Source
Company
Eclipse Foundation

About eclipse-paho/paho.mqtt.embedded-c

Eclipse Paho MQTT C/C++ client library designed for embedded platforms. Part of the Eclipse IoT project, it provides three sub-projects: MQTTPacket (low-level C library for MQTT packet serialization/deserialization), MQTTClient (higher-level C++ client with pluggable networking support for platforms like Linux, Arduino, and mbed), and MQTTClient-C (a C equivalent of the C++ client for platforms not supporting C++). The library is dual-licensed under EPL and EDL, allowing flexible use and distribution. Build via CMake with automated testing on Travis-CI. Includes samples, Doxygen documentation, and debug tracing via the MQTT_DEBUG preprocessor definition.

Key Features

Three sub-projects: MQTTPacket (low-level serialization), MQTTClient (C++ with pluggable networking), MQTTClient-C (C equivalent)
Dual-licensed under EPL and EDL for flexible use and distribution
Pluggable networking support in C++ client: Linux, Arduino, mbed
CMake-based build system with automated Travis-CI testing
Debug tracing of MQTT packets via MQTT_DEBUG preprocessor definition
Porting guide and sample code provided for integration
Doxygen configuration files for API documentation

Pros & Cons

Pros
  • Lightweight and minimal dependencies, especially MQTTPacket
  • Supports both C and C++, accommodating diverse embedded toolchains
  • Part of the well-established Eclipse Paho project with community support
  • Dual-license (EPL/EDL) eases integration into proprietary projects
  • Documentation including samples, porting guide, and Doxygen
Cons
  • MQTTPacket requires user to implement network I/O; no built-in transport
  • C++ client may not be suitable for platforms lacking C++ compilers
  • Limited to MQTT protocol; no support for other IoT messaging protocols

Best For

Embedded IoT devices requiring MQTT communicationResource-constrained platforms (Arduino, mbed) wanting a lightweight MQTT clientLinux-based embedded systems needing C or C++ MQTT supportPrototyping and production use in Eclipse IoT ecosystem

FAQ

What are the main sub-projects in this library?
There are three: MQTTPacket (low-level serialization/deserialization), MQTTClient (higher-level C++ with pluggable networking), and MQTTClient-C (a C equivalent of MQTTClient).
What license is used?
The library is dual-licensed under the Eclipse Public License (EPL) and Eclipse Distribution License (EDL). You can choose which license to use.
Which platforms are supported?
The C++ client includes networking implementations for Linux, Arduino, and ARM mbed. The C client is designed for platforms not supporting C++. The low-level MQTTPacket can be used on any platform with a C compiler.
How do I build the library?
Use CMake: create a build directory, run cmake .., then make. A Travis-CI configuration is included for automated build testing on Linux.
Is there debugging/tracing support?
Yes, set the MQTT_DEBUG preprocessor definition to enable debug tracing of MQTT packets sent and received.