This project provides examples to simplify the use of ESP-NOW.
ESP-NOW is a kind of connectionless Wi-Fi communication protocol that is defined by Espressif. Different from traditional Wi-Fi protocols, the first five upper layers in OSI are simplified to one layer in ESP-NOW, so the data does not need to go through the physical layer, data link layer, network layer, transport layer in turn, which reduces the delay caused by packet loss under congested network, and leads to quickly response time.

ESP-NOW occupies less CPU and flash resource. It can work with Wi-Fi and Blutooth LE, and supports the series of ESP8266、ESP32、ESP32-S and ESP32-C. The data transmission mode of ESP-NOW is flexible including unicast and broadcast, and supports one-to-many and many-to-many device connection and control. ESP-NOW can be also used as an independent auxiliary module to help network configuration, debugging and firmware upgrades.

There are two roles defined in ESP-NOW according to the data flow, initiator and responder. The same device can have two roles at the same time. Generally, switches, sensors, LCD screens, etc. play the role of initaitor in an IoT system, when lights, sockets and other smart applications play the role of responder.

Chips of ESP32、ESP32-C3、ESP32-S2 are recommended, ESP8266 and ESP32-S3 will be supported soon.
Setting the environment and getting ESP-IDF (release/v4.4 or tag v4.4) follow the Step .
Download ESP-NOW using the following:
git clone --recursive https://github.com/espressif/esp-now.git
note: the
--recursiveoption. This is required to pull the dependencies into ESP-NOW. In case you have already cloned the repository without this option, execute this to pull the submodules:git submodule update --init --recursive
It is recommended to first erase the flash if you are using this for the first time and then flash the firmware. Here are the steps:
$ cd /path/to/esp-now/examples/get-started/
$ export ESPPORT=/dev/tty.SLAB_USBtoUART
$ idf.py set-target esp32c3
$ idf.py erase_flash
$ idf.py flash monitor
There are some obvious advantages in ESP-NOW:
ESP-NOW provides a new provisioning method besides the Wi-Fi provisioning and Bluetooth provisioning. First, configuring the network for the first device via bluetooth, and other devices don't need to be configured the information of SSID/password, because the first device connected to the network can send these information to others directly. Users can choose whether to allow remaining devices to access the network on the APP side.
ESP-NOW can be used for the mass data transmission like firmware upgrade.
ESP-NOW can be used to receive the running log for debugging. It can be used in scene where the devices can't be contact directly because of the high-voltage electricity, high temperature. With the supporting of many-to-many connections, the initiator can receive logs from multiple responders to diagnose device faults quickly.
ESP-NOW can protect the data security with ECDH and AES128-CCM.
$ claude mcp add esp-now \
-- python -m otcore.mcp_server <graph>