Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jcosentino11/mqtt-client

A simple MQTT Client, written in C++
https://github.com/jcosentino11/mqtt-client

cpp mqtt-client

Last synced: about 5 hours ago
JSON representation

A simple MQTT Client, written in C++

Awesome Lists containing this project

README

        

# MQTT Client

Bare-bones MQTT CLI for Mac and Linux.

This project is a personal learning exercise, for diving into MQTT internals and network programming. You can read more about my experience [on my website](https://josephcosentino.me/posts/mqtt-client/).

## Publish to a topic
```
mqtt pub -t hello/topic -a localhost:1883 -c clientId '{"hello": "world"}'
```

```
Usage: mqtt pub [-v] -t -a

-c
Options:
-t, --topic Specify the topic to publish to (required)
-a, --address
[:] address to connect to (required)
-c, --client-id Client identifier
-v, --verbose Enable verbose output
-h, --help Show this help message
```

## Subscribe to a topic

```
mqtt sub -t hello/topic -a localhost:1883 -c clientId
```

```
Usage: mqtt sub [-v] -t -a

-c
Options:
-t, --topic Specify the topic to publish to (required)
-a, --address
[:] address to connect to (required)
-c, --client-id Client identifier
-v, --verbose Enable verbose output
-h, --help Show this help message
```

## Features

| | Supported | Planned |
|-------------------------|-----------|---------|
| MQTT3 | x | |
| MQTT5 | | x |
| QOS0 | x | |
| QOS1 | x | |
| QOS2 | | x |
| PUBLISH | x | |
| SUBSCRIBE | x | |
| Various CONNECT options | | x |
| SSL | | x |

## Related Projects

Here are some real-world MQTT clients to check out:

* [MQTTX](https://mqttx.app/cli)
* [mosquitto_pub/sub](https://mosquitto.org/man/)