Communicate

ESPNow Communicate

πŸ“» ESPNow – Communicate – Your “Secret Messaging”

What it does: Connects two or more D1 R32 boards directly without Wi-Fi.

Fast: Instant communication between D1 R32 boards

Direct: No routers, board-to-board communication

πŸ“‘ Example: Send to a friend board – Receive from a neighbor board

Β 

🧩 Fun Guide to ESP-NOW Communication Blocks (Clu-blocks Pro)

πŸ“Ά Important! ESP-NOW blocks let your robot send and receive messages directly to other ESP32 boards β€” fast, secure, and without needing a router. It’s like walkie-talkies for robots!


πŸ”§ Setup & Configuration

#BlockWhat it doesDropdown optionsWhat the options mean
1ESPnow setup my_now channel 1 tx power 20Initializes ESP-NOWchannel: 1–11
tx power: 8–20
– Channel: Wi-Fi channel used
– TX Power: signal strength (higher = longer range)
2ESPnow my_now Get local MAC addressGets your robot’s unique IDβ€”Useful for pairing or debugging
3ESPnow my_now Get source MAC address and signal strengthReads who sent the message and how strong it wasβ€”Great for identifying senders and checking signal quality

πŸ“€ Sending Messages

#BlockWhat it doesDropdown optionsWhat the options mean
4ESPnow my_now To MAC address FFFFFFFFFFFF Send message "Clu-Bots"Sends a message to a specific deviceβ€”Replace FFFFFFFFFFFF with the target MAC address
5ESPnow my_now Send message "n"Sends a reply or broadcast messageβ€”Can be used inside a callback or condition

πŸ“₯ Receiving Messages

#BlockWhat it doesDropdown optionsWhat the options mean
6ESPnow my_now Receive message (MAC Address, Content)Listens for incoming messages(MAC Address, Content), MAC Address, ContentChoose what data to extract from the message
7ESPnow my_now set callback function cbSets up a function to run when a message arrivesβ€”You define what happens when a message is received
8cb with: mac, msgDefines the callback functionβ€”You can use mac and msg to trigger actions
9if msg = "e"Checks the message contentβ€”Use conditions to respond to specific commands

🧠 Quick Tips for Students

  • Use setup + MAC address to create a secure, direct link between robots.
  • Use callback functions to make your robot react instantly β€” like replying or changing behavior.
  • Use signal strength to check how far apart your robots can be.
  • Use message content to send commands like "forward", "stop", or "dance".
On this page