MycilaMQTT
A simple and efficient MQTT helper for Arduino / ESP32 based on Espressif MQTT Client
- Automatic reconnect
- Automatic resubscribe
- Dead simple configuration which allows easier integration with a configuration system and quick reload (
end()
andbegin()
) of the client - automatic management of will topic
- Arduino 3 (ESP-IDF 5.1) Support
Usage
Mycila::MQTT.onConnect([]() {
Serial.println("MQTT connected");
});
Mycila::MQTT.subscribe("my-app/value/set", [](const String& topic, const String& payload) {
Serial.printf("MQTT message received: %s -> %s\r\n", topic.c_str(), payload.c_str());
});
Mycila::MQTT.begin();
Mycila::MQTT.publish("my-app/value", "Hello World!");