sdkn104 / Arduino

Sketches and libraries for Arduino IDE for Arduino modules, ESP8266 modules, etc.
Other
7 stars 1 forks source link

Can this Library be adapted for ESP32 ESP_NOW? #2

Open JL1946 opened 5 years ago

JL1946 commented 5 years ago

Can this Library be adapted for ESP32 ESP_NOW?

Is there some library similar to this one that will function for ESP32?

I am interested in the ACK return to the Controller by the Slave. There is very little around that describes how this is supposed to work or how to implement the function.

Thanks for responding.

sdkn104 commented 5 years ago

Hi, This library would not work for ESP32, since the esp-now header files in the SDKs are similar but different. For example, esp_now_set_self_role() does not exist in ESP32 SDK. I think it requires small modification to adapt for ESP32. ESP8266: https://github.com/esp8266/Arduino/blob/74819a763bfb6e9890a57411dcea4aba221a778d/tools/sdk/include/espnow.h ESP32: https://github.com/espressif/arduino-esp32/blob/a59eafbc9dfa3ce818c110f996eebf68d755be24/tools/sdk/include/esp32/esp_now.h

ACK mechanizm in this library is so simple. It send message then enter to loop waiting for ACK using a global variable that is aware both to receive-callback and main routine.

Thanks.