Hit Me Up On TCP - Part 2 Using TCP/IP for transferring data, MQTT is lightweight and simple-to-use
Circuit Cellar|August 2024
This is the second in a two-part series where Pedro highlights network communication using ESP32 SOC and the ESP-IDF framework. Part two shows how to establish a multiple-end communication through MQTT, with an ESP32 SOC on one end to another end that can be anything capable of communicating through MQTT. Transport fundamentals are covered through a practical example showing how an ESP32-S2 SoC communicates using MQTT.
Pedro Bertoleti
Hit Me Up On TCP - Part 2 Using TCP/IP for transferring data, MQTT is lightweight and simple-to-use

Embedded systems are nearly ubiquitous in our lives, affecting both developers and everyday users. Almost every electronic and electrical device around us relies on embedded systems, from smartwatches and phones to modern vehicles like electric cars, electric buses and rental bikes.

The widespread presence of these systems introduces a critical requirement: network communication capability. Many of these devices, integral to our daily routines, need to communicate with other devices or even cloud services to enhance our comfort and efficiency in daily tasks. Consequently, network communication capability - whether local or over the Internet has become a fundamental requirement for embedded systems solutions.

This article explores one of the most popular and scalable methods to allow embedded systems' communication over the network: MQTT. It covers from TCP sockets fundamentals to a practical example on how to communicate to an ESP32-S2 SoC using MQTT communication protocol.

MQTT OVERVIEW

A good start point is to define what MQTT is. MQTT stands for Message Queuing Telemetry Transport, and it was created by IBM in the late 90s. MQTT uses TCP/IP as a layer for transferring data, and has been designed to be a lightweight and simpleto-use network protocol, working with the publish-subscribe paradigm, as seen in the MQTT simplified diagram shown in Figure 1.

Every node in a MQTT communication (usually called MQTT client) is connected to a central MQTT server called an MQTT broker and sends and receives messages to other nodes addressed by MQTT topics. When a node publishes a message, it sends the desired payload addressed to a specific MQTT topic, and each node that subscribes to this referred MQTT topic will receive this message. In terms of communication possibilities, any MQTT client can be subscribed to N topics and publish to N topics simultaneously, making MQTT a very versatile communication protocol.

هذه القصة مأخوذة من طبعة August 2024 من Circuit Cellar.

ابدأ النسخة التجريبية المجانية من Magzter GOLD لمدة 7 أيام للوصول إلى آلاف القصص المتميزة المنسقة وأكثر من 9,000 مجلة وصحيفة.

هذه القصة مأخوذة من طبعة August 2024 من Circuit Cellar.

ابدأ النسخة التجريبية المجانية من Magzter GOLD لمدة 7 أيام للوصول إلى آلاف القصص المتميزة المنسقة وأكثر من 9,000 مجلة وصحيفة.

المزيد من القصص من CIRCUIT CELLAR مشاهدة الكل
New TI MCUs Enable Edge AI and Industry-Leading Real-Time Control to Advance Efficiency, Safety, and Sustainability
Circuit Cellar

New TI MCUs Enable Edge AI and Industry-Leading Real-Time Control to Advance Efficiency, Safety, and Sustainability

Texas Instruments (TI) introduced two new series of real-time microcontrollers that deliver advancements to help engineers achieve more intelligent and secure processing in automotive and industrial applications.

time-read
1 min  |
January 2025
Using Amazon Alexa to Control Custom IoT Gadgets
Circuit Cellar

Using Amazon Alexa to Control Custom IoT Gadgets

In part two of his article, Brian describes integrating custom IoT gadgets with Amazon Echo using emulation to receive spoken alarms. In part one, he used emulation and Arduino Cloud services as a middleman.

time-read
10+ mins  |
January 2025
Holiday Hangover Hardware Hacking
Circuit Cellar

Holiday Hangover Hardware Hacking

Having too much cheer during the holidays? In this month's article, Colin offers a diversion from the jolly season by urging developers to retreat to the basement to brush up on hardware hacking skills. He shows how a low-cost Raspberry Pi Pico and a TP-Link Tapo C200 smart IP camera could become the next automated bird deterrent or a home automation server.

time-read
8 mins  |
January 2025
Datasheet: Microamps Per Megahertz Ultra-Low Power MCUs Minimize Current Consumption
Circuit Cellar

Datasheet: Microamps Per Megahertz Ultra-Low Power MCUs Minimize Current Consumption

How do chip makers differentiate if many ultra-low power MCUs on the market feature the same processor core? The peripherals and different power states offer various ways to manage current consumption down to microamps per megahertz.

time-read
2 mins  |
January 2025
Smart Home Lock Down Matter Provides Security Blanket
Circuit Cellar

Smart Home Lock Down Matter Provides Security Blanket

As more devices in the smart home connect to the Internet, they become increasingly vulnerable to outside attacks. Developers can now add the latest security measures to their Smart Home devices through Matter.

time-read
10+ mins  |
January 2025
Basic Pulse Circuits
Circuit Cellar

Basic Pulse Circuits

In part one of a three-part series, Wolfgang wrote how basic pulse circuits help digital circuits, such as embedded boards with ARM processors, deal with pulse trains or bursts of pulses from the outside. In Part 2, he dives into enabling flip-flops, timing parameters, and synchronization, design tasks needed to capture, detect, and filter pulses.

time-read
10+ mins  |
January 2025
Building a Wi-Fi Router Watchdog
Circuit Cellar

Building a Wi-Fi Router Watchdog

Dev created a watchdog for a Wi-Fi extender using a Raspberry Pi Pico. This monitors Wi-Fi connectivity for his smart home lighting system, which would require a reset twice a year due to rapid power interruptions.

time-read
8 mins  |
January 2025
Create Your Own PCBs with a CNC Milling Machine
Circuit Cellar

Create Your Own PCBs with a CNC Milling Machine

Using KiCad, CopperCAM, and Candle Software

time-read
10+ mins  |
January 2025
Performance Bottlenecks in Embedded Linux Solutions Analysis, Identification, and Mitigation
Circuit Cellar

Performance Bottlenecks in Embedded Linux Solutions Analysis, Identification, and Mitigation

Good performance is a requirement for every technology, and system designers rely on operating systems to ensure fast and smooth transitions in critical applications. Fortunately, Pedro writes, the embedded Linux OS offers ways for finding, analyzing and mitigating performance bottlenecks so embedded systems can deliver the speed and efficiency that end users expect.

time-read
10+ mins  |
January 2025
Renesas New RA8 Entry-Line MCU Groups Brings High Performance of Arm Cortex-M85 Processor to Cost-Sensitive Applications with Market-Leading CoreMark Performance
Circuit Cellar

Renesas New RA8 Entry-Line MCU Groups Brings High Performance of Arm Cortex-M85 Processor to Cost-Sensitive Applications with Market-Leading CoreMark Performance

Renesas Electronics Corp., a premier supplier of advanced semiconductor solutions, introduced the RA8E1 and RA8E2 microcontroller (MCU) groups, extending the industry's most powerful series of MCUs.

time-read
1 min  |
December 2024