Questions tagged [mqtt]

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

Filter by
Sorted by
Tagged with
32
votes
5answers
7k views

When and why to use MQTT protocol?

I am developing a device which measures temperature, humidity and mass. Currently it uses HTTPS to upload data to a remote server. Now I know that there is a protocol called MQTT which is claimed to ...
20
votes
2answers
5k views

Can Mosquitto support multiple brokers?

I've been considering Mosquitto for a MQTT message broker for a home IoT network, but I'm concerned that the broker could be a single point of failure which could bring down my whole network if it ...
19
votes
3answers
782 views

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 ...
18
votes
2answers
2k views

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. ...
16
votes
3answers
5k views

Don’t subscribe to # - so how to dump all messages to database with Mosquitto?

HiveMQ's blog lists under "best practices" not to subscribe to the multi level wildcard when attempting to dump all messages to a database. They claim that the subscribing client may not be able to ...
16
votes
2answers
13k views

What is the difference between MQTT and Web Sockets, and when should I use them?

What are the major differences between MQTT and Web Sockets? When using IoT for home automation - control and monitoring access over different devices, which one of them should be used when Rest API ...
15
votes
2answers
4k views

How can I implement MQTT on an STM32F030K6T6?

The controller in question is an STM32F030K6T6, which has an ARM® 32-bit Cortex® -M0 low power core, 32 kB Flash memory and 4 kB SRAM. It interfaces an SIM808 for Internet connectivity. The resources ...
14
votes
1answer
752 views

Are there any devices with open-source protocols over Wi-Fi?

