• News


ESP-NOW: Espressif’s Wireless Communication Protocol

Shanghai, China
Dec 29, 2021

ESP-NOW is Espressif’s wireless communication protocol which reduces the five layers of the OSI model to only one.

ESP-NOW is a wireless communication protocol based on the data-link layer defined by Espressif. The big difference it makes is that ESP-NOW reduces the five layers of the OSI model to only one. In other words, the data need not be transmitted through the network layer, the transport layer, the session layer, the presentation layer, and the application layer. Also, there is no need for packet headers or unpackers on each layer, which leads to a quick response reducing the delay caused by packet loss in congested networks.

Additionally, ESP-NOW occupies fewer CPU and flash resources than traditional connection protocols, while it co-exists with Wi-Fi and Bluetooth LE. ESP-NOW supports various series of Espressif chips, providing a flexible data transmission that is suitable for connecting “one-to-many” and “many-to-many” devices. Moreover, ESP-NOW can be used as an independent, auxiliary protocol that helps with device provisioning, debugging, and firmware upgrades.

All in all, ESP-NOW, Espressif’s wireless communication protocol is efficient, responsive, and easy-to-develop. Below, you can find all the details about it.

ESP-NOW Device Control

ESP-NOW is a protocol that allows paired devices to communicate directly with one another through the data-link layer. The entire pairing process does not require a Wi-Fi connection or a third-party device such as a mobile phone. All it takes to pair two or more devices is the long press of a button.

  • One responder can be paired by multiple initiators.
  • One initiator can pair with multiple responders.

During device pairing, you can use the wirelessly-received signal strength indication (RSSI) to determine the distance between the devices, and authorize that distance. Only devices within the authorized distance can be paired successfully.

Using RSSI as a filter can also ensure that responders in different rooms do not interfere with each other during device pairing.

Furthermore, ESP-NOW has the following distinct advantages:

1)Quick Response

After power-on, the devices can transmit data and control other paired devices directly without any wireless connection, and with a response speed of milliseconds.

2)Low-power Consumption

ESP-NOW reduces the five layers of the OSI model to only one layer, which leads to truly easy communication and low-power consumption. A control button can work for two whole years with only two AA batteries.

3)Good Compatibility

When the device is connected to a router or works as a hotspot, it can realize a fast and stable communication through ESP-NOW. Even if the router is faulty or the network is unsteady, the device can keep the connection stable through ESP-NOW.

4)Improved Range and Reception

ESP-NOW supports long-distance communication, so it can be used in outdoor application scenarios, too. Additionally, it ensures a stable connection even among devices separated by thick walls or located in different floors. Moreover, ESP-NOW can support large-scale installations. For example, in an experiment conducted by Espressif’s R&D department, we placed four lights on the four corners of a large block of buildings. Each light was at a distance of 320 meters from the next one, so the four lights enclosed a total area of more than 100,000 square meters. In this case, all four lights were within the 500-metre control limit of our Button switch. Thus, we were able to use our Button switch for turning on and off any of the four lights, and also use the data forwarding function of ESP-NOW, in order to realize a multi-hop network among them.

5)Multi-layer Control

With ESP-NOW, you can control hundreds of devices through unicast, broadcast and group control.

6)Multiple Control Methods

In addition to the Button switch discussed earlier, ESP-NOW also operates with a touch switch, an LCD screen, voice control, and various sensors.

The next section of this article takes a closer look at device provisioning, debugging, and firmware upgrades based on ESP-NOW.

A. Device Provisioning

ESP-NOW can be used for device provisioning, along with Wi-Fi provisioning and Bluetooth provisioning. The first device needs to be provisioned via Bluetooth. Once this is complete, the other devices do not need to enter information such as SSID and password, because the first device will send this information to the others directly. Users, then, can choose whether to allow the remaining devices to access the network on the application side.

B. Device Debugging

With ESP-NOW you can obtain data logs for analysis and debugging. This function is especially convenient when users cannot come in direct contact with their devices, due to high voltage, high temperature, or when the devices are enclosed in a non-detachable case.

ESP-NOW supports many-to-many connections, so the initiator can receive logs from multiple responders, and detect any device faults quickly. The debugging function of ESP-NOW can also be used for obtaining the logs and the operation status of a connected device, such as its project version, number of nodes, memory usage, Wi-Fi signal strength, etc. This facilitates the fault analysis of the device.

Furthermore, by sending certain commands users can control the device, debug peripheral interfaces such as GPIO, UART, and LED, adjust parameters such as the Wi-Fi TX power and mode, or restart the device, reset it, and control its task operations.

It is worth mentioning that, during manufacturing, ESP-NOW can be used for performing an ageing test, an interference test, a wireless connectivity test, a module flash-read/write test, and a version-verification test on any device before it is shipped. This way hardware faults can be easily detected, and similarly any defective products can be removed promptly.

Developers can also use command lines to debug their devices.

C. Firmware Upgrade

ESP-NOW can be used for transferring large volumes of data, as is the case in firmware upgrades.

C.1) Resuming an Upgrade from the Break-point

When using ESP-NOW for firmware upgrades, the firmware is sub-packaged in fixed-size arrays of bytes. The device will record the upgrading status of each firmware package and write it into the flash. If the upgrading process is interrupted, the device will request only the remaining firmware packages, thus resuming the upgrade from the break-point onward.

C.2) Upgrading Multiple Devices

With ESP-NOW multiple devices can be upgraded at the same time in less than one minute.

C.3) Version Reset

If an error occurs while running the updated firmware on your device, you can reset it to the previous firmware version with a single command, and ensure a smooth running of the system.

All in all, by using ESP-NOW you can achieve:

  • device control with such features as easy pairing, quick response, low-power consumption, good compatibility, long-distance communication, and multi-layer control;
  • device provisioning with no SSID and password;
  • device debugging after fault detection and analysis;
  • firmware updates supporting resumption from the break-point onward, simultaneous upgrades of multiple devices, and version reset.

If you would like to learn more about ESP-NOW, Espressif’s wireless-communication protocol, or if you have any questions about it, please contact our customer support team.

Further Information

Share this article
  • LinkedIn
  • 微信


Reuse this content