ESP32 Wireless Communication Protocols

The ESP32 supports several different wireless communication protocols. Each protocol has its advantages and disadvantages and one can be more suitable than the other depending on the application. This guide is a compilation of all our articles about wireless communication protocols with the ESP32.

ESP32 Wireless Communication Protocols Guide

Communication Protocols

In this article, we’ll cover the following communication protocols:

We’ll keep this article updated as new tutorials are posted.

Bluetooth Low Energy (BLE)

Bluetooth Low Energy, BLE for short, is a power-conserving variant of Bluetooth. BLE’s primary application is short-distance transmission of small amounts of data (low bandwidth).

Unlike Bluetooth which is always on, BLE remains in sleep mode constantly except for when a connection is initiated. This makes it consume very low power. BLE consumes approximately 100x less power than Bluetooth (depending on the use case).

Additionally, BLE supports not only point-to-point communication, but also broadcast mode, and mesh network. Due to its properties, BLE is suitable for applications that need to exchange small amounts of data periodically running on a coin cell. For example, BLE is of great use in healthcare, fitness, tracking, beacons, security, and home automation industries.

  • Low power consumption
  • Short distance transmission
  • Low bandwidth (small amounts of data)
  • Ideal for exchanging small amounts of data periodically
  • Supports point-to-point, broadcast, and mesh network

Learn how to get started with BLE on the ESP32 with our guides:


Bluetooth Classic

Bluetooth Classic

Bluetooth is a wireless technology standard used for exchanging data between fixed and mobile devices over short distances. It is optimized for continuous data streaming, while BLE is optimized for short burst data transmission. It consumes approximately x100 more power than BLE.

  • Short distance transmission
  • Optimized for continuous data streaming

Learn how to use Bluetooth Classic with the ESP32:


ESP-NOW

ESP-NOW is a connectionless communication protocol developed by Espressif that features short packet transmission. This protocol enables multiple devices to talk to each other in an easy way.

Stating the Espressif website, ESP-NOW is a “protocol developed by Espressif, which enables multiple devices to communicate with one another without using Wi-Fi. The protocol is similar to the low-power 2.4GHz wireless connectivity (…). The pairing between devices is needed prior to their communication. After the pairing is done, the connection is safe and peer-to-peer, with no handshake being required.”

ESP-NOW ESP32 Logo
  • Fast communication protocol
  • Up to 250-byte payload can be carried
  • Encrypted and unencrypted communication
  • Range communication (220 meters in opan en field accordingly to our experiments)

Read our articles about ESP-NOW:


Wi-Fi (client-server communication protocols)

Wi-Fi WiFI Logo

HTTP Requests

You can exchange data between ESP32 boards using HTTP requests. One board acts as a server (Wi-Fi access point) and the other board acts as a client (Wi-Fi station).

Learn how to send data from one ESP32 board to the other using HTTP requests:

The ESP32 can also make HTTP requests to third-party services on the internet to send or receive data. For that, the ESP32 needs to be connected to a Wi-Fi network with internet access.

Server-Sent Events

Server-Sent Events (SSE) allow the client to receive automatic updates from a server via HTTP connection.

The client initiates the SSE connection and the server uses the event source protocol to send updates to the client. The client will receive updates from the server, but it can’t send any data to the server after the initial handshake.

Server-sent events are useful when you need to send new data to the server without the need for a request by the server, for example send sensor readings periodically or notifications.

Learn how to use server-sent events on an ESP32 web server:

WebSocket

A WebSocket is a persistent connection between a client and server that allows bidirectional communication between both parties using a TCP connection. This means you can send data from the client to the server and from the server to the client at any given time.

Get started with WebSocket protocol on the ESP32 by following the next tutorial:


MQTT

MQTT logo

MQTT stands for Message Queuing Telemetry Transport. It is a lightweight publish and subscribe system where you can publish and receive messages as a client. MQTT is a simple messaging protocol, designed for constrained devices with low-bandwidth.

To use MQTT to exchange data, you need an MQTT broker that is responsible for receiving all messages, filtering the messages, and publishing the message to all subscribed clients. MQTT is perfect for IoT projects with multiple devices.

