In this article, we're going to disscuss about build-in wireless technologies of ESP32.
For the original ESP32, the main built-in wireless technologies are Wi-Fi and Bluetooth. Espressif specifies Wi-Fi 802.11 b/g/n and Bluetooth Classic (BR/EDR) plus BLE support for the original ESP32.
Note: This article primarily refers to the original ESP32. Wireless capabilities can differ between ESP32-family variants, so always check the documentation for your specific chip or development board.
| Technology | Built into original ESP32? | Main purpose |
|---|---|---|
| πΆ Wi-Fi | β Yes | Networks, Internet, web servers, IoT |
| π΅ Bluetooth Classic | β Yes | Continuous short-range communication |
| π΅ Bluetooth Low Energy (BLE) | β Yes | Low-power device/sensor communication |
| ESP-NOW | β Supported through ESP32 Wi-Fi hardware | Direct ESP32-to-ESP32 communication |
Built-in wireless communication on ESP32_
-
Wi-Fi
- Station mode
- ESP32 β Router
- Access Point / SoftAP mode
- ESP32 β Computer
- ESP32 Web Server
- ESP32 β Computer
- Bluetooth Classic
-
Bluetooth Low Energy
- Advertising
- Scanning
- Connections
- GATT
- Services
- Characteristics
-
ESP-NOW
- ESP32 β ESP32
- One-to-one
- One-to-many
- Many-to-one
1. Wi-Fi
This is the most important built-in technology when it comes to wireless communication with ESP32. Here we can see 2 main ways(modes) to communicate with Wi-Fi. Those are,
- Station mode
- Access Point(aka SoftAP mode)
1. Station mode
ESP32 joins an existing Wi-Fi network.
ESP32 β β Wi-Fi β Router βββ PC βββ Phone βββ Internet
In Station mode, the ESP32 connects to an existing Wi-Fi network, usually through an access point or router. If that network has Internet access, the ESP32 can also communicate with Internet-based services. We can define the network name and the password inside the code of ESP32 in order to connect to that specific interface.
Typical applications:
- Internet-connected sensors
- IoT
- Web servers
- REST APIs
- MQTT
- Communication with Python
- Remote monitoring
2. SoftAP mode
The ESP32 creates its own Wi-Fi network:
ESP32
Wi-Fi AP
/ \
/ \
Phone Laptop
For this one, no external router is required. ESP32 creates its own local network. This is very useful when displaying data or gathering user inputs via a webpage hosted inside your ESP32. You just have to connect to the ESP32 network with your phone/laptop Wi-Fi and go to the ESP32's ip address. With the use of protocols like HTTP, we can exchange information easily.
Browser β HTTP request β ESP32 Web Server β HTTP response β Browser
A casual ESP32 ip looks like this:
http://192.168.4.1
We can define the network name and the password(or keep it open) from our code.
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
Phone β β Wi-Fi β ESP32 β βββ Web Server
This can be used to:
- display sensor readings
- control LEDs
- control motors
- provide configuration pages
- receive commands
2. Bluetooth classic
Bluetooth classic is intended for traditional bluetooth communication. Can be used for continuous data communication.
Possible examples:
- Serial-style communication
- Controllers
- Data transfer
- Bluetooth peripherals
3. Bluetooth Low Energy- BLE
Bluetooth but uses less power. Very effective and a power saving method.
ESP32
β
βββ BLE Peripheral
β
β
β
Smartphone / Computer
To understand what happens on BLE, you need to understand these 6 key concepts first. They are,
- Advertising
- Scanning
- Connections
- GATT
- Services
- Characteristics
A simple overview is:
ESP32
β
β 1. Advertising
β
Nearby BLE device
β
β 2. Scanning
β
Device discovered
β
β 3. Connection
β
Connected devices
β
β 4. GATT
β
βββ 5. Services
β
βββ 6. Characteristics
1. Advertising
Advertising is how a BLE device announces its presence to nearby devices.
The ESP32 repeatedly sends small advertising packets over the BLE radio. Other BLE devices can listen for these packets.
A packet is like:
I'm ESP32. Here are some infomation about me
ESP32
β
β BLE advertising
β
π± Phone / Computer
The advertisement can contain information such as:
- Device name
- Device address
- Service UUID
- Manufacturer information
- Other small pieces of data
Important
Advertising does not necessarily mean a connection has been established.
The ESP32 can advertise while no device is connected.
2. Scanning
Scanning is how a BLE device looks for nearby advertising devices.
Think of this like this:
Your ESP32 is Advertising.
ESP32 A β Advertising
Your phone is also scanning (searching) for bluetooth devices:
Phone β β Scan β Nearby BLE devices
Your phone sees the advertisement that your ESP32 shows.
ESP32 β β "I'm here!" β π± Phone β β Scans β "ESP32_Sensor found"
There are 2 main types of scanning. They are:
Passive scanning: the scanner simply listens to advertising packets.
Active scanning: the scanner can send a scan request to a scannable advertiser and receive additional information in a scan response.
3. Connections
After discovering a device, a BLE device can establish a connection with it if the advertiser allows connections.
Before connection:
ESP32 ))) ((( Phone
After connection:
ESP32 βββββββββββββ Phone
BLE connection
Once connected, the devices can exchange data using the BLE data channels.
ESP32 can send data.
ESP32 β β Temperature = 28.5Β°C β Phone
The phone can send data back too.
Phone β β LED = ON β ESP32
4. GATT
This is probably the confusing and very GenZ looking word in this article. But this is the most important concept to understand in BLE.
GATT stands for Generic Attribute Profile.
Think of GATT as the structure or system used to organize the data being exchanged over a BLE connection.
ESP32
β
βββ GATT
β
βββ Service
β
βββ Service
β
βββ Service
Inside above services are characteristics.
GATT
β
βββ Service
β βββ Characteristic
β βββ Characteristic
β
βββ Service
βββ Characteristic
βββ Characteristic
Espressif's BLE documentation describes GATT server functionality as exposing services and characteristics to remote clients, while a GATT client discovers and accesses services on remote servers.
5. Services
A service is a logical collection of related BLE data.
Think of this as a folder:
ESP32
β
βββ GATT
β
βββ Health Service
This Health Service could contain:
Health Service β βββ Heart Rate βββ Temperature βββ Battery Level
Each of those individual pieces of data would be represented by a characteristic.
A service is normally identified using a UUID.
6. Characteristics
A characteristic is where the actual application data is stored or exchanged.
If a service is a folder:
Service = Folder
Then a characteristic is like a file inside that folder:
Service β βββ Temperature characteristic βββ Humidity characteristic βββ LED characteristic
For an example:
Temperature characteristic
β
βββ 28.5 Β°C
A characteristic can have different operations/properties.
Read
The client asks the ESP32 for the value.
Phone β β "Give me temperature" β ESP32 β β "28.5 Β°C" β Phone
Write
The client sends a value to the ESP32
Phone β β LED = ON β ESP32
Notify
The ESP32 can automatically notify the connected client when the value changes.
ESP32 β β Temperature changed β Phone
The below is a diagram of what we've learned about BLE
ESP32
β
βββ Advertising β "I'm available!"
β
βββ Scanning β "Who is nearby?"
β
βββ Connection β "Let's communicate!"
β
β
GATT
β
ββββββ΄βββββ
Services Services
β
Characteristics
β
Actual data
IMPORTANT
Advertising, scanning, and connections are mainly part of the BLE discovery/connection process, while GATT, services, and characteristics are concerned with organizing and exchanging application data. Espressif's documentation separates these concepts through BLE GAP and GATT APIs.
4. ESP-NOW
This is a very useful and a special kind of communication method integrated into ESP32s.
ESP-NOW is a connectionless wireless communication protocol developed by Espressif for its Wi-Fi-capable chips. It allows devices such as ESP32 boards to exchange data directly using Wi-Fi radio communication, without establishing a normal Wi-Fi connection through a router.
A simple way to visualize it is:
ESP32 A π‘ β ESP-NOW β π‘ ESP32 B
Why's ESP-NOW "connectionless"?
All traditional Wi-Fi devices normally connects to an access point:
ESP32 β Router β Network
But in ESP-NOW, Data is transmitted directly in Wi-Fi vendor-specific action frames without establishing a conventional connection. This reduces the communication overhead and can provide very fast responses.
ESP-NOW is useful for applications where low latency is more important than having a normal internet connection.
Does ESP-NOW need any internet connection?
No, Any type of internet connections are not neededβπ
This is one of its biggest advantages.
Two ESP32 boards can communicate with each other even when there is no internet connection and no Wi-Fi router.
For example:
ESP32 + temperature sensor
β
ESP-NOW
β
ESP32 + display
The first ESP32 could measure the temperature and send it directly to the second ESP32.
How does ESP-NOW identify devices?
ESP32 boards have their unique MAC addrsses. ESP_NOW identify boards with these MAC addresess.
ESP32 A: MAC AA:BB:CC:11:22:33
Β Β Β Β Β Β Β Β Β Β Β Β β ESP-NOW
ESP32 B: MAC AA:BB:CC:44:55:66
Before sending unicast data, the sender normally adds the destination device as a peer. Espressif's API provides functions for adding, modifying and removing peers.
Communication methods
There are 3 ways to use ESP-NOW with other ESP32s. They are,
1. One-to-one communication.
The simplest setup is two ESP32 boards:
ESP32 A ββββ ESP-NOW ββββ> ESP32 B
For example,
ESP32 A βββββ> [Temperature = 27.5Β°C] ββββββ> to ESP32 B
ESP32 B could then display the temperature or perform another action.
2. One-to-many communication.
ESP-NOW can also be used with multiple devices.
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β βββ> ESP32 B
ESP32 A βββββΌββ> ESP32 C
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β βββ> ESP32 D
This is useful for applications such as a central controller communicating with multiple sensor nodes.
3. Many-to-many communication.
You can also have several devices communicating with each other:
ESP32 A ββ ESP32 B
Β Β Β Β βΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β β
ESP32 C ββ ESP32 D
This can be useful for more complex IoT systems.
How fast is ESP-NOW?
In Espresiff, they've documented the speed as,
The default ESP-NOW bit rate is 1 Mbps.
However, don't confuse the 1 Mbps radio rate with the actual application. Real-world performance depends on factors such as packet size, distance, interference, Wi-Fi channel, and hardware.
ESP-NOW's main strength isn't transferring huge files at high speed. Its strength is quick communication with relatively small amounts of data.
How much data can it send?
This is a very important detail because the answer depends on the ESP-NOW version itself.
According to current Espressif documentation:
ESP-NOW v1.0: maximum data length of 250 bytes
ESP-NOW v2.0: maximum data length of 1470 bytes
For maximum compatibility, 250-byte payloads are still a useful practical limit to keep in mind.
Is ESP-NOW secure?
Yes. ESP-NOW supports encryption using CCMP, based on AES-128.
It uses a Primary Master Key (PMK) and Local Master Keys (LMKs) for encrypted peer communication.
However, there is an important distinction:
Encrypted unicast communication β supported β
Encrypted broadcast/multicast communication β not supported β
So security needs to be considered when designing an ESP-NOW network.
Does it work with Wi-Fi?
Yes, and this is one of the interesting things about ESP-NOW.It also uses the ESP32's Wi-Fi radio, but it doesn't require a normal Wi-Fi connection.
It can also coexist with Wi-Fi and Bluetooth LE on supported Espressif devices.
For example,
an ESP32 could potentially communicate with another ESP32 using ESP-NOW while also having Wi-Fi functionality available.
But there is an important consideration: Wi-Fi channel configuration. ESP-NOW peers need to operate on the appropriate channel; if a device is using a Wi-Fi connection, the channel must be handled correctly.
Range
ESP-NOW can work over a fairly significant distance depending on the ESP32 hardware, antenna, transmit power, environment, obstacles, and interference.
Espressif gives examples of communication reaching around 200 m in open-space conditions for particular solutions, but this should not be treated as a guaranteed range for every ESP32 board.
I think I have discussed the most important details when it comes to the wireless section of the ESP32. Feel free to drop comments, ask questions and to share your valueable ideas with the community.
See you guys sooooooooon
- Written by Janada Pelahara













