Comments on: What is MQTT and How It Works https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Wed, 02 Jul 2025 10:51:29 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Tony Foale https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/#comment-979005 Thu, 31 Oct 2024 18:16:27 +0000 http://randomnerdtutorials.com/?p=31605#comment-979005 I notice that you say the MQTT and clients must be connected to the internet. Is it not enough that they connect through their own WiFi? One of the ESP32 clients or the broker acting as a server?

I have a need which MQTT may or may not be the best solution. I currently use a USB cable to connect a PC to a ESP32 in order to send 1800 2 byte integer values in sequence from PC to ESP32 and back again for a validity check. I want to replace the USB cable with some wireless system IR, BlueTooth or WiFi, I am leaning toward WiFi. As the data is generated in a PC it seems to make sense to install the broker in the PC also.
So I have three questions:
1. Is MQTT a good choice for this task?
2. If so, can the broker also be a client? I am thinking that maybe from my PC software I can send the data directly to the broker for onward connection to the remote ESP32.
3. If not, then what would you recommend as a better alternative?

]]>
By: Faiza https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/#comment-882210 Fri, 05 Jan 2024 20:00:54 +0000 http://randomnerdtutorials.com/?p=31605#comment-882210 In reply to Sara Santos.

Hi Sara,

Could you please explain briefly what are the requirements for OTA updates? Im currently using Arduino IoT cloud with portenta H7 which uses MQTT for wireless connection, I want to understand how the handshake between those work.

]]>
By: Sara Santos https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/#comment-826847 Sat, 25 Mar 2023 11:12:49 +0000 http://randomnerdtutorials.com/?p=31605#comment-826847 In reply to Givi.

Great!
Thanks for the follow-up.
Regards,
Sara

]]>
By: Givi https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/#comment-826550 Thu, 23 Mar 2023 01:50:20 +0000 http://randomnerdtutorials.com/?p=31605#comment-826550 Hi Sara,
Issue resolved. There is a confusion in where to put/locate the edited version of “mosquitto.conf”. The file that is in “/etc/mosquitto/” folder, after install has the following entry and when I put my final version of “mosquitto.conf”
in “/etc/mosquitto/conf.d/” it conflict with the file that comes with the install in the “/etc/mosquitto” directory. I moved the file to that folder and it worked OK and came up active.::

Place your local configuration in /etc/mosquitto/conf.d/

#

A full description of the configuration file is at

/usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /run/mosquitto/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d

=========================

● mosquitto.service – Mosquitto MQTT Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-03-22 21:28:54 EDT; 3min 29s ago

Thank you.

Givi

]]>
By: Sara Santos https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/#comment-821299 Fri, 24 Feb 2023 13:51:19 +0000 http://randomnerdtutorials.com/?p=31605#comment-821299 In reply to Paul Keenan.

Yes. You’ll have to do that to point the ESP32 to the right MQTT server.
For future projects, you may want to add OTA updates so that you can update the sketches on your boards wirelessly.
Regards,
Sara

]]>
By: Paul Keenan https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/#comment-821085 Thu, 23 Feb 2023 17:57:18 +0000 http://randomnerdtutorials.com/?p=31605#comment-821085 In reply to Sara Santos.

Discovered that the address of the MQTT server had changed. I will have to change the programs for a lot of esp 32’s.
Is this a common thing ?

]]>
By: Paul Keenan https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/#comment-821084 Thu, 23 Feb 2023 17:47:56 +0000 http://randomnerdtutorials.com/?p=31605#comment-821084 In reply to Sara Santos.

Discovered my mqtt server address had changed. Will have to re-program all the esp 32’s.
I this a common thing ?

]]>
By: Sara Santos https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/#comment-820970 Thu, 23 Feb 2023 10:22:28 +0000 http://randomnerdtutorials.com/?p=31605#comment-820970 In reply to Paul Keenan.

Hi.
Check your network connection and if your MQTT broker is running. You might need to restart your Raspberry Pi.
Regards,
Sara

]]>
By: Paul Keenan https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/#comment-820756 Wed, 22 Feb 2023 10:19:37 +0000 http://randomnerdtutorials.com/?p=31605#comment-820756 From the 16th February all my MQTT devices failed to connect . Any idea of reason ?

All previously worked for months if not years.

ESP32 to node Red

]]>
By: Charitha https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/#comment-819364 Thu, 16 Feb 2023 09:58:23 +0000 http://randomnerdtutorials.com/?p=31605#comment-819364 Thank you for this informative article on MQTT! Your explanations are very clear.

]]>