Open anecdata opened 1 year ago
@anecdata I think it's enough to set the ESP-NOW encrypt num in the menuconfig for the customer's applications. Do you have any application scenarios where you need to change the encryption number of ESPNOW at any time?
Do you have any application scenarios where you need to change the encryption number of ESPNOW at any time?
Yes. In the case of CircuitPython and MicroPython (and perhaps other environments), a single firmware build is used by most customers for each particular board. Those customers write their applications in Python and don't have access to menuconfig or the esp-idf build environment. Instead, the esp-idf APIs of interest get exposed to a Python library for those customers to use in their applications. Some of these customers may favor more Wi-Fi Access Point connections. Some of these customers may favor more than 7 ESP-NOW encrypted pairs. Some may not need either. Each customer has unique application requirements and needs the flexibility to implement features at runtime from the same build.
@anecdata Since we won't consider to add a new API, you can set a large number of encrypted peers in the menuconfig, and use an API at the application layer to limit the number that customers can set.
But is it possible to set CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM
= 17 at build time, and also allow the maximum of 15 stations for an AP at build time?
The goal would be to support for the customer any values within the maximum ranges, as long as the sum of the two aren't more than the number of encryption keys: • encrypted ESP-NOW pairs: 0-17 • stations connecting to an AP: 0-15
For example, using the same build, one customer may want all 17 ESP-NOW encrypted pairs and 0 AP stations. A second customer may want all 15 AP stations and can live with <= 2 ESP-NOW encrypted pairs. A third customer may want 12 ESP-NOW encrypted pairs and a max of 5 AP stations.
ok, we will consider this.
Thank you!
link
Currently, CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM can be 0-17, but it is a build-time option, whereas the maximum number of connections of SoftAP is a runtime option, 0-10 presumably under the assumption of ESP-NOW's default 7.
Solution: have a runtime API for maximum espnow encrypted peers, so that with a given firmware, user code (e.g., MicroPython, CircuitPython) can configure both SoftAP and ESP-NOW encryption key counts at runtime as appropriate for their applications.