I know how to program IoT using Arduino; but I want some ready made portable IoT devices that do not need any programming at device side. Just I want to buy and add these devices to the network (after ...
13
votes
2answers
634 views

What simple security tests can I perform on my MQTT network?

I am about to set up an MQTT network at home. I want to build up some knowledge by practical exercises. It would be a small network with the broker hosted on my laptop (Windows 7) and some Raspberry ...
12
votes
4answers
267 views

How can I use 2FA in an MQTT network?

How can I use 2FA (two factor authentication) when I connect a new device to the broker, if it is even possible? Because it seems easier, the second factor can be a software solution first but I ...
12
votes
2answers
5k views

Is MQTT protocol appropriate for transmitting sensor readings over BLE?

Assume that there are numerous weak sensors (e.g., Arduino level devices) which rely on BLE as means of communication and that these devices are connected to a more powerful gateway (e.g., Raspberry ...
12
votes
3answers
6k views

Mosquitto on Raspberry Pi refuses connection after changing log settings

In my ongoing endeavors to get my Raspberry Pi to command my stuff I set up a Mosquitto MQTT broker. In the base settings everything went reasonably fine. I could post test messages with the publish ...
12
votes
1answer
405 views

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 ...
11
votes
4answers
2k views

Is it a bad practice to keep certificates on external memory?

We're working on AWS-IoT using an STM32 microcontroller. Till today, we were writing the certificates to the flash and locking the flash from external reading. As the application code increases, we'...
11
votes
3answers
2k views

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 ...
11
votes
3answers
2k views

Should I use Mosquitto's web sockets or connect clients directly?

According to this blog, Mosquitto (the MQTT broker) now supports connecting to clients over web sockets. The blog article seems to hint that web sockets are more useful for browser applications, since ...
11
votes
2answers
793 views

How can I set up main and failover MQTT subscribers for a job queue with AWS IoT?

I have an system where a client (let's call it ClientA) can publish requests to a particular MQTT topic. The broker, in case it matters, is Amazon Web Services. Then I have another client (let's call ...
11
votes
1answer
7k views

mosquitto_sub “connection refused” on Arch Linux

So I installed mosquitto and mosquitto-client on a Raspberry Pi running Raspbian Jessie through apt-get as well as mosquitto on another Pi running Arch Linux through pacman. On Arch the client utils ...
11
votes
2answers
648 views

Subscribing to MQTT birth and will topics? (emqttd)

I am running emqttd (emqtt.io). I would like to monitor clients connecting and disconnecting from a separate process that would be subscribing to a system topic where birth and will messages are ...
10
votes
3answers
2k views

Performance of MQTT over TLS vs. MQTT

While MQTT is quite versatile it is also not secured on itself. This is by design. According to Stanford-Clark, security was consciously left out of the protocol initially because he and Nipper ...
10
votes
1answer
317 views

Would RPI 3 serve as IoT server with MQTT?

I answered to the below linked question and started to think, what are the hardware specs for running an IoT stack of for example MQTT over LoraWan? Would Raspberry PI 3 survive or not? I do not care ...
10
votes
2answers
3k views

Is MQTT scalable with 1000+ clients?

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 ...
10
votes
2answers
420 views

Detecting IoT devices in web browser?

Recently I bought a couple of wifi relays from Xiaomi. While they have been solid so far, I really dislike Xiaomi's app. But, I do like the idea that it actually works both in LAN and over the ...
10
votes
1answer
965 views

Can a Mosquitto MQTT client forcibly disconnect another?

I've been wondering how an MQTT client could instruct the broker to disconnect a client by some means, in case I need to force-disconnect a client from my MQTT server (for example, if it's misbehaving ...
10
votes
1answer
2k views

Can I publish multiple MQTT topics in a single request?

I've got a device with multiple sensors that publishes each sensor reading separately to topics like device1-id/sensor1-id = 10.2 device1-id/sensor2-id = 15.5 [...] We feed it to AWS IoT using ...
10
votes
1answer
1k views

How does EMQ persist QoS 1/2 messages?

The EMQ (Erlang MQTT Broker) is a "distributed, massively scalable, highly extensible MQTT message broker" with a reported "1.3 million concurrent MQTT connections" - so it potentially allows a large ...
10
votes
1answer
832 views

Non-IP device Communication Protocols

I have a question about Non-IP device communication. From my research, I learnt CoAP and DDS can be used for Device-to-Device communication. MQTT is useful for Device-to-Gateway or Device-to-Service ...
10
votes
1answer
4k views

How to use MQTT on Arduino which uses serial com to send AT commands to ESP8266

I just started looking into MQTT protocol. Situation In my college project, currently, I use Arduino as main MCU and do every work in that and use Serial Comm. to send AT commands to esp8266 (for ...
9
votes
3answers
2k views

Is there a standardized RPC mechanism for MQTT?

Over on Stack Overflow there is a question about implementing request/response interaction over MQTT. As one answer notes, you can do it by publishing the request on one topic and listening for the ...
9
votes
3answers
8k views

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 ...
9
votes
2answers
1k views

Do I need to use MQTT or HTTP?

I'm working on a device that sense and collect information from the environment such as temperature, humidity, etc. The device is not connected to any power source, but it has a battery, and a solar ...
9
votes
2answers
237 views

Is there a way to preserve the MQTT QoS level until it reaches the client?

MQTT allows senders to set a Quality of Service (QoS) level, which provides certain guarantees about whether a message will be received (and whether duplicates are permitted). This article from HiveMQ ...
9
votes
2answers
513 views

Protocol for configuring IoT device settings

MQTT is widely used in IoT when it comes to exchanging application data between the end device and the host service. The publish-subscribe model makes it easy to use: no handshaking, negotiating etc (...
9
votes
1answer
73 views

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 ...
9
votes
1answer
492 views

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 ...
9
votes
1answer
363 views

Has anyone got the transparent MQTT gateway running in Azure IoT Edge?

One of the main purposes of IoT Edge is to localize the computation of the steady state (normal conditions) to the edge rather than in the cloud. Has anyone got Azure IoT Edge working as a "...
9
votes
1answer
775 views

3G SIM5320 support for MQTT

Looking for feedback from others who have been using the SIM53xx series modules for IoT solutions over the 3G network. I have an MQTT broker on the internet to collect data for a fleet tracking system ...
9
votes
1answer
936 views

Controlling ESP8266 via Raspberry Pi through MQTT

I am working on a home automation project. The basic objective of my project is to control relays and other sensors located at different locations. I have set up my Raspberry Pi as an MQTT broker. ...
9
votes
0answers
354 views

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 ...
8
votes
4answers
8k views

How to enable WebSockets on Mosquitto running on Windows?

I have a Mosquitto broker up and running on my Windows machine. I don't remember if I installed it with Web Sockets support (Cause I didn't knew what that was, or if I needed it). But seeing now my ...
8
votes
3answers
17k views

How to enable detailed logging of Mosquitto broker on Windows 7?

I have a previous question and to get closer to a solution I want to enable Mosquitto broker logging on Windows 7. Originally I have started the broker manually as follows: mosquitto -p 1883 -v -v ...
8
votes
2answers
6k views

How can I interface a LoraWan network with MQTT?

I have been working on a project which involves creating a LoraWan network using: Dragino lg01 as a Gateway. An Arduino Uno and a Dragino Lora shield with a simple LM35 Temperature sensor As for the ...
8
votes
2answers
545 views

How to link LoRaWAN Server with WSO2 IoT through MQTT

I have been working on creating my private LoRaWAN network using some nodes with A Dragino Sheild and a LG01 Gateway, so far I have been successful in sending the data to this Open Source Server https:...
8
votes
2answers
7k views

List clients subscribed to a certain topic in Mosquitto server

So that is the general question, but I'll provide the scenario here. I'm running Mosquitto server to provide mqtt comm between esp relay modules (Sonoff from Itead) and Home Assistant. Most of the ...
8
votes
1answer
949 views

What happens if Mosquitto runs out of memory to store QoS 1/2 messages?

In MQTT, messages with QoS 1 or 2 must be delivered at least once (QoS 2 messages must be delivered exactly once). If the client is not connected, the broker must store the message until the client is ...
8
votes
2answers
351 views

AWS IoT implementation on a low end controller like Atmega328, nrf51822?

I have been using AWS IoT implemented in a RPi for a while. I was wondering if I could use a controller like Atmega328 or some NRF based controllers or STM32 to publish and subscribe to AWS IoT MQTT ...
8
votes
2answers
432 views

Should I use the MQTT protocol?

I am planning to start to implement the below IoT use case. Use case The IoT devices will send 100k messages/minute to the gateway via repeaters and the gateway will transfer the messages to the ...
8
votes
1answer
322 views

Does CoAP have a lower footprint than MQTT?

I recently read a Quora question about whether CoAP or MQTT is more lightweight, but the answers don't seem particularly satisfying and all contradict each other: the top answer says MQTT takes fewer ...
8
votes
1answer
223 views

Control arduino via MQTT

I working with several arduino board and now I need to control them via a web interface. Via web interface I want to activate GPIO. I have two ideas: Each arduino acts as web server and I can ...
8
votes
2answers
533 views

What right hardware to use for Home Automation using MQTT?

I have been working on a home automation project lately. It is complete to the extent of switch control and getting the readings of temperature, humidity. I am using a Raspberry Pi 3 as MQTT broker. ...