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
0
votes
0 answers

LWT message arrives at the wrong time (broker Mosquitto)

There is a code in which I publish and receive messages from the device. The problem is that if the device suddenly loses connection, the lwt arrives only 5 minutes after the device's connection is broken. Life time 30 sec. test.py: import…
Kate12345
  • 11
  • 1
  • 6
0
votes
1 answer

Mosquitto.h does not define "struct mosquitto" contents

As far as I understood, when client connects, I must check for session being persistent, and if it is not, perform subscribe to the topics of interest. I am using Mosquitto version 1.5. I did not find a way to check for this property using API…
Anonymous
  • 561
  • 3
  • 7
  • 24
0
votes
1 answer

Why libmosquitto publlish callback is called before connection callback?

I have this program using the mosquitto MQTT library: /* compile using: $ gcc -o libmosq libmosq.c -lmosquitto */ #include #include #include #include #include void…
fgalan
  • 11,732
  • 9
  • 46
  • 89
0
votes
1 answer

What does it mean that data is prepared in the function of mosquitto_want_write()?

According to the API, the mosquitto_want_write() function returns TRUE when data to be used in the socket is prepared. But what does it mean to have data ready? Where is the data being prepared? What function call can prepare the data? Is the data…
lalalalz
  • 3
  • 1
0
votes
2 answers

Escaping spaces in LIBS path Makefile

I'm trying to include Eclipse Mosquitto library sample mosquitto example from here I'm trying to use a Makefile to build and compile the code. I'm facing an issue where the compiler/linker/whatsoever cannot find the mosquitto library located at…
hweiu321
  • 103
  • 4
  • 14
0
votes
1 answer

How can I detect problems with user/password in the connection to MQTT broker at connection time using the libmosquitto library?

I'm testing MQTT mosquitto library with this small program: /* compile using: $ gcc -o libmosq libmosq.c -lmosquitto */ #include #include #include #include int main(int argc, char *argv[]) { …
fgalan
  • 11,732
  • 9
  • 46
  • 89
0
votes
1 answer

Can't update mosquitto-clients from 1.4.15 to 1.6.9

To update mosquitto-clients, I have tried sudo apt-get update sudo apt-get install mosquitto-clients However, this doesn't update the version for me. Reading package lists... Done Building dependency tree Reading state information...…
phoenix
  • 1
  • 1
0
votes
1 answer

Yocto, how to add libmosquitto in Target

The Open Embedded Mosquitto recipe installs mosquitto as a deamon, but there is no libmosquitto.so on the Target. How can I modify the recipe to install the libs? Already created mosquitto_%.bbappend and try to extend the do_install function with…
Lumpi
  • 98
  • 1
  • 9
0
votes
1 answer

How to use libmosquitto to make a request and get response using MQTT v5?

I'm trying to use libmosquitto to make a request (publish to a 'test/topic' topic) and I want to get a response based on the client (sender) id. So that means the client will publish to 'test/topic' and it will automatically subscribe…
basilisk
  • 1,156
  • 1
  • 14
  • 34
0
votes
0 answers

Python MQTT: accumulate message reads in DataFrame and save periodically

I am trying to read sensor measurements (published from another device) with MQTT and store the reads of a week in a pandas DataFrame, once such dataframe is empty I would like to save it to a .csv file and start filling a new empty dataframe. An…
mccoy89
  • 21
  • 6
0
votes
1 answer

dup flag not available in libmosquitto

I was working on a code using libmosquitto v3.1.x and I couldn't find a method to capture the dup flag of a message. Nb1: From my understanding dup flag indicates that the message was already send but was not acknowledged by recipient. Nb2: I was…
PunyCode
  • 373
  • 4
  • 18
0
votes
1 answer

How to accumulate messages as mqtt client for 1 second, then save it to a file

my problem is as follows: I wrote a program that subscribes to a topic, where 2 dictionaries with one key respectively arrive more times a second. On every message they change their value. I save those dictionaries in a big buffer-dictionary called…
Art3mis
  • 35
  • 1
  • 5
0
votes
1 answer

How to determinate ID client when receive message?

I'm setting my MQTT devices. My code to send from ESP8266 + NodeMCU v2 is something like that: client.publish(ANSWER_TEMPERATURE_TOPIC, buffer); Where ANSWER_TEMPERATURE_TOPICis "answer/node_1/temperature" and buffer is for example 22.10. I set my…
David J.
  • 23
  • 1
  • 4
0
votes
1 answer

Connecting to Azure IoT hub using MQTT libmosquitto C SDK

I am trying to connect to Azure IoT hub by using libmosquitto sdk using following code. struct mosquitto *mosq_Connection_1; bool mosq_ConnectionStatus_1; void mqtt_init(void) { mosquitto_lib_init(); } bool mqtt_ConnectToServer(struct…
pavan betageri
  • 123
  • 1
  • 1
  • 9
0
votes
0 answers

Subscriber of MosquittoClient doesn't show single subscribed message in a interval time period

I'm using Mosquitto/Client php library. I have made connected properly between broker and client. When i execute publisher and subscriber then subscriber displays a number of messages but I want to get a single published message when publisher…
Salman Quader
  • 195
  • 2
  • 13