mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
ci: partially enable example build for esp32c2
This commit is contained in:

committed by
morris

parent
acd4ca0f6e
commit
f7be540222
@@ -1,3 +1,6 @@
|
||||
| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- |
|
||||
|
||||
# ESPNOW Example
|
||||
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
@@ -8,22 +11,22 @@ This example shows how to use ESPNOW of wifi. Example does the following steps:
|
||||
* Initialize ESPNOW.
|
||||
* Register ESPNOW sending or receiving callback function.
|
||||
* Add ESPNOW peer information.
|
||||
* Send and receive ESPNOW data.
|
||||
* Send and receive ESPNOW data.
|
||||
|
||||
This example need at least two ESP devices:
|
||||
|
||||
* In order to get the MAC address of the other device, Device1 firstly send broadcast ESPNOW data with 'state' set as 0.
|
||||
* When Device2 receiving broadcast ESPNOW data from Device1 with 'state' as 0, adds Device1 into the peer list.
|
||||
Then start sending broadcast ESPNOW data with 'state' set as 1.
|
||||
* When Device1 receiving broadcast ESPNOW data with 'state' as 1, compares the local magic number with that in the data.
|
||||
If the local one is bigger than that one, stop sending broadcast ESPNOW data and starts sending unicast ESPNOW data to Device2.
|
||||
* If Device2 receives unicast ESPNOW data, also stop sending broadcast ESPNOW data.
|
||||
|
||||
In practice, if the MAC address of the other device is known, it's not required to send/receive broadcast ESPNOW data first,
|
||||
* In order to get the MAC address of the other device, Device1 firstly send broadcast ESPNOW data with 'state' set as 0.
|
||||
* When Device2 receiving broadcast ESPNOW data from Device1 with 'state' as 0, adds Device1 into the peer list.
|
||||
Then start sending broadcast ESPNOW data with 'state' set as 1.
|
||||
* When Device1 receiving broadcast ESPNOW data with 'state' as 1, compares the local magic number with that in the data.
|
||||
If the local one is bigger than that one, stop sending broadcast ESPNOW data and starts sending unicast ESPNOW data to Device2.
|
||||
* If Device2 receives unicast ESPNOW data, also stop sending broadcast ESPNOW data.
|
||||
|
||||
In practice, if the MAC address of the other device is known, it's not required to send/receive broadcast ESPNOW data first,
|
||||
just add the device into the peer list and send/receive unicast ESPNOW data.
|
||||
|
||||
There are a lot of "extras" on top of ESPNOW data, such as type, state, sequence number, CRC and magic in this example. These "extras" are
|
||||
not required to use ESPNOW. They are only used to make this example to run correctly. However, it is recommended that users add some "extras"
|
||||
There are a lot of "extras" on top of ESPNOW data, such as type, state, sequence number, CRC and magic in this example. These "extras" are
|
||||
not required to use ESPNOW. They are only used to make this example to run correctly. However, it is recommended that users add some "extras"
|
||||
to make ESPNOW data more safe and more reliable.
|
||||
|
||||
## How to use example
|
||||
@@ -35,7 +38,7 @@ idf.py menuconfig
|
||||
```
|
||||
|
||||
* Set WiFi mode (station or SoftAP) under Example Configuration Options.
|
||||
* Set ESPNOW primary master key under Example Configuration Options.
|
||||
* Set ESPNOW primary master key under Example Configuration Options.
|
||||
This parameter must be set to the same value for sending and recving devices.
|
||||
* Set ESPNOW local master key under Example Configuration Options.
|
||||
This parameter must be set to the same value for sending and recving devices.
|
||||
@@ -45,7 +48,7 @@ idf.py menuconfig
|
||||
* Set Send len under Example Configuration Options.
|
||||
* Set Enable Long Range Options.
|
||||
When this parameter is enabled, the ESP32 device will send data at the PHY rate of 512Kbps or 256Kbps
|
||||
then the data can be transmitted over long range between two ESP32 devices.
|
||||
then the data can be transmitted over long range between two ESP32 devices.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
@@ -110,8 +113,8 @@ I (24125) espnow_example: send data to 30:ae:a4:80:45:68
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If ESPNOW data can not be received from another device, maybe the two devices are not
|
||||
on the same channel or the primary key and local key are different.
|
||||
If ESPNOW data can not be received from another device, maybe the two devices are not
|
||||
on the same channel or the primary key and local key are different.
|
||||
|
||||
In real application, if the receiving device is in station mode only and it connects to an AP,
|
||||
In real application, if the receiving device is in station mode only and it connects to an AP,
|
||||
modem sleep should be disabled. Otherwise, it may fail to revceive ESPNOW data from other devices.
|
||||
|
Reference in New Issue
Block a user