Async MQTT client for CPython and MicroPython with asyncio support.
// momentum
// why it's here
- Active: last commit today
- Built almost entirely by one person
- Health 100/100 with only 21 stars
// how to help
// readme
aiomqttc - Asynchronous MQTT Client
An asynchronous MQTT client implementation compatible with both standard Python and MicroPython environments, particularly optimized for ESP32 platforms.
Tested with version 1.2.1:
| Runtime | Unit tests | MQTT conformance and interoperability |
|---|---|---|
| CPython 3.13 | yes | yes |
| MicroPython 1.29.0, unix port | yes | yes |
| MicroPython 1.29.0, ESP32-P4 over Wi-Fi | yes | yes |
Earlier code was also run on an ESP32-P4 with MicroPython 1.27.0 and on the unix port of MicroPython 1.26.0. See CONFORMANCE.md for the conformance matrix.
Features
- Fully asynchronous operation using Pythonβs
asyncio - Support for both CPython and MicroPython runtimes
- Automatic reconnection with configurable backoff strategy
- QoS 0 and QoS 1 message support
- SSL/TLS connection support
- Topic subscription and message callback handling
- Keep-alive and ping management
- Clean connection termination
Development Setup
This project uses pre-commit to enforce code quality using Ruff.
Install it once: