PHPackages                             domotruc/mqttgen - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. domotruc/mqttgen

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

domotruc/mqttgen
================

MQTT message flow generator

v1.2.1(7y ago)0432AGPL-3.0PHPPHP ^7.0

Since Jun 24Pushed 7y agoCompare

[ Source](https://github.com/domotruc/mqttgen)[ Packagist](https://packagist.org/packages/domotruc/mqttgen)[ RSS](/packages/domotruc-mqttgen/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

MqttGen - Generation and replay of MQTT messages
================================================

[](#mqttgen---generation-and-replay-of-mqtt-messages)

*MqttGen* is an MQTT message generator.

*MqttGen* can be used to create MQTT message flow to test applications using the MQTT protocol. It was created to test the [jMQTT Jeedom plugin](https://github.com/domotruc/jMQTT).

*MqttGen* comes with two tools:

- *mqttgen* which is a kind of MQTT simulator allowing to send and receive messages. Behaviour is defined in a JSON input file.
- *mqttplay* which allows to replay a MQTT flow previously recorded thanks to an MQTT client such as mosquitto\_sub.

Installation
------------

[](#installation)

The recommended way to install *MqttGen* is through [Composer](http://getcomposer.org).

```
composer require domotruc/mqttgen
```

Usage of mqttgen
----------------

[](#usage-of-mqttgen)

### As a standalone application

[](#as-a-standalone-application)

```
vendor/bin/mqttgen your_json_input_file.json
```

To run the provided example, execute the following from the directory containing the `composer.json` file:

```
vendor/bin/mqttgen vendor/domotruc/mqttgen/topics.json
```

### As a library

[](#as-a-library)

Following file is assumed to be in the same directory as your `composer.json` file.

```
