Sunday, July 14, 2024

ESP NOW - Intro (1)

 ESP NOW is a simple peer-to-peer

    wireless communication method.

It can be set up for one-to-one,

   one-to-many, and many-to-many comm.

Some people use it as a remote control solution.


How to use?

Summary of steps:

    1) init esp now

    2) add peer(s), statistically!

    2) register callbacks

    3) do send message

        // payload is 250 bytes max, C struct



1) init

    esp_now_init()


2) add peer

    esp_now_add_peer(&peerInfo);


3) register callbacks

    esp_now_register_send_cb (OnDataSent);

    esp_now_register_recv_cb (OnDataRecv);


4) send message

    esp_err_t result = \

        esp_now_send (broadcastAddress,

                      (uint8_t *) &myData,

                      sizeof(myData));


(to be continue)


Labels: , , , , ,

0 Comments:

Post a Comment

<< Home