Read our articles about the MQTT communication protocol with the ESP32.


LoRa

LoRa is a wireless data communication technology that uses a radio modulation technique that can be generated by Semtech LoRa transceiver chips.

LoRa logo

LoRa allows long range communication of small amounts of data (which means a low bandwidth), and high immunity to interference while minimizing power consumption. So, it allows long distance communication with low power requirements.

  • Long range communication
  • Low bandwidth (small amounts of data)
  • High immunity to interference
  • Low power consumption

To use LoRa with the ESP32 boards, you need a LoRa transceiver chip. The word “transceiver” means that the chip can send and receive LoRa messages. There are ESP32 boards that already come with an on-board LoRa transceiver chip, which makes wiring much simpler.

Read our articles about LoRa communication:


GSM/GPRS/LTE

4G LTE

You can connect your ESP32 board to a modem to be able to send and receive SMS and phone calls and connect to the internet using a SIM card as you would do with your smartphone. Some of those modems can also get GPS data like latitude, longitude, altitude, and date and time.

There are different modules available that are compatible with the ESP32 and there are also ESP32 boards that already come with a built-in modem and all the necessary circuitry.

We’ve experimented with the ESP32 SIM8000L (2G), and the ESP32 SIM7000G (3G and 4G), and we had pretty good results.

To get started with those boards, you can take a look at the following tutorials:

Wrapping Up

There are many different wireless communication protocols compatible with the ESP32 boards. This makes it one of the most versatile boards for IoT and Home Automation projects. In this article, we’ve covered LoRa, Bluetooth, Bluetooth Low Energy, ESP-NOW, Wi-Fi, MQTT, and GSM/GPRS/LTE.

If you want to learn more about those protocols with the EPS32, check out the corresponding links throughout the article.

We hope you found this useful.

Learn more about the ESP32 with our resources:

Thanks for reading.



Build Web Server projects with the ESP32 and ESP8266 boards to control outputs and monitor sensors remotely. Learn HTML, CSS, JavaScript and client-server communication protocols DOWNLOAD »

Build Web Server projects with the ESP32 and ESP8266 boards to control outputs and monitor sensors remotely. Learn HTML, CSS, JavaScript and client-server communication protocols DOWNLOAD »

Recommended Resources

Build a Home Automation System from Scratch » With Raspberry Pi, ESP8266, Arduino, and Node-RED.

Home Automation using ESP8266 eBook and video course » Build IoT and home automation projects.

Arduino Step-by-Step Projects » Build 25 Arduino projects with our course, even with no prior experience!

What to Read Next…


Enjoyed this project? Stay updated by subscribing our newsletter!

15 thoughts on “ESP32 Wireless Communication Protocols”

  1. WWOWOWOWOWOWOW! Great article. Its wonderful to see a complete and comprehensive post about the communication capabilities of the ESP32!

    Reply
  2. Thank you for this nice article, again 😉

    I was wondering about how you can have secure/encrypted communication over these protocols? Do you have links/insights on this topic related to ESP32?
    Are you considering an article about such topic?
    Would be much appriciated!

    Reply
  3. Excellent article. Really one of the first decisions you need to make with any ESP32 is what protocol to use. Keep up the good work.

    Reply
  4. Rui, Sara, You are THE BEST!
    Very much appreciate your tutorials and articles, and your response to emails!!
    And love your eBooks!
    Have greatly benefitted from your contributions in this space!
    Thank you!

    Reply
  5. I’m questioning the ESPNow portion of this article. In my experience, pairing is not required, only address. Additionally by default it is not secure or encrypted.

    One thing I’m very curious about is Long Range mode for ESP32. There is not much documentation or examples utilizing it. I’m curious if it’s just using the antenna at a higher DBI.

    Reply
  6. Hello.
    Sarah and Rui = one-click help:)
    If you read carefully what they write and then work consistently, 99.9% of the time everything works – one-tenth is because no person is infallible – my experience so far. And a lot of their work is just for thanking you here, so warm thanks.
    On the topic: my esp 8266 is updated via wifi and OTA, esp32 should also be done.

    Reply

Leave a Comment

Download Our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.