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
1
vote
0 answers

Still reachable blocks in libmosquitto

I'm working on below example but there are memory leaks when I run this with valgrind static struct mosquitto *m = NULL; int main(){ mosquitto_lib_init(); printf("LIBMOSQUITTO %d\n", LIBMOSQUITTO_VERSION_NUMBER); if ((m =…
tez
  • 4,990
  • 12
  • 47
  • 67
1
vote
1 answer

Notification whenever a new topic is created on mosquitto

I am trying to implement Push notifications on Android, using Mosquitto broker. So, different android application create topics based on tehir id on which they will receive notifications. To send notifications to those android applications we need…
MeME55
  • 23
  • 3
1
vote
1 answer

CPP MQTT Broker code not working

I need to use mqtt broker in a project of mine. But i felt there is a huge lack of documentation. Some of the available example codes i found didn't really work for me. Followed this example, but got compilation error [subho@localhost] taboo $ g++…
codename_subho
  • 456
  • 8
  • 22
1
vote
2 answers

How to compile example program using libmosquitto

I am getting the following errors when I try to compile one of the example: main.cpp:8:undefined reference to `mosqpp::lib_init()' main.cpp:13: undefined reference to `mosqpp::mosquittopp::loop(int, int)' main.cpp:15: undefined reference to…
pratap
  • 11
  • 1
  • 2
0
votes
1 answer

Mosquitto client use Ethernet interface instead of loopback interface

With the version 1.4.14 i found that when : plugged ethernet cable ( between embedded device and pc ) no need for internet or any connectivity just plugged in the ethernet cable. run mosquitto localy and in loopback : mosquitto with the default…
0
votes
1 answer

my mqtt recived many connection but cant return a connack

I am searching for a long time on net. But no use this is occasional problem; here are false mosquitto.log 1677746403: New connection from x.x.x.x:53696 on port 21883. 1677746403: New connection from x.x.x.x:53698 on port 21883. 1677746403: New…
Mike w
  • 1
0
votes
1 answer

how to use a username and password for mosquitto_new c/c++ mqtt

Hi so I am using linux (ubuntu) and I am using c/c++ with the libmosquitto mqtt library. There is a function called mosquitto_new() that takes the client id, cleas_session and a void object pointer as the arguments. In all the examples I have seen…
Dean21
  • 13
  • 4
0
votes
0 answers

Reset MQTT broker after disconnecting to connect to a different device

I'm currently using the mosquittopp library in C++ to handle the connection with different devices (one at a time). When we decide to disconnect from device #1 (by unplugging it from the computer from example) ; I receive correctly the on_disconnect…
0
votes
0 answers

Mosquitto Dynamic Security Plugin doesn't work on MacOS

I am pretty new to programming and GitHub. I was trying my best to find a solution in other forums, but there are very few topics about dynamic security. So I hope that I can find some help here. For my bachelor thesis I need to work with the…
0
votes
1 answer

MQTT: Priority of persistent session messages vs. retained messages

Assuming I have topic A and topic B. Upon starting my application, inside on_connect, I am subscribing to both topics with QOS 2. Then I start the thread with loop_forever(). Now, lets assume I have missed messages on topic B which were sent while I…
lukkaz
  • 35
  • 6
0
votes
1 answer

Linking mosquitto library to hello.c program on Linux

I am trying to compile the mosquitto library with my custom c program. So WHat I have done is wrote a hello.c file, git cloned the latest mosquitto library from the below repository: https://github.com/eclipse/mosquitto.git and compiled it with the…
thecdoctor
  • 69
  • 14
0
votes
1 answer

How to see message MQTT properties when using mosquitto_sub command

I'm running Mosquitto command mosquitto_sub to subscribe to a topic and see the messages published there. I would like to be able to see the MQTT properties used when someone publishes a message in that topic. Is there any way? Thanks
italktothewind
  • 1,950
  • 2
  • 28
  • 55
0
votes
0 answers

In MQTT mosquitto.lib, function "mosquitto_client_id" is missing

I am working with MQTT mosquttio open source code. All was well until I reached where I need to know the client ID from the mosquitto object. Here, I found there is a function which does that "mosquttio_client_id", however this function was missing…
rahul
  • 59
  • 1
  • 8
0
votes
0 answers

C++ mosquitto client with TLS

I am creating a C++ MQTT client which use mosquitto Libraries and mosquittopp.h : Git Repository I am trying to connect the client C++ to the broker but i got this error: 1646918108: Client disconnected: Protocol error. 1646918614: New…
0
votes
1 answer

100% cpu load when creating an MQTT listener (mosquittopp) as a thread

I'm currently working on a doorbell application for my Raspberry Pi which is supposed to trigger GPIO actions when a certain message appears. Therefore, I have a main class doorbell: doorbell.h class doorbell { public: // ... void…
tai
  • 477
  • 1
  • 5
  • 16