Skip to the content.

MycilaMQTT

License: MIT Continuous Integration PlatformIO Registry

A simple and efficient MQTT helper for Arduino / ESP32 based on Espressif MQTT Client

Usage

  mqtt.onConnect([]() {
    Serial.println("MQTT connected");
  });

  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());
  });

  mqtt.begin();
  mqtt.publish("my-app/value", "Hello World!");