toit icon indicating copy to clipboard operation
toit copied to clipboard

Implement ESP-now

Open floitsch opened this issue 3 years ago • 3 comments

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/network/esp_now.html

floitsch avatar Jan 13 '22 23:01 floitsch

I'm willing to support that if we find someone to do it. Who has an gustimate how complex that would be?

nivoc avatar Aug 08 '22 12:08 nivoc

It's hard to estimate. There are only very few esp-now functions and they aren't too complex. I'm pretty sure that it's pretty simple to get those functions exposed to Toit. The harder part is to deal with the integration of the WiFi. For example, we have abstracted away networking so that drivers (WiFi and others) run in their own services. However, esp-now needs to have WiFi enabled to work. This is probably something that could be ignored in the first version, but needs to be tackled eventually.

The other (minor) difficulty is that the esp-now functions don't use queues yet. This means that we would need to create them (using the existing queue-mechanisms) ourselves. For sending we could probably just ignore whether the sending was successful or not (fire-and-forget), but for receiving we would definitely need these queues.

All in all, it looks definitely feasible. I will see if it can rise to the top of my TODO list.

floitsch avatar Aug 08 '22 12:08 floitsch

Cool Thanks for the Details an Todo-Push :-)! Yes a rough implantation would be good enough in the first version. Could be improved if people really start to use it.

nivoc avatar Aug 08 '22 19:08 nivoc

Espnow was implemented in https://github.com/toitlang/toit/commit/7722235e7786d63ab8e5d496527c43eb13ee0eaa

floitsch avatar Jan 02 '23 14:01 floitsch