<commit_before>mqttcd
======

[Paho](https://eclipse.org/paho/clients/c/embedded/) based lightweight MQTT client daemon for embedded linux

How to build
------------

```
$ git clone https://github.com/lostman-github/mqttcd
$ cd mqttcd
$ git submodule init
$ git submodule update
$ make
```

if execute make command with `ENABLE_SYSLOG=1` , destination of output is changed to syslog when daemonized.

Command line arguments
----------------------

| argument      | required | description           |
| ------------- | -------- | --------------------- |
| --host        | x        |                       |
| --port        |          | default is 1883.      |
| --version     |          | protocol version of MQTT.<br>3 ([3.1](http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html)) or 4 ([3.1.1](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html)). default is 4. |
| --client_id   |          | if this argument is not specified, hostname is used as client id. |
| --username    |          | default is empty.     |
| --password    |          | default is empty.     |
| --topic       | x        |                       |
| --daemonize   |          | if this argument is not specified, received message is written to current terminal.<br>otherwise, message is written to /var/tmp/mqttcd.log or syslog (if enabled) |
| --handler     |          | handler for received payload.<br>"nop": default behavior. mqttcd does not execute handler.<br>"string": mqttcd pass topic name and received payload to "default". |
| --handler_dir |          | default is /path/to/current/dir/handlers |<commit_msg>fix readme<commit_after>mqttcd
======

[Paho](https://eclipse.org/paho/clients/c/embedded/) based lightweight MQTT client daemon for embedded linux

How to build
------------

```
$ git clone https://github.com/lostman-github/mqttcd
$ cd mqttcd
$ git submodule init
$ git submodule update
$ make
```

if execute make command with `ENABLE_SYSLOG=1` , destination of output is changed to syslog when daemonized.

Command line arguments
----------------------

| argument      | required | description           |
| ------------- | -------- | --------------------- |
| --host        | x        | host name.            |
| --port        |          | default is 1883.      |
| --version     |          | protocol version of MQTT.<br>3 ([3.1](http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html)) or 4 ([3.1.1](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html)). default is 4. |
| --client_id   |          | if this argument is not specified, hostname is used as client id. |
| --username    |          | default is empty.     |
| --password    |          | default is empty.     |
| --topic       | x        | topic name.           |
| --daemonize   |          | if this argument is not specified, received message is written to current terminal.<br>otherwise, message is written to /var/tmp/mqttcd.log or syslog (if enabled) |
| --handler     |          | handler for received payload.<br>"nop": default behavior. mqttcd does not execute handler.<br>"string": mqttcd pass topic name and received payload to "default" script of handler directory. |
| --handler_dir |          | default is /path/to/current/dir/handlers |
{'fraction_non_alphanumeric': 0.1699664940603107, 'fraction_numerical': 0.01279317697228145, 'mean_word_length': 1.9452914798206278, 'pattern_counts': {'":': 4, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6376989', 'n_tokens_mistral': 1006, 'n_tokens_neox': 967, 'n_words': 279}