Questions tagged [mqtt]

For questions concerning the MQTT messaging protocol, a lightweight TCP/IP-based system for machine-to-machine communication.

Use this tag for questions that are about the MQTT messaging protocol and its uses in the Internet of Things.

Consider the question check list if your question fits the tag. You can also look at the example questions. If this tag doesn't fit your question have a look below at somehow related tags that might fit your question better.

Question checklist

  • Is your question related to the theory, design or implementation of MQTT in the context of the Internet of Things?
  • Is your question not asking for a comparison of various protocols? (this is usually too broad)

Example questions

Not what you are looking for?

  • Use the tag for the Mosquitto open source broker implementation.
  • Is your question primarily about implementing code to use MQTT? If so, ask at Stack Overflow.
  • Is your question about any publish/subscribe protocol? If so, use .
296 questions
21
votes
2 answers

Can an MQTT client subscribe to a topic created by itself?

In my understanding, in MQTT a topic is created once a client publishes something with the corresponding topic name. There is no need to configure a topic, publishing on it is enough. From here. It is possible for a client to subscribe to its own…
Bence Kaulics
  • 7,783
  • 8
  • 41
  • 90
21
votes
3 answers

Confusion about client-server connection establishment in MQTT

According to the specifications, it is always the client who should establish connection to a server. Client: A program or device that uses MQTT. A Client always establishes the Network Connection to the Server. It can Publish Application…
Bence Kaulics
  • 7,783
  • 8
  • 41
  • 90
15
votes
3 answers

Are there MQTT brokers that persist QoS 1/2 messages to disk?

As of now the EMQ (Erlang MQTT Broker) does not seem to persist QoS 1/2 messages to disk: How does EMQ persist QoS 1/2 messages? So in case of an unexpected server reboot, memory limits, or other event messages might be lost despite QoS 1/2 level…
Ghanima
  • 2,539
  • 1
  • 17
  • 46
15
votes
1 answer

What happens when there is not any subscriber to a topic in MQTT?

The situation is the following: There is a client, a publisher, it is not subscribed to any topic. This client has a single topic of its own, and publishes data reguraly to it. But there are not any other clients that are subscribed to this…
Bence Kaulics
  • 7,783
  • 8
  • 41
  • 90
12
votes
3 answers

MQTT broker accessible from outside without opening port in firewall?

I'd like my MQTT broker to be accessible from outside my home network, but I'm a bit reluctant to open a port in the firewall. And I'd like to avoid using my home IP. It's pretty convenient to have an unencrypted open broker at home, but that…
Thomas Jensen
  • 473
  • 1
  • 3
  • 11
11
votes
3 answers

Should I use special characters in MQTT topics?

I have used MQTT to connect all my ESP8266 units but I have a general question regarding topics. According to www.hivemq.com: "Leading forward slash" / should be avoided. Spaces should be avoided. Use only ASCII characters. Embed a unique…
Jimmy Westberg
  • 684
  • 2
  • 5
  • 14
11
votes
1 answer

MQTT always connected and 4G data load

I'm working on an IoT project that involves thousands of MQTT clients that are connected to a broker (mosquitto) via 4G/WiFi router/modem. Less than 10 clients are connected to the same router, and the routers come from different places (different…
Mark
  • 695
  • 1
  • 4
  • 13
9
votes
1 answer

Is it necessary to create a x number of MQTT topics for x number of devices?

Currently in my project in which the controller(client) sends sensor data to the server and receives feedback from the server with some additional data, uses MQTT protocol for communication. It has 2 separate topics for client and server. For…
ron123456
  • 403
  • 4
  • 12
9
votes
1 answer

Mosquito MQTT Thingsboard and Thingsboard IoT-gateway on same server

It would be much appreciated if someone could tell me the settings to run Mosquito MQTT and Thingsboard with Thingsboard IoT-gateway on the same server. Mosquito is receiving on port 1883 which is working. Were do I need to configure the ports (must…
Frank
  • 91
  • 3
8
votes
1 answer

What will be the result of the following connection scenario in an MQTT network?

In MQTT it is the client who initiates the connection with a CONNECT message. The first field of the packet is the clientId: The client identifier (short ClientId) is an identifier of each MQTT client connecting to a MQTT broker. As the word…
Bence Kaulics
  • 7,783
  • 8
  • 41
  • 90
8
votes
2 answers

Free MQTT brokers

Are there any limitations ( mainly amount of messages) when using free MQTT server ( such as iot.eclipse.org ), that causes from time to time not to publish messages? I have 2-3 device connected at home, and for testing purposes, publish about 10-20…
guyd
  • 851
  • 8
  • 17
8
votes
0 answers

Tasker MQTT to adafruit.io unreliable, how do I troubleshoot?

Overview I'm running Tasker on my Android phone in an attempt to control lights in my apartment through MQTT via adafruit.io. It works, sometimes. I want to make it work every time, but I don't know what is sporadically failing. As far as I can…
gibson
  • 181
  • 2
8
votes
1 answer

MQTT: Can a subscriber send data to a producer asynchronously?

Scenario IoT device (currently IPv4 device) that sends via TCP socket a payload to a server once per day. The server has a public IP address, the device is behind a router/NAT. I'm going to use a module based upon ESP8266 (i.e. Olimex one) Goal The…
Mark
  • 695
  • 1
  • 4
  • 13
7
votes
5 answers

Which free dashboards are also MQTT brokers?

I'm trying to find a dashboard which: Has pretty widgets for data display Can subscribe to, and display MQTT data that I publish Can publish commands to subscribers (eg: "Driveway light switch: turn on") Is free for home / hobby…
Tom Hale
  • 211
  • 2
  • 7
7
votes
1 answer

KeyError while connectiong to a MQTT broker

This is my code and on the bottom is the error I keep getting. import configparser from time import localtime, strftime import json import paho.mqtt.client as mqtt config = configparser.ConfigParser() config.read('/home/pi/bin/py.conf') #…
pivk95
  • 115
  • 5
1
2 3