Questions tagged [mosquitto]

An Open Source MQTT v5/v3.1/v3.1.1 Broker

Eclipse Mosquitto is an open source (EPL/EDL licensed) message broker that implements the MQTT protocol versions 5.0, 3.1.1 and 3.1. MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for internet of things/machine to machine messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino

Use this tag if your question addresses issues with the C or C++ API, or with the message broker itself.

For questions on the wire-protocol use

mosquitto.org

1438 questions
85
votes
4 answers

How do I subscribe to all topics of a MQTT broker

I want to connect a client which will monitor all the topics of the broker to respond to the events when I don't know what are names of topic.
Yugandhar Chaudhari
  • 3,831
  • 3
  • 24
  • 40
67
votes
6 answers

How to test the `Mosquitto` server?

I am new to Mosquitto and MQTT, I downloaded the Mosquitto server library but I do not know how to test it. Is there any way to test the Mosquitto server?
Amrmsmb
  • 1
  • 27
  • 104
  • 226
36
votes
3 answers

How to set username/password mosquitto?

I used the mosquitto_passwd command to create a password file. mosquitto_passwd /etc/mosquitto/passwd admin I added the path to my password file in mosquitto.conf: password_file /etc/mosquitto/passwd But when i subscribe or publish it doesn't…
datnq
  • 461
  • 1
  • 6
  • 12
23
votes
1 answer

How to make mosquitto_sub print topic and message when subscribed to #

The following command shows all the messages published to topics that match the regex but not the exact topic itself. mosquitto_sub -h localhost -u user -P pass -t 'devices/#' {"value":"50"} {"value":"45"} For example the above json messages were…
Khush Bhatia
  • 498
  • 1
  • 4
  • 9
20
votes
8 answers

mosquitto-client obtain refused connection

I want to use MQTT protocol using mosquitto library. First of all, I want to do some test installing mosquitto-clients sudo apt-get install mosquitto-clients This program provides two "method": mosquitto_pub mosquitto_sub Following this…
Luca Davanzo
  • 21,000
  • 15
  • 120
  • 146
19
votes
6 answers

Mosquitto: Starting in local only mode

I have a virtual machine that is supposed to be the host, which can receive and send data. The first picture is the error that I'm getting on my main machine (from which I'm trying to send data from). The second picture is the mosquitto log on my…
FlasH
  • 193
  • 1
  • 1
  • 6
19
votes
6 answers

Request all published topics

I'm using Mosquitto for my MQTT Broker. I was wondering if it would be possible to request all published topics? Thus NOT by subscribing to everything, i.e. #. EDIT: I don't want to subscribe to every available topic. I'm just looking for a way to…
gillesC
  • 677
  • 1
  • 5
  • 23
17
votes
10 answers

How to clear ALL retained mqtt messages from Mosquitto?

I've seen the mosquitto_pub -h [server] -r -n -t [XYZ] syntax for clearing out one off messages. My problem is the device developers have posted a lot of garbage messages. I have a Java/Paho code base that I'd like to modify to do this…
JohnL
  • 13,682
  • 4
  • 19
  • 23
17
votes
1 answer

Horizontally scaling mosquitto broker

I am considering mosquitto for a MQTT broker. From what I've read, I realized that Mosquitto doesn't support Horizontal Scaling. So far all other criteria of my requirements can be met with Mosquitto. I'm not sure if the question is too generic or…
Dhanushka Dolapihilla
  • 1,115
  • 3
  • 17
  • 34
16
votes
2 answers

Synch and Asynchronous interface of MqttClient object are not working

I have created a client of type MqttClient and as shown below in the code, I create a client and se its Asynchronous callback. The problem is, 1-when I run the programm, the System.out.println("Client is Connected"); appears, but i receive no…
rmaik
  • 1,076
  • 3
  • 15
  • 48
15
votes
6 answers

address already in use error in mosquitto

I have installed mosquitto server and client packages in my ubuntu machine. When I run command "mosquitto" to run the mosquitto server I am getting an error "Error:address already in use". Why am I getting this error? How can I resolve this?
andro-girl
  • 7,989
  • 22
  • 71
  • 94
15
votes
7 answers

Cluster forming with Mosquitto broker

I am using Mosquitto broker to implement MQTT protocol. But I am unable to find how clustering can be done in case of mosquitto brokers. Also is there any limitation on number of clients those can be served with one broker.
Abhishek Maheshwari
  • 275
  • 1
  • 3
  • 12
13
votes
6 answers

Stop the mosquitto (MQTT) broker from listening to a port using the command line

When I ran the Mosquitto (MQTT) broker for the first time there was no issue. But however from he second time when i ran it using default config I could not run the code successfully because of the following error: 1379497253: mosquitto version 1.2…
user2430996
  • 341
  • 1
  • 4
  • 12
12
votes
0 answers

Configuring mosquitto MQTT broker to listen on multiple ports

I installed mosquitto on a Win7 PC and I want it may listen on many ports so I modified mosquitto.conf accordingly to the mosquitto documentation and some tutorials/examples found in the web. These are my modifications done on mosquitto.conf: #…
Massimo Manca
  • 385
  • 1
  • 2
  • 15
12
votes
1 answer

golang mqtt publish and subscribe

Does anybody know where I can get some example MQTT client Go (golang) code that does both publish and subscribe in an infinite loop ? I am messaging with a Mosquitto broker running on MacOs. In more detail... Get a message from the network (a…
Phillip Neal
  • 445
  • 1
  • 3
  • 10
1
2 3
95 96