Questions tagged [mqtt]

Message queuing telemetry transport, or MQTT, is a publish/subscribe messaging protocol designed to minimize network bandwidth usage and device resource requirements. Client and server implementations exist in a wide variety of languages.

MQTT is a small-footprint machine-to-machine (M2M) messaging protocol, useful for Internet of Things () applications and mobile or embedded environments where device resources and network bandwidth are minimal.

Client libraries and servers and are available in a wide variety of languages including C, Java, .NET, Python, and many more.

In October 2014, MQTT v3.1.1 was awarded OASIS Standard status. The new status provides a stable specification for implementors, improved interoperability, and assurance that the intellectual property will remain unencumbered and free for all to use.

In 2016 the standard was adopted by ISO in ISO/IEC 20922:2016.

Wikipedia reference

6207 questions
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
23
votes
4 answers

Understanding mqtt subscriber qos

I am new to MQTT and I just learned about the meaning of the QOS level that is decided when a message is published: 0 when we prefer that the message will not arrive at all rather than arrive twice 1 when we want the message to arrive at least…
Oren
  • 2,767
  • 3
  • 25
  • 37
22
votes
5 answers

Android & (millions of) push notifications

I'm working on the Android version of an application I first created on iPhone and this application requires to send (if it's as successful as its iPhone version) up to millions of push notifications to users daily. I naively thought the Android…
Vivi
  • 972
  • 1
  • 14
  • 30
21
votes
9 answers

MQTT Socket error on client

I have setup MQTT on a Raspberry Pi and configured an Arduino Uno to the broker, but I am seeing the following entry in the /var/log/mosquitto/mosquitto.log file: New connection from 192.168.10.114 on port 1883. Socket error on client ,…
rwkiii
  • 5,716
  • 18
  • 65
  • 114
20
votes
6 answers

Alternative to OPC-UA

Is there any decent alternative to OPC-UA as a solution for accessing process data of a system composed of various PLCs? Something that is platform independent and can "speak" with products of different brands ? I've heard of MQTT but it seems to be…
cid
  • 696
  • 1
  • 8
  • 19
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
20
votes
1 answer

Subscribe and Read MQTT Message Using PAHO

I'm using paho to send and receive mqtt messages. So far it has been no problem to send the messages, I'm receiving them by using mosquitto. Now I want to read the messages by using a java client and I noticed that there has been less documentation…
Lama
  • 2,886
  • 6
  • 43
  • 59
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
18
votes
2 answers

How to use paho mqtt client in django?

I am writing a django application which should act as MQTT publisher and as a subscriber. Where should I start the paho client and run loop_forever() function. Should it be in wsgi.py ?
Raja Sudhan
  • 183
  • 1
  • 2
  • 10
18
votes
5 answers

MQTT - Is there a way to check if the client is still connected

Is there a way to check if the client is still connected to the MQTT broker? Something like if client.isConnected(): # for example # if True then do stuff Edit: There was instance where my Raspberry Pi stopped receiving from the client…
Ahmed Al-haddad
  • 805
  • 2
  • 16
  • 41
18
votes
3 answers

How do I integrate chat with nodejs and xmpp into my existing web application?

I have read a lot of questions relating this, but none of them are satisfying. Existing App A minimalist social network implemented using Expressjs as an API.Using MySql as DB.socket.io for notifications and ember.js as a frontend…
LoneRanger
  • 665
  • 13
  • 31
18
votes
1 answer

Why and how is push-notification (like GCM) battery efficient?

Wanted to understand the fundamental reasons for push-notification like Google Cloud Messaging (earlier called Google Cloud to Device Messaging) being more battery friendly, for cloud <--> device communication ? In my view, the alternative…
bdutta74
  • 2,798
  • 3
  • 31
  • 54
18
votes
2 answers

How to Find Connected MQTT Client Details

Is there any way we can find about all the connected client details(IP & name) from another client? I know there is a topic "$SYS/broker/clients/active" which gives the number of currently connected clients but if I want to know more about each…
Dilip
  • 628
  • 2
  • 10
  • 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