ESP-NOW (Peer-to-Peer Direct Communication)

Imagine two walkie-talkies that can instantly talk to each other without needing a phone tower in between — that's ESP-NOW.

Connectivity9 blocksMicroPythonC++

Imagine two walkie-talkies that can instantly talk to each other without needing a phone tower in between — that's ESP-NOW. It's a fast, connectionless 2.4 GHz Wi-Fi frame protocol developed by Espressif that lets two or more ESP32 boards talk directly to each other by MAC address, with no Wi-Fi router required at all.


1. Real-World Uses

ESP-NOW shines whenever two or more boards need to talk directly and instantly, without any internet or router in the picture:

  • Wireless remote controls — a joystick or button board sends commands to a robot car or drone almost instantly (about 1 millisecond), far faster than going through a Wi-Fi router.
  • Sensor swarms — a handful of battery-powered sensor boards scattered around a garden or greenhouse, each reporting readings straight to one "hub" board, with no Wi-Fi network needed anywhere.
  • Quick two-board demos — the fastest way to get two ESP32 boards exchanging data with almost no setup, since there's no SSID/password to configure and no router to be in range of.

Trade-off worth knowing: ESP-NOW only works between ESP32 boards running this same protocol — it can't talk to the internet, and (in OMS specifically) it can't be combined with Bluetooth in the same project.


2. Hardware Specifications & Advantages

  • Compatible Boards: ESP32 only, per OMS's extension gating — ESP8266 does not appear in this extension's supported-boards list, even though Espressif's real ESP-NOW protocol does technically support ESP8266 hardware.
  • Conflicts with: Bluetooth BLE and BLE HID (Sections 7.3/7.4) — OMS won't let you use ESP-NOW blocks in the same project as either BLE extension.
  • Latency: ~1 ms (compared to 50–200 ms over traditional Wi-Fi router TCP/IP) — real ESP-NOW protocol figures.
  • Payload Size: Up to 250 bytes per packet — a real ESP-NOW protocol limit, not something OMS's code checks or truncates for you.
  • Addressing: 6-byte hardware MAC address (e.g., FF:FF:FF:FF:FF:FF for broadcast).

3. How it Works (Framing Protocol & Dispatcher)

OMS uses a tagged messaging protocol over raw ESP-NOW payloads:

  • S:<text> — String message packet
  • N:<number> — Floating-point numeric packet
  • V:<key>:<val> — Labeled key-value payload packet

Incoming messages are handled differently per language: C++ registers a real hardware receive callback (esp_now_register_recv_cb), so a message triggers your event block essentially instantly. MicroPython has no such interrupt — instead, a machine.Timer polls for new messages every 100ms, so there's an inherent ~0-100ms extra delay before a received message reaches your "on string/number/value received" block, on top of the ~1ms the radio itself takes.


4. Supported Blockly Blocks (9 Blocks)

Drawing the blocks…

5. Simulator Behavior

[!IMPORTANT] ESP-NOW runs without crashing in the browser-based Circuit Simulator, but is completely inert — same category of gap as Wi-Fi (Section 7.1). There is no second simulated board for a message to reach, so nothing is ever actually delivered:

  • Initialize ESP-NOW and Add Peer MAC both "succeed" silently — no error, but no real radio starts and no peer is really reachable.
  • Send String / Send Number / Send Labeled Value never raise an error, but the message never reaches anywhere — there's nobody listening.
  • On String/Number/Labeled Value Received blocks never fire — no message ever arrives, because none was ever really sent.
  • Get My MAC Address returns a fixed placeholder value (02:00:00:00:00:01), not this device's real hardware MAC — there's no real Wi-Fi radio in a browser tab to read one from.
  • As with Wi-Fi, all the blocks generate fully correct, real code for actual ESP32 hardware — ESP-NOW can only be meaningfully tested on real, uploaded boards, never through the Simulate button.
ESP-NOW (Peer-to-Peer Direct Communication) — OMS Parts