Paho based lightweight MQTT client daemon for embedded linux
$ 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.
| argument | required | description |
|---|---|---|
| --host | x | host name. |
| --port | default is 1883. | |
| --version | protocol version of MQTT. 3 (3.1) or 4 (3.1.1). 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. otherwise, message is written to /var/tmp/mqttcd.log or syslog (if enabled) |
|
| --handler | handler for received payload. "nop": default behavior. mqttcd does not execute handler. "string": mqttcd pass topic name and received payload to "default" script of handler directory. |
|
| --handler_dir | default is /path/to/current/dir/handlers |