thewesdev/mqtt

0.0.2

Latest
uploaded 3 hours ago
Simple MQTT component for ESP32

Readme

# MQTT

## Features

- mqtt client init and start against a configurable broker URI
- publish, subscribe and unsubscribe helpers with QoS level support
- connection/publish/subscribe event logging
- optional c++ wrapper

## Menuconfig

```bash
idf.py menuconfig
```

### Path

Component config -> MQTT

### Default Configs

| MQTT       | Type   | Macro                   | Values                             |
| ---------- | ------ | ----------------------- | ---------------------------------- |
| Broker URI | string | CONFIG_MQTT_BROKER_URI  | "mqtt://broker.mqttdashboard.com"  |

## Installation

### IDF Component Registry

```bash
idf.py add-dependency thewesdev/mqtt
```

### Github

```bash
git clone https://github.com/thewesdev/mqtt
```

## Code Examples

### C

```c
#include "mqtt.h"

void app_main(void) {
	mqtt_start();
	mqtt_sub("test/topic", 0);
	mqtt_pub("test/topic", "hello", 0);
}
```

### Cpp

```cpp
#include "mqtt.hpp"

extern "C" void app_main(void) {
	mqtt::start();
	mqtt::sub("test/topic", 0);
	mqtt::pub("test/topic", "hello", 0);
}
```

Links

Supports all targets

To add this component to your project, run:

idf.py add-dependency "thewesdev/mqtt^0.0.2"

download archive

Stats

  • Archive size
    Archive size ~ 3.74 KB
  • Downloaded in total
    Downloaded in total 0 times
  • Downloaded this version
    This version: 0 times

Badge

thewesdev/mqtt version: 0.0.2
|