toitlang / toit

Program your microcontrollers in a fast and robust high-level language.
https://toitlang.org/
GNU Lesser General Public License v2.1
1.22k stars 81 forks source link

Espnow tutorials needed #1806

Open nne998 opened 1 year ago

nne998 commented 1 year ago

Hi, Is there any espnow tutorials for esp32c3 chip ?

Thank you

floitsch commented 1 year ago

We don't have a tutorial yet, but there is an example here: https://github.com/toitlang/toit/blob/master/examples/espnow.toit

Note that Toit doesn't support running espnow at the same time as WiFi.

If you are using Jaguar, you have to disable Jaguar, so it doesn't start up the WiFi while the espnow program is running.

jag container install -D jag.disabled -D jag.timeout=2m  espnow examples/espnow.toit

This would disable Jaguar for 2 minutes while the espnow example is running.

kidandcat commented 3 days ago

We don't have a tutorial yet, but there is an example here: https://github.com/toitlang/toit/blob/master/examples/espnow.toit

Note that Toit doesn't support running espnow at the same time as WiFi.

If you are using Jaguar, you have to disable Jaguar, so it doesn't start up the WiFi while the espnow program is running.

jag container install -D jag.disabled -D jag.timeout=2m  espnow examples/espnow.toit

This would disable Jaguar for 2 minutes while the espnow example is running.

Can it be done with Artemis too? And what happens when the timeout expires if the app is still running? will it start failing? or will jaguar/artemis fail to configure the wifi?

kasperl commented 2 days ago

@kidandcat Artemis allows you to stop the networking while your app runs, so that way you can programatically insist that Artemis doens't interfere with your WiFi / espnow usage.

https://pkg.toit.io/github.com/toitware/toit-artemis@0.10.0/docs/artemis/library-summary#run(3%2C1%2C0%2Coffline%2Ctimeout)