Receiving data with ESP Now in UIFlow
-
I am trying to do some simple testing with passing integers/numbers from one M5StickC to another using ESPNOW. Can anyone show me how receive data?
-
Hi, you should't use the variables "addr" and "data" as shown in the snippets
I think it should work like this: -
Here is a simple flow that you can program on each M5StickC device that will send (Tx) and receive (Rx) a counter value using ESPNow.
I'm using broadcast to send the counter values, so will send data to all devices listening on the ESPNow network.
To make it point-to-point, you could use the "Add peer" block with the mac address of the other device within the flow and then use the "Send message with id" block to send data to only a specific device by its mac address.
If you had more than two devices on the ESPNow network, you would add multiple "Add peer" blocks (also changing the mac and ID values for each one) and multiple "Receive mac_address" blocks (also adding the specific mac you want to receive data from) to distinguish who was sending the data and who could receive the data.
Hope this helps!