Skip to content

An early look at the MQTT client module of the Unified Prototyping Toolkit (UPT)

License

Notifications You must be signed in to change notification settings

Sensirion/arduino-upt-mqtt-client

Repository files navigation

Sensirion UPT MQTT Client

PlatformIO Registry

Arduino library for publishing UPT Measurements to an MQTT broker.
It offers conveninence method to publish UPT Measurements while simplifying the interface to the ESP-IDF mqtt_client library. Optionally it can handle Wi-Fi connectivity.

Not working in Arduino IDE because of a mismatch in arduino-esp32 versions.

Getting started

Recommended Hardware

This project was developed and tested on Espressif ESP32 DevKitC and Lilygo T-Display S3 hardware.

IDE

PlatformIO (recommended)

We recommend using the PlatformIO VSCode extension to compile and flash the code in this example. You will find more instructions here

Arduino IDE

It currently not possible to use this library with Arduino IDE.

Since the used arduino-esp32 is 3+ (based on ESP-IDF 5+) which introduced breaking changes and is unavailable for PlatformIO.

Usage examples

Two example scripts are available in the examples folder:

  • delegatedWifiUsage: In this example the main application delegates the WiFi management to the MQTT client. Such approach should be used if your application does no use Wi-Fi overwise and you do not want any fancy Wi-Fi configuration.

  • selfManagedWifiUsage: In this example the main application will handle the WiFi management, and the MQTT client will not care about it. Such approach should be used in most cases since your application will likely use WiFi for other things.

API reference

You will find a more detailed API guide here

overview_schema

Dependencies

This library uses the following dependencies.

Caution: The version of ESP-IDF used by PlatformIO is v4.4.7 ! Not 5.x.x ...