ncmqtt
is a command-line tool for sharing data over MQTT.
- Manuele Conti ([email protected])
- Alessio Antoniazza ([email protected])
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
This code is made available on the understanding that it will not be used in safety-critical situations without a full and competent review.
- CMake 3.16 or higher
- C compiler (e.g., gcc)
- Eclipse Paho MQTT C client library
To build the ncmqtt
project, follow these steps:
-
Clone the repository:
git clone <repository_URL> cd ncmqtt
-
Set the Path to Paho MQTT Library:
- You can set the path to the Paho MQTT library using the
PAHO_MQTT_DIR
variable when configuring the project with CMake. - If
PAHO_MQTT_DIR
is not set, CMake will attempt to find the Paho MQTT library using thefind_package
command.
- You can set the path to the Paho MQTT library using the
- Create and navigate to the
build
directory:mkdir build cd build
- Run
cmake
with thePAHO_MQTT_DIR
set to the path of your Paho MQTT C library:cmake -DPAHO_MQTT_DIR=/path/to/paho.mqtt.c ..
- Build the project:
make
- Create and navigate to the
build
directory:mkdir build cd build
- Run
cmake
without setting thePAHO_MQTT_DIR
:cmake ..
- Build the project:
make
The ncmqtt
command supports various options to configure its behavior:
Usage: ncmqtt [<options>]
-h : show this help message
-v : show version
-T : topic for sharing messages: default = nc_channel_pub
-l : enable listening to incoming messages
-S : set server host : default = test.mosquitto.org
-P : set server port : default = 1883
-A : set server auth = user,pwd