Questions tagged [libmosquitto]

MQTT client library maintained by Eclipse IoT project. It is written in C language.

Read Eclipse Mosquitto project overview. This MQTT client library is developed as part of Eclipse IoT mosquitto project. The client header file mainly used is mosquitto.h(1)

  1. This library also has bindings in languages like C++(mosquittopp) and Python. Those bindings are also covered under this tag.
  2. This library is different from the client library provided by Eclipse Paho project and so queries related to Paho client and it's bindings( e.g. mqttpp ) should not use this tag.
77 questions
12
votes
2 answers

MQTT C++ client

I'd like to implement an MQTT client functionality in C++ (it needs to be thread-safe, and be able to subscribe to topics and also publish, but no broker functionality is needed). I was considering Paho MQTT by Eclipse. Here is their download…
Daniel
  • 2,318
  • 2
  • 22
  • 53
9
votes
2 answers

Mosquitto vs eclipse paho client library

I'm just looking into the details of Eclipse PAHO and Mosquitto client libraries (MQTT C++ libraries). It looks like the PAHO uses the mosquitto MQTT broker but provides its own MQTT client libraries. Also the Mosquitto library provides a way to…
Panch
  • 1,097
  • 3
  • 12
  • 43
8
votes
2 answers

Difference between port and listener in MQTT

I have installed mosquitto client for MQTT on my local machine. I have below configuration: listener 1883 protocol mqtt listener 9001 protocol websockets What is the difference between running client on mqtt and websockets. Also what is the…
Aquarius24
  • 1,806
  • 6
  • 33
  • 61
5
votes
4 answers

mosquitto_pub problem setting TLS options

I am following https://aws.amazon.com/blogs/iot/just-in-time-registration-of-device-certificates-on-aws-iot/ and have a problem when executing the following command: $ mosquitto_pub --cafile root.cert --cert deviceCertAndCACert.crt --key…
Charles Ju
  • 1,095
  • 1
  • 9
  • 28
3
votes
1 answer

MQTT dynamic security plugin API control - client/role/group management using publish/subscribe commands

I am using the built-in security-plugin from Mosquitto to define access to my broker. So far I've set clients, roles and groups using mosquitto_ctrl dynsec ... commands. (see mosquitto) The broker is running in a…
lukkaz
  • 35
  • 6
3
votes
1 answer

How to create Mosquitto MQTT custom plugin?

I've just started learning Mosquitto recently. I need to create a custom event handler (on client connect and on message received) that will be built in Mosquitto and run on server as a bundle. The idea is not in using separate program (client)…
3
votes
1 answer

How to connect to mqtt broker using libmosquitto and SSL/TLS in C++

I'm trying to subscribe to an mqtt broker which uses SSL/TLS to authenticate clients. I use libmosquitto to do that. I run this code to perform a subscription #include #include #include #include…
Luca
  • 61
  • 1
  • 7
3
votes
2 answers

How to configure mosquitto broker to increase the disconnection time to mqtt clients?

The mqtt documentation explains that the maximum value of the keepalive is 18 hours 12 minutes and 15 seconds. But the mosquitto server disconnects the clients if it does not receive messages before 60 seconds plus a tolerance of 30 seconds that is…
E. Ortiz
  • 53
  • 1
  • 1
  • 4
3
votes
1 answer

libmosquittopp - sample client hangs on loop_stop() method

I'm trying to create a simple MQTT client for my home application and I'm using libmosquittopp (which is C++ version of libmosquitto). There is not much of a documentation for this library, but I found 2 examples (here and here) that helped me to…
lewiatan
  • 1,126
  • 2
  • 21
  • 37
2
votes
1 answer

Who sends pings in MQTT?

The keepalive feature in MQTT helps detecting connection problems. That is, if the broker has not received any data from the client in 1.5 * keepalive seconds, it considers the client disconnected. But who should send periodic pings when keepalive…
Alexandr Zarubkin
  • 899
  • 1
  • 11
  • 26
2
votes
1 answer

How can I install the Mosquitto-php in Laradock

Mosquitto-php extension: https://github.com/mgdm/Mosquitto-PHP. I tried to add 2 below commands in the laradock/php-fpm/Dockerfile, but it didn't work. apt-get install libmosquitto-dev && \ pecl install Mosquitto-alpha please give me some advices,…
Amos Wu
  • 23
  • 4
2
votes
0 answers

Why on mosquitopp client on_subscribe is called instead of on_message when receiving a message?

I'm trying to set up a mosquitto client to collect and log mqtt messages from my iot device which constantly sends it's gps data. I'm using eclipse mosquitto with cpp wraper for this task. I am sure that my device delivers data to broker, because on…
KugisMugis
  • 143
  • 1
  • 4
2
votes
4 answers

Mosquitto - subscribe to one broker and push to another using C

Is it possible and if so how to archive it that one application using libmosquitto get messages from one broker and publish it to another? Its pretty simple to just change topic in mosquito_publish function, but set of broker takes place in…
pzydziak
  • 89
  • 1
  • 2
  • 10
2
votes
1 answer

mosquitto_publish returns MOSQ_ERR_SUCCESS eventhough MQTT broker is not running

I connected to MQTT broker using Mosquitto C client libraray. I used below code for connection. ret = mosquitto_connect (mosq, MQTT_HOSTNAME, MQTT_PORT, 0); After connecting to broker I stopped the broker service. Now I tried to publish message…
user369287
  • 692
  • 8
  • 28
2
votes
1 answer

how can I create my own plugin for mosquitto broker?

How can I make a plugin like mosquitto-auth-plug for authorization, or one for storing message payloads or other usages? Should I write it in C or can I use python?
Masoud Aghaei
  • 1,113
  • 2
  • 15
  • 27
1
2 3 4 5